October 22nd, 2024

A Lisp compiler to ARM written in Lisp

uLisp has launched an experimental Lisp compiler that converts functions into ARM machine code, enhancing performance. It supports more functions, features better error checking, and is available on GitHub.

Read original articleLink Icon
A Lisp compiler to ARM written in Lisp

uLisp has introduced a new experimental Lisp compiler designed to convert Lisp functions into ARM machine code, enhancing the efficiency of code execution. The latest version, released on August 21, 2024, improves upon its predecessor by compiling expressions to leave results in a register instead of pushing them onto the stack, thus optimizing performance. It now supports additional Lisp functions, including 1+, 1-, car, and cdr, and features enhanced error checking. The compiler is written in a subset of Common Lisp compatible with uLisp and can run on ARM boards with a minimum of 5000 objects of workspace. Users can compile functions by calling the compile command, which replaces the original Lisp code with machine code. The compiler currently has limitations, such as only handling functions with up to four integer arguments and generating less efficient code compared to hand-written assembly. However, it supports recursive function calls and uses a stack-based approach for managing register usage. The compiler's design allows for potential adaptations to generate code for other architectures like AVR or RISC-V. The source code is available on GitHub for those interested in exploring or contributing to its development.

- uLisp's new compiler converts Lisp functions into ARM machine code for improved performance.

- The latest version includes support for additional Lisp functions and better error checking.

- The compiler is designed to run on ARM boards with specific workspace requirements.

- Limitations include handling only up to four integer arguments and generating less efficient code than hand-written assembly.

- The source code is accessible on GitHub for further exploration and development.

Link Icon 2 comments
By @nathell - 3 months
Nice! I’ve been working on a similar thing – a Clojure compiler to x86 written in Clojure, with zero dependencies: https://github.com/nathell/lithium