
Lisp implementation in GNU make - aerique
https://github.com/shinh/makelisp
======
Tomte
I'd love if make was less capable of implementing a toy Lisp and more capable
of quoting characters. Like quoting a left paren. I mean, at all.

~~~
yarrel
IN GNU make there's \\( , $(\\() and lparen := \\( ... $(lparen) .

~~~
Tomte
\\) 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)

------
fallat
I love the abuse of turing complete tools. It's a weird perversion that I'm
starting to appreciate more.

------
cromo
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.

[1] [https://github.com/kanaka/mal](https://github.com/kanaka/mal)

~~~
baldfat
And yet there is Racket which is 100% making your own language based on Lisp.
Serious question. Why is there mal when we already have Racket?

~~~
cromo
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.

------
david-given
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:

[http://cowlark.com/2013-10-19-insane-
make](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.

------
jgrahamc
For more wild things you can do in GNU make by pushing the internal language:
[http://gmsl.sf.net/](http://gmsl.sf.net/) And also:
[https://www.nostarch.com/gnumake](https://www.nostarch.com/gnumake)

I like they way they've done the arithmetic.

------
bla2
Somewhat hidden in the readme: A link to
[https://github.com/google/kati](https://github.com/google/kati) which is
apparently much faster at execution Makefile code.

------
amyjess
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.

~~~
polymeris
A (very basic) version in Lua/LPEG I did a while ago:

[https://gist.github.com/polymeris/857a7ae31db0d240ef3f](https://gist.github.com/polymeris/857a7ae31db0d240ef3f)

------
jevgeni
A part of me loves and a part of me hates the author.

10/10 would lithp again.

------
gepoch
> There should be a lot of limitations. makelisp behaves very strangely when
> you pass a broken Lisp code.

I can't imagine why..

------
gjvc
wonderful

