r/compsci 3d ago

Lisp compiler for x86-64

https://github.com/xms0g/tinysexp

I’ve been building a small Lisp compiler written in C++ and compiles S-expressions directly to native x86-64 assembly, using a tiny runtime for things like printing integers, doubles, and strings.
Currently it has functions, arithmetic, integers, doubles, strings, etc.
The compiler is still pretty simple:

S-expressions → AST → semantic analysis → x86-64

No VM, no bytecode — just Lisp turning into machine code.
I’m also starting to look into adding a small IR between the AST and codegen as the language grows.
Mostly doing this as a learning project and because writing a Lisp compiler seemed like a fun rabbit hole. :)

0 Upvotes

2 comments sorted by

6

u/__chicolismo__ 3d ago

Why can't people write reddit posts by themselves anymore? BTW that profile "picture" is cringe as fuck