Getting Started
- Install Zerionyx:
git clone https://github.com/memecoder12345678/Zerionyx
- Run a file:
python ./interpreter/Zerionyx.py yourfile.zer
- Open interactive shell:
python ./interpreter/Zerionyx.py
- See homepage for more info.
Recommended Environment
- For learning: Python 3.11+ (best for beginners and educational purposes)
- For automation: PyPy 3.11 (recommended when running repetitive tasks or automation scripts)
- IDE recommendation: Use Zerionyx Editor with syntax highlighting for the best learning experience
- Note: While the language is designed for simplicity, PyPy can significantly speed up automation tasks
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
- append(obj, val) → list — Add
val
to end ofobj
returnval
- catch(func, args) → list — Run
func
withargs
return[result, none]
if ok or[none, err]
if error - clear() → none — Clear terminal
- extend(a, b) → none — Add all in
b
toa
both must be list - finally(f, a, final_f, final_a) → list — Run
f
witha
then always runfinal_f
withfinal_a
return likecatch
- input(prompt) → string — Show
prompt
get user input - get_password(prompt) → string — Show
prompt
get user password - insert(lst, i, val) → none — insert
val
tolst
at indexi
- is_func(x) → bool — Check if
x
is func - is_list(x) → bool — Check if
x
is list - is_none(x) → bool — Check if
x
is none - is_num(x) → bool — Check if
x
is number - is_str(x) → bool — Check if
x
is string - is_bool(x) → bool — Check if
x
is boolean - is_thread(x) → bool — Check if
x
is thread - keys(hm) → list — Return list of all keys in
hm
(a hashmap) - values(hm) → list — Return list of all values in
hm
- items(hm) → list — Return list of
[key, value]
pairs inhm
- has(hm, key) → bool — Return
true
ifkey
exists inhm
- get(hm, key, default) → any — Return value for
key
ordefault
if not found - set(hm, key, value) → none — Add or update
key
inhm
withvalue
- del(hm, key) → none — Delete
key
and its value fromhm
- len(x) → number — Get length of
x
- panic(msg, type) — Stop with err
msg
andtype ('RT': 'Runtime Error', 'M': 'Math Error', 'IO': 'IO Error' or 'T': 'Type Error')
- pop(lst, i) → any — Remove and return item at
i
inlst
- print(text) → none — Prints
text
to the standard output with no newline - println(text) → none — Same as
print
but adds a newline - to_float(x, silent) → float/none — Convert
x
to float returnnone
if fail andsilent
true else raise - to_int(x, silent) → int/none — Convert
x
to int returnnone
if fail andsilent
true else raise - to_str(x) → string — Convert
x
to string - type(x) → string/none — Return type of
x
as string or none - pyexec(code) → any — Executes embedded Python code and returns its result (use with caution)
- slice(l, from, to, step) → list/string/hashmap — Slice list/string/hashmap
l
fromfrom
toto
stepstep
(exclusive)
Standard Libraries
How to Use Libraries
- To use a library, add
load "libs.<name>"
at the top of your .zer file. - Example:
load "libs.math"
- Then call functions as documented above.
Zerionyx Editor
About Zerionyx Editor
- Modern, lightweight code editor designed for Zerionyx language
- Syntax highlighting, auto-complete, file explorer, markdown preview
- Open images, manage folders, and more
- Cross-platform (Windows/Linux/Mac, requires Python 3.11+ and PyQt5)
Key Features
- Tabbed editing, drag & drop file tree, and project explorer
- Live Markdown preview for
.md
files - Quick commenting/uncommenting for Zerionyx code
- Auto-completion for keywords, functions, and types
- Image viewer for common formats (PNG, JPG, GIF, etc.)
Keyboard Shortcuts
- Ctrl+N: New file
- Ctrl+O: Open file
- Ctrl+K: Open folder
- Ctrl+Shift+K: Close folder
- Ctrl+S: Save file
- Ctrl+Shift+S: Save as
- Ctrl+F: Find
- Ctrl+H: Find and Replace
- Ctrl+B: Toggle file tree
- Ctrl+Shift+E: Show explorer
- Ctrl+Q: Exit
- Ctrl+/: Toggle comment (Zerionyx files)
- Ctrl+Space: Autocomplete suggestions
- Ctrl+P: Toggle Markdown preview
- Ctrl+X: Cut line (when nothing selected)
- Ctrl+Z / Ctrl+Y: Undo / Redo
- Ctrl+A: Select all
To launch:
python ./ide/ZerionyxEditor.py