M28 is a Lisp interpreter that supports core Lisp functionality, including arithmetic operations, list manipulation, control structures, and user-defined functions. It features a REPL (Read-Eval-Print Loop) for interactive use and can execute Lisp code from files.
To use M28, follow these steps:
- Ensure you have Go installed on your system.
- Clone the repository:
git clone https://github.com/mmichie/m28.git
- Navigate to the project directory:
cd m28
- Build the project:
make
To start the M28 Lisp REPL, run:
./bin/m28
In the REPL, you can enter Lisp expressions and see their evaluated results.
To execute a Lisp file with the .m28
extension:
./bin/m28 path/to/your/file.m28
To evaluate a single Lisp expression:
./bin/m28 "(+ 1 2 3)"
- Arithmetic Operations: Basic arithmetic (
+
,-
,*
,/
,%
) - Comparison Operations: Numeric comparisons (
<
,>
,=
,>=
,<=
,!=
) - List Operations: List manipulation (
car
,cdr
,cons
,list
,length
) - Logic Operations: Boolean logic (
and
,or
,not
) - Control Structures: Conditionals and loops (
if
,cond
,case
,do
) - Function Definition: Lambda expressions and named functions
- Special Forms:
quote
,define
,lambda
,let
,set!
- Type Checking: Functions to check types (
number?
,string?
,symbol?
,list?
) - Error Handling: Built-in error reporting
github.com/chzyer/readline
for REPL functionality