01
Start the REPL
Run mlisp without arguments to open the interactive read–evaluate–print loop.
$ mlisp
> (+ 20 22)
42
> (def name "MLisp")
"MLisp"
> (concat "Hello, " name)
"Hello, MLisp"
The same runtime is reused for every entry, so definitions remain available for the rest of the session. The primary prompt is >. When a form is not complete, the interpreter switches to .. and keeps reading lines until the expression closes.
> (let ((answer 42))
.. (print "answer:" answer))
answer: 42
nil
Send end-of-input to leave the REPL. An unfinished expression at that point is reported as an error.
02
Run a file
Pass one filename to read and evaluate that program, then exit. The filename may be an absolute path or a path relative to the current working directory.
; hello.mlisp
(def greeting "Hello from MLisp")
(print greeting)
$ mlisp hello.mlisp
Hello from MLisp
nil
The interpreter reads the file as UTF-8 and evaluates it as one input. Printed output appears first, followed by the value of the final form. A read or evaluation error names the file and exits with a failure status; earlier output and definitions are not rolled back.
03
Command summary
| Command | Behavior |
|---|---|
mlisp | Start the interactive REPL. |
mlisp file.mlisp | Evaluate one source file and exit. |
mlisp --version | Print the interpreter version and exit. |
This guide intentionally starts small. Build and installation notes, platform details and additional runtime topics will be added as the interpreter develops.