
Mal – Make a Lisp, implemented in 79 languages - tony-allan
https://github.com/kanaka/mal/
======
lawl
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
Thanks for the tip about the online implementations. As you suggest a great
resource while you're doing your own implementation.

------
azhenley
This looks like an awesome resource for learning new languages and also for
understanding Lisp at a more fundamental level. I'm going to share this with
my students next semester when I teach PL.

Are there any other projects like this that let you compare implementations
using many different languages (e.g., Rosetta Code)?

~~~
Schoolmeister
It does remind me of the Real World repository [0]. It is basically a Medium
clone implemented in tons of different frontend and backend frameworks.
Probably not exactly what you were looking for, since it's more related to the
frameworks rather than the programming languages, but it is still interesting
nonetheless.

[0]
[https://github.com/gothinkster/realworld](https://github.com/gothinkster/realworld)

------
gklitt
I made it ~60% of the way through this and thought it was really well done.
The guide gives detailed instructions so you never feel stuck, but because
it's language-agnostic you still have to translate everything into specific
code which forces real understanding (can't just copy-paste code snippets).

------
minxomat
The TempleOS version of Mal includes the optional GC. It's written in HolyC
and might be one of the few semi serious programs written for the OS.

------
KineticLensman
I started my Mal implementation almost exactly one year ago as a winter
project after it was previously discussed on HN. I finished it four months
later [0], with a great sense of achievement (I hadn’t programmed anything so
complex for more than 20 years).

Unlike many of the Linux-based implementations I used C# in Visual Studio, and
I never managed to get the automated test-suite to work. I tried very hard not
to cheat but did have to refer to the reference C# implementation a couple of
times. The implementation of macros was the hardest part, not helped by a
month where I got almost no coding done and a couple of silly errors in an
earlier step (which one of the tests I’d missed would have uncovered). I made
what I thought were a couple of improvements to the base language, including
better error handling, multi-line forms and multi-form lines.

For this winter’s project, I’m going to see if I can take source code for the
original Elisa chatbot and re-implement it in MAL. I’m also tempted to see if
I can build a simple IDE for MAL.

[0] [https://www.non-kinetic-
effects.co.uk/blog/2019/04/28/MAL-5](https://www.non-kinetic-
effects.co.uk/blog/2019/04/28/MAL-5)

------
dang
A thread from 2017:
[https://news.ycombinator.com/item?id=15226110](https://news.ycombinator.com/item?id=15226110)

2015:
[https://news.ycombinator.com/item?id=9121448](https://news.ycombinator.com/item?id=9121448)

One comment from 2016:
[https://news.ycombinator.com/item?id=12720777](https://news.ycombinator.com/item?id=12720777)

~~~
tony-allan
Joel Martin first presented about Mal in 2014 and his presentation was written
in Mal. Awesome!

[https://github.com/kanaka/mal/blob/master/examples/clojurewe...](https://github.com/kanaka/mal/blob/master/examples/clojurewest2014.mal)

