Re:Lisp implementation in GNU make
by Tomte on Tuesday September 15, 2015 @03:19PM
(#10222604)
\) didn't work for me (may depend on the context, don't know), and some Google searches and Stackoverflow answers later I settled for LEFTPAREN:=) and $(LEFTPAREN)
Re:Lisp implementation in GNU make
by cromo on Tuesday September 15, 2015 @10:34AM
(#10220844)
This reminds me of MAL [1], which stands for "Make A Lisp" or Make, A Lisp" depending on whether you're talking about the whole project or just the make version. It branched out into being implementations of a lisp in over two dozen languages, with instructions to help in writing your own. I was working on a haxe version before my motherboard recently bit the dust.
Re:Lisp implementation in GNU make
by cromo on Tuesday September 15, 2015 @12:12PM
(#10221434)
I think there may be a misunderstanding here - mal is not the language you make the lisp (or any other language) in, it is the language you are implementing. Indeed, there is an implementation in Racket, and even in mal itself.
The point of mal is to guide an implementer through the steps necessary for making an interpreter using a language they are comfortable in. It gives some insight into how various constructs are implemented, such as closures and tail call optimization. The purpose is not so much to make a lisp-like language (although that is the outcome), but to learn what goes into making an interpreter for one - especially when you can't lean on the constructs that already exist in the host language.
Re:Lisp implementation in GNU make
by david-given on Tuesday September 15, 2015 @02:41PM
(#10222415)
A while back I implemented Conway's Game of Life in make... by writing it in a custom high level language and then writing a compiler into GNU Make script:
I also wrote an arbitrary precision maths library, because make doesn't support arithmetic. I got as far as addition, subtraction and multiplication before coming to my senses.
Re:Lisp implementation in GNU make
by amyjess on Tuesday September 15, 2015 @11:07AM
(#10221068)
I bet this was inspired by the "Lisp in your language" post from last week, where somebody did it in JavaScript.
That got me to work on a Python version (using tuples, for maximum parentheses), but it got put on the back burner because my life took a turn for the busy lately.
[1] https://github.com/kanaka/mal
The point of mal is to guide an implementer through the steps necessary for making an interpreter using a language they are comfortable in. It gives some insight into how various constructs are implemented, such as closures and tail call optimization. The purpose is not so much to make a lisp-like language (although that is the outcome), but to learn what goes into making an interpreter for one - especially when you can't lean on the constructs that already exist in the host language.
http://cowlark.com/2013-10-19-insane-make
I also wrote an arbitrary precision maths library, because make doesn't support arithmetic. I got as far as addition, subtraction and multiplication before coming to my senses.
I like they way they've done the arithmetic.
That got me to work on a Python version (using tuples, for maximum parentheses), but it got put on the back burner because my life took a turn for the busy lately.
https://gist.github.com/polymeris/857a7ae31db0d240ef3f
10/10 would lithp again.
I can't imagine why..