Pico8Lisp

Published 2023-06-12

Pico8lisp is a small lisp interpreter built on PICO-8 virtual machine!

You can find a walkthrough of the programming language features on my github here: https://github.com/andrewguy9/pico8lisp


You can type commands directly into the shell.

<return> submits the command.

Press <up> and <down> to scroll through your command history.

Press <left> and <right> to move the cursor.

<backspace> will remove the character to the left of the cursor.

<shift>-d will remove the character to the right of the cursor.

Toggle between insert and replace modes by pressing <shift>-I.

Literal numbers are just the numbers themselves.

Symbols are used as names for forms/functions/constants/just about anything. Symbols can be written as series of letters a-z. More on that later.

Nil can be written as nil

Note that nil evaluated to an empty list (). That's because the symbol nil is bound to the empty list. This is the only false value in picolisp!

Everything except nil is true.
But we do have a special value to represent truth.

The first element of a list is assumed to be a function.

You can even nest list expressions.

Supported Numeric Functions

If your repl gets confusing, clear the screen

You can write a list literal with the quote function.

Quote prevents the list from being evaluated!

There is a special quote operator to make this to read.

There are many functions which work with lists

By default symbols are evaluated, but you can prevent that with quote.

You can define global symbols with a value.

While def symbols are globally available, you can make locally scoped definitions with let

Use defn to make a function globally accessible.

Branches are supported by if statements.

If else if..., else statements are supported via cond

Supported logic operators:

Examples