![]() |
Lizard is a Python‑compatible language that adds curly braces and optional semicolons to Python syntax, with a self‑hosted compiler that targets clean Python via the ast module. |
def hello_world() {
print("Hello World!");
}
if True {
hello_world();
}
Transpiled output:
def hello_world():
print('Hello World!')
if True:
hello_world()- Python‑compatible syntax with
{}blocks and optional; - Lexer → parser → AST →
ast.unparsepipeline (no text‑based indentation tricks) - Supports comprehensions, decorators, and triple‑quoted strings
- Runs on the standard Python runtime
- Self‑hosting compiler (Lizard in Lizard), bootstrapped from Python
- VSCode syntax highlighting support
- Hello world:
examples/hello.lz - Factorial:
examples/factorial.lz - Comprehensions + dict/set literals:
examples/comprehensions.lz - Decorators:
examples/decorators.lz - Multiline strings:
examples/multiline_strings.lz
- PyPI: lizard-lang
- VSCode Extension: Lizard Lang
pip install lizard-langRun:
lizard examples/hello.lzpytestLizard is experimental.
Implemented:
- lexer + parser + AST pipeline
- brace blocks and semicolon‑optional syntax
- Python code generation via
ast.unparse - self‑hosting compiler (Lizard in Lizard)
Planned:
- formatter
- LSP support
- LLVM + hybrid FFI backend
Because some developers prefer:
if (condition) {
doSomething();
}over:
if condition:
do_something()Lizard explores whether Python can support both styles while staying fully compatible with Python semantics.
MIT
