Zerionyx Documentation & Libraries

Welcome to the official docs and standard library reference for Zerionyx.

Getting Started

Recommended Environment

Language Grammar

PROGRAM            ::= (STATEMENT NEWLINE*)*

STATEMENT          ::= SIMPLE_STATEMENT | COMPOUND_STATEMENT

SIMPLE_STATEMENT   ::=
      "load" STRING
    | "return" EXPR
    | "continue"
    | "break"
    | EXPR

COMPOUND_STATEMENT ::=
      IF_EXPR
    | FOR_EXPR
    | WHILE_EXPR
    | DEF_FUNC

EXPR               ::= 
      "let" IDENTIFIER "=" EXPR
    | IDENTIFIER "=" EXPR
      "let" IDENTIFIER "as" EXPR
    | IDENTIFIER "as" EXPR
    | IDENTIFIER ("+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "^=") EXPR
    | COMP_EXPR (("and" | "or") COMP_EXPR)*

COMP_EXPR          ::= 
      ARITH_EXPR (("==" | "<" | ">" | "<=" | ">=" | "!=") ARITH_EXPR)*
    | "not" COMP_EXPR

ARITH_EXPR         ::= TERM (("+" | "-") TERM)*

TERM               ::= FACTOR (("*" | "/" | "//" | "%") FACTOR)*

FACTOR             ::= ("+" | "-") FACTOR | POWER

POWER              ::= CALL ("^" FACTOR)*

CALL               ::= ATOM ("(" (EXPR ("," EXPR)*)? ")")?

ATOM               ::= 
      INT | FLOAT | STRING | IDENTIFIER
    | "(" EXPR ")"
    | LIST_EXPR
    | LIST_INDEX
    | IF_EXPR
    | FOR_EXPR
    | WHILE_EXPR
    | DEF_FUNC
    | COMMENT

GET_INDEX         ::= "(" IDENTIFIER ">" EXPR ")

GET_MEMBER        ::= IDENTIFIER  "." CALL

LIST_EXPR         ::= "[" (EXPR ("," EXPR)*)? "]"

HASHMAP_EXPR      ::= "{" (EXPR ("," STRING ":" EXPR)*)? "}"

NAMESPACE_EXPR    ::=
      "namespace" IDENTIFIER
      NEWLINE STATEMENT NEWLINE "done"

IF_EXPR           ::= 
      "if" EXPR "do" STATEMENT
      (NEWLINE "elif" EXPR "do" STATEMENT)*
      (NEWLINE "else" STATEMENT)?
      NEWLINE "done"

FOR_EXPR          ::=
      "for" IDENTIFIER "=" EXPR "to" EXPR
      ("step" EXPR)?
      "do" STATEMENT
      NEWLINE "done"

WHILE_EXPR        ::= 
      "while" EXPR "do" STATEMENT
      NEWLINE "done"

DEF_FUNC          ::= 
      "defun" IDENTIFIER "(" (IDENTIFIER ("," IDENTIFIER)*)? ")"
      ("->" EXPR)?
      NEWLINE STATEMENT NEWLINE "done"

COMMENT           ::= "#" /[^\n]*/

Zen of Zerionyx

The Zen of Zerionyx, by MemeCoder.

Clarity is better than cleverness.
Consistency is better than chaos.
Freedom in syntax, but not in structure.
Parentheses are for math, backslashes are for flow.
The caret (^) means power — and nothing else.
Blocks should be explicit: do...done says it all.
if is a command, not a value.
let or =, pick one — but be clear.
Whitespace is free; newlines are not.
Write like a poet, execute like a machine.
Code is for humans first, machines second.
elif is enough — no need for else if.
load means include — not magic.
Indentation is rhythm, not restriction.
When in doubt, don't guess — define it.
Simplicity comes first.
If it's hard to explain, it's probably wrong.
If it's easy to explain, it might be right.
Weirdness is not a feature.
Zerionyx may be magical, but its syntax must be real.

Built-in Functions

Standard Libraries

list string math ffio hash memory net random sys threading time keyboard termcolor

How to Use Libraries

Zerionyx Editor

About Zerionyx Editor

Key Features

Keyboard Shortcuts

To launch: python ./ide/ZerionyxEditor.py