Documentation / Runtime

MLisp interpreter.

Use the standalone interpreter to explore MLisp interactively or run a complete program from a file.

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

CommandBehavior
mlispStart the interactive REPL.
mlisp file.mlispEvaluate one source file and exit.
mlisp --versionPrint 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.