I'm implementing a lisp. In lua. For fun!!

It's called lam, which could be
- short for a Lisp Acdw Made
- a reversal of MAL, the popular make a lisp project
- the thing you go on when a scheme goes wrong
- .... other things .... ????
Anyway, in this series I'm going to take you on a tour of all the parts of lam, from the reader to the types to evaluating and all the rest. Along the way, I'll talk about my successes, failures, false starts, and everything else that comes with trying something new. Stay tuned, yall :)
general plan for posts
I'm planning on covering each lua module in lam in turn, and in roughly this order:
- read, where I convert program text into a lisp structure (one of the benefits of lisp is that the AST is the code)
- type, where I define all the types of the language as well as a few utility functions
- eval, where the read-in forms are evaluated to produce a value
- load and repl, closely-related modules that marry read, type, and eval to load files and, you know, run a repl.
- core, the primitive environment of lam
You may notice other files in the repo. They are either leftovers from rewrites – which I plan on eventually rewriting themselves – or vendored dependencies: specifically utf8.
Modules I still want to write but either need rewriting or ... writing include
- test, the test suite
- lang, a macro library
- errs (or maybe oops), an error & debugging library
- ... probably others
That leaves one file unaccounted for:
util.lua
Since the util module isn't long or important enough for its own post, I'll quickly talk about it here. I hope to keep shrinking the size of util until I can delete this file (and section on this page) altogether.
util.error(desc, ...)
- This function wraps lua's
error
to make writing errors a little easier on myself. I'm not sure how helpful this is, really. I need to write another error-handling library to really make it work. util.pop(tbl)
- Another convenience fuction.
Lua's
table.remove
removes an element from a table, but by default it removes it from the end.pop
removes it from the beginning.
shitty lisp club
I'm part of a little club where we're writing shitty lisps. Check us out at the #shittylisp hashtag on fedi! (I think I've linked that right .. that's federation for you.)