Or you can just from fakelisp import * And turn your Python into a Lisp. https://github.com/akalenuk/fakelisp
(How to Write a (Lisp) Interpreter (In Python)) (2010)
31–40 of 101 posts
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#32The focus was really on writing the cleanest idiomatic es6 I could (at the time :)). Check out the tests to see how far I got [1]
Pretty fun exercise =)
[0]: https://github.com/djtriptych/es6-lisp
[1]: https://github.com/djtriptych/es6-lisp/blob/master/test/lisp...
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#33At some point I translated this demo into es6 if anyone's interested [0]. The focus was really on writing the cleanest idiomatic es6 I could (at the time :)). Check out the tests to see how far I got [1] Pretty fun exercise =) [0]: https://github.com/djtriptych/es6-lisp [1]: https://github.com/djtriptych/es6-lisp/blob/master/test/lisp...
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#34Or you can just from fakelisp import * And turn your Python into a Lisp. https://github.com/akalenuk/fakelisp
Not exactly the same (doesn't embed into the source like this did), but I believe Hylang[0] is the best Lisp package available for modern Python. [0] https://github.com/hylang/hy
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#35> The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms. Is there a learning resource that covers exactly this for those wanting to write software in lisp in 2024? As "first principle thinkers" in some ways all hackers crave for that "fundamental building blocks approach", a bit like wanting to know how we go from transistors to full computers and every step along the way. Most of…
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#36At some point I translated this demo into es6 if anyone's interested [0]. The focus was really on writing the cleanest idiomatic es6 I could (at the time :)). Check out the tests to see how far I got [1] Pretty fun exercise =) [0]: https://github.com/djtriptych/es6-lisp [1]: https://github.com/djtriptych/es6-lisp/blob/master/test/lisp...
It's a fun thing to try, since Javascript almost was to be a Lisp at inception!
Always loved that and ashamed I can't remember the original author of the quote.
Not Crockford... Maybe Michael Fogus?
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#37> The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms. Is there a learning resource that covers exactly this for those wanting to write software in lisp in 2024? As "first principle thinkers" in some ways all hackers crave for that "fundamental building blocks approach", a bit like wanting to know how we go from transistors to full computers and every step along the way. Most of…
I suppose 5 is better than lots but you can totally write a lisp with zero keywords. I'm not sure what a syntactic form means here - dot as in dotted pair, nil, quote, quasiquote, parens? Having trouble coming up with 8 distinct syntactic things. The basis set underlying lisp is something like the lambda calculus with optional delayed evaluation, a product type and some file I/O. The optimal basis set for computation…
If one adds a requirement of additively optimal program length as in [1], then Binary Lambda Calculus is a good candidate.
[1] https://gist.github.com/tromp/86b3184f852f65bfb814e3ab0987d8...
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#38Python gives you a lot of things for free. Writing the lisp in C is quite the adventure in its own way.
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#39I would prefer a python interpreter written directly in rv64 assembly with a near 0-SDK. Would run on x86_64 and arm64 with a rv64 interpreter (ofc with some code paths adaptation).
Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)
#40> The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms. Is there a learning resource that covers exactly this for those wanting to write software in lisp in 2024? As "first principle thinkers" in some ways all hackers crave for that "fundamental building blocks approach", a bit like wanting to know how we go from transistors to full computers and every step along the way. Most of…
Many years ago I wrote a simple programming language that would macro expand into lambda calculus statement that could then be compiled down to different sets of combinators - the simplest being just S & K, which are pretty fundamental given how simple they are. The fact that you can express things like recursion in the lambda calculate (see name of our hosts on this site) and therefore in combinators still amazes me…
This approach can be reasonably efficient for implementing Haskell, as shown in [1] and the much more concise [2].