3 ms·
Mal is absolutely great. I implemented it a couple of month ago (all tests pass while self hosting) in go. There was already an implementation in go, but I did
by lawl 7y ago
Mal is absolutely great. I implemented it a couple of month ago (all tests pass while self hosting) in go. There was already an implementation in go, but I did it for the learning experience. Got more comfortable with go. I feel like lisp makes a lot more sense to me now. And I have a basic understanding of how to go about writing an interpreter/compiler.
The documentation in my opinion is fantastic, because I could jump in and start implementing it without feeling like I was just translating prose and diagrams to code (need to actually understand what you're implementing), or ever feeling completely lost. The end product still feels like 'my' interpreter.
If you'd like to learn more about lisp and interpreters/compilers, or just get more familiar with a language to implement it in: I can absolutely fully recommend implementing mal.
Edit: Oh, and if you do implement it yourself. Don't look at existing code. If I wasn't sure on the exact expected behavior at any point, I used the online JS implementation of mal as a black-box to see how it behaves: https://kanaka.github.io/mal/ https://kanaka.github.io/mal/
- tony-allan 7y agoThanks for the tip about the online implementations. As you suggest a great resource while you're doing your own implementation.