Skip to content

Paul-Andre/Wew-Lisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wew Lisp

This is a lisp interpreter I am writing for fun using nothing but assembly (x86_64 NASM) and linux syscalls.

Even though it lacks many features at this stage, it can already execute simple programs, for example:

(define factorial (lambda (n) 
                    (if (<= n 1) 1
                      (* n (factorial (- n 1))))))

(list (factorial 1)
      (factorial 2)
      (factorial 3))

Instructions:

To assemble and link:

nasm -felf64 interp.asm
ld interp.o -o interp

To run a program, pipe it into the interpreter's standard input. At this time, there is no repl mode, so the program is parsed and run only once the standard input reaches its end.

./interp < factorial.scm

Design principles

While this is not meant to be a Scheme (Scheme has quite a few tricky features), I plan on using a similar API as Scheme when possible.

About

Lisp interpreter in assembly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published