# How to make a Lisp interpreter in 56 languages

- Speaker: [Dov Murik](/wiki/speakers/dov-murik.md)
- Event: [Reversim Summit 2016](/wiki/years/2016.md)
- Video: https://www.youtube.com/watch?v=VzI0CIqT6s8
- Transcript: [/transcripts/2016/17-VzI0CIqT6s8.md](/transcripts/2016/17-VzI0CIqT6s8.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [Performance](/wiki/topics/performance.md), [Functional Programming](/wiki/topics/functional-programming.md), [Software Engineering](/wiki/topics/software-engineering.md), [Algorithms](/wiki/topics/algorithms.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

This talk explores the "Make A Lisp" project, an educational initiative centered around implementing a Lisp dialect across dozens of programming languages. The speaker discusses the core components required to build a functional interpreter, ranging from basic I/O and parsing to advanced features like tail call optimization and macros. The audience learns how language interpreters can be built in unusual or even non-traditional environments, demonstrating the universal principles of programming language design.

## Key points

- [0:00](https://www.youtube.com/watch?v=VzI0CIqT6s8) The speaker introduces the "Make A Lisp" project, an educational framework created by Joel Martin for implementing a simple Lisp dialect in various languages.
- [0:00](https://www.youtube.com/watch?v=VzI0CIqT6s8) Building the base interpreter requires reading input, printing output, parsing data into an abstract syntax tree, and serializing it back.
- [1:21](https://www.youtube.com/watch?v=VzI0CIqT6s8&t=81s) To handle loops without stack overflow, the project relies on tail call optimization to transform recursive calls into jumps.
- [1:21](https://www.youtube.com/watch?v=VzI0CIqT6s8&t=81s) Macros allow extending the language by writing Lisp functions that process other Lisp code as input and output.
- [3:09](https://www.youtube.com/watch?v=VzI0CIqT6s8&t=189s) The Lisp dialect is powerful enough to implement an interpreter of itself, known as self-hosting.
- [3:09](https://www.youtube.com/watch?v=VzI0CIqT6s8&t=189s) A compiler was also developed to translate the Lisp dialect into LLVM intermediate representation, generating native binaries.

## Takeaways

- Understand the core components needed to build a simple interpreter, including parsers and evaluators.
- Learn how tail call optimization enables recursion without exhausting memory.
- Explore the concept of self-hosting by implementing an interpreter in its own language.

## Questions this talk answers

- How do you implement an interpreter for a Lisp dialect from scratch?
- What is tail call optimization and how does it replace traditional loops?
- How can you achieve self-hosting in a custom programming language?

## Technologies

Python, Make, Tcl, PostgreSQL, Visual Basic, JavaScript, Java, PostScript, LLVM, COBOL

## Tags

compilers, interpreters, lisp, programming languages, recursion
