A minimalist Lisp dialect and successor to tinylisp.
- Only 20-ish builtins and five data types
- Tail-call optimization, allowing unlimited recursion depth for properly written functions
- Lexical scope and closures
- A simple yet powerful macro system
- An automatically loaded core library, written in tinylisp 2
- Short aliases for commonly used functions, convenient for code golf
You can run tinylisp 2 in interactive REPL mode at Replit.
If you git clone
tinylisp 2 to your computer (requires Python 3.6 or higher), you have two options: run a file, or open the REPL.
- To run code from a file, pass the filename as a command-line argument to the interpreter:
python3 tinylisp2.py file.tl
(Linux) ortinylisp2.py file.tl
(Windows). - To start the REPL, run the interpreter without command-line arguments:
python3 tinylisp2.py
ortinylisp2.py
.
Helpful commands when using the REPL:
(help)
displays a help document.(restart)
clears all user-defined names, starting over from scratch.(quit)
ends the session.