3 ms·
One great way to learn Lisp is to write your own: > The goal of the Make-A-Lisp project is to make it easy to write your own Lisp interpreter without sacrifici
by carapace 3y ago
One great way to learn Lisp is to write your own:
> The goal of the Make-A-Lisp project is to make it easy to write your own Lisp interpreter without sacrificing those many "Aha!" moments that come from ascending the McCarthy mountain. When you reach the peak of this particular mountain, you will have an interpreter for the mal Lisp language that is powerful enough to be self-hosting, meaning it will be able to run a mal interpreter written in mal itself.
~ https://github.com/kanaka/mal/blob/master/process/guide.md https://github.com/kanaka/mal/blob/master/process/guide.md
https://github.com/kanaka/mal https://github.com/kanaka/mal
- kazinator 3y agoIf you don't know Lisp, and start writing your own, you're only learning your own concoction, and not any other Lisp. And that concoction has its limits. It doesn't compare to the breadth and scope of the Lisp culture. Interacting only with something you have made is the worst possible way to learn anything about existing, mainstream Lisp. Not knowing anything about the prior art will practically ensure that your own thing is a collection of quirks specific to it, and that then ensures that your Lisp knowledge is entirely rooted in and limited to that thing. You're just not going to single-handedly reinvent things that took numerous hackers over several generations to figure out. You may be "good", but so were they, and there is only one of you. You will not even be able to converse with actual Lisp people, due to not having the right concepts and terms.
- carapace 3y agoAre you criticizing the MAL project or just offering general advice? I feel MAL does a decent job illustrating the core concepts of Lisp, but then I'm not a Lisp expert by any means.
- kazinator 3y agoI'm not sure which, if any, of my remarks apply to MAL specifically. I don't have the impression that the author of the MAL project used it as a way of learning Lisp. To my best understanding, MAL provides a step by step recipe and test cases for implementing a language dialect, plus example implementations for which that has been done. Someone going through the MAL exercise will mainly interact with the chosen implementation language. Writing a new MAL implementation could be used as an exercise to learn some unfamiliar language. I'm not convinced that programmers implementing MAL are actually learning how to use MAL, since it doesn't look as if the exercise requires them to write MAL code to solve problems. To learn MAL, you would take the project as-is with its integrated implementations and use that to get other work done. Suppose someone actually learns MAL by working with it. Are they learning Lisp? I'm not sure how much of their acquired skill will transfer to working with a mainstream Lisp. MAL looks rather like a kind of Mock Lisp (see: https://en.wikipedia.org/wiki/Mocklisp https://en.wikipedia.org/wiki/Mocklisp). It's implemented even in Bash and Awk using string processing. The good thing about MAL is that at least the participants in the exercise are following a specification instead of just making something up as they go along and calling it Lisp. Making something that is compatible with a spec and other implementations is a good exercise for software engineering students, regardless of what it is. MAL would still be valuable that way if it was, say, MAVE: make a vi editor, or MAM: make a Mario game. I have no idea how effective MAL is educationally in teaching the concepts themselves that underpin MAL, which revolves around this question: is it possible to mechanically follow the recipe and get a new implementation working, without understanding the concepts? Separately from the question of whether MAL concepts are Lisp concepts, is the MAL implementor who follows the structured workflow learning the MAL concepts, or are they just massaging code to get some tests to pass. (But, of course, even if they are, so what; nothing stands in their way of learning any concepts they want in any other manner.)