⌨️ LILisp

Alt Text


Background

This project shared concepts with many of my previous assignments, namely 122’s Clac and C0VM, and 213’s Shell Lab. This project also served as a way for me to further explore my interest in systems programming. Additionally, much inspiration came from Daniel Holden’s book Build Your Own Lisp .


Functionality

I used the Micro Parser Combinators library to automagically parse each input line into an abstract syntax tree. These were then converted into trees of what I defined as “lisp_vals,” which have one of many different types including numbers, symbols, or functions. Features of this implementation include builtin functions, user defined functions, recursion, loading files, conditionals, variables, mathematical and logical operations, and error handling. A more detailed list of functions can be found in the README here.


Comments

This project was definitely one of those that demonstrated the beauty (and delicacy) of C. Like Malloc Lab, this project was littered with seg faults and pointer errors; one malloc call of the wrong size could break all my functions. But as someone who’s favorite lab was Malloc, I found working through these errors to be rewarding, albeit definitely frustrating at times.


GitHub repo