5 ms·
Roll a Lisp in C – Evaluation
- cellularmitosis 4y agoNice work, writing a hobby lisp in C is great for building understanding. Here was my take: https://gist.github.com/cellularmitosis/d8d4034c82b0ef817913a01138b115bf https://gist.github.com/cellularmitosis/d8d4034c82b0ef817913...
- swatson741 4y agoIt looks like you did pass-by-reference on all parameters. The interpreter I wrote for the articles does pass-by-value on all parameters which has it's own quirks compared to conventional Lisps.
- deleted 4y ago[deleted]
- minroot 4y agoMore posts like this, please.
- nils-m-holm 4y agoThere is lots of stuff like this on my homepage, http://t3x.org http://t3x.org.
- bowsamic 4y agoWhat is your opinion on the Mahayana?
- nils-m-holm 4y agoIt is the teacher that matters, not the school.
- bowsamic 4y agoIn pure land there is no need for a teacher
- nils-m-holm 4y agoIn pure land there is no need for anything. Until then a teacher may be useful.
- bowsamic 4y agoWhat do you mean by this? There is still the need to do the nembutsu
- nils-m-holm 4y agoI was talking about the goal, you about the path. As long as there is a path, there needs to be a teacher, which can be a formal teacher, a member of your community, or yourself. In the end it is always yourself, of course, and the teaching is always the same, be it Mahayana, Theravada, Hinduism, Yoga, or something else entirely. It does not matter which school you belong to, but the teaching needs to be understood clearly. As long as there is a path, how do you do nembutsu without inspiration?
- reitzensteinm 4y agoI've purchased Lisp System Implementation and it was very good. Thank you!
- nils-m-holm 4y agoThank you!
- bogomipz 4y agoOh wow, what a treasure trove! Which title would you recommend a LISP newbie should start with? Is there a sequence for the first few titles you would recommend?
- nils-m-holm 4y agoIf you are really new to LISP, I would recommend Sketchy Scheme, then Scheme 9 from Empty Space, then LISP System Implementation. You can read LISP from Nothing after Sketchy Scheme, but it is more about the technical history of LISP. If you are into Theory, read Compiling Lambda Calculus instead of S9fES. Then there are some essays and interpreters that you can study with little background.
- HexDecOctBin 4y agoI brought Lisp System Implementation a few weeks ago. While its pretty good, I did have one feedback: it would be great to have a book that shows making a Lisp step-by-step, rather than documenting the final version. I know a few people who are interested in learning how to write compilers, and would prefer something like that (LSI would be too hard for them, since it would require reading a large portion of the book to even gain some basic context of why we are doing what we are doing).
- nils-m-holm 4y ago> it would be great to have a book that shows making a Lisp step-by-step Excellent point! Compiling Lambda Calculus is a bit like this. It starts with Lambda Calculus and then develops multiple implementations of increasing complexity. LISP from Nothing also does this, but it is about ancient LISP. I will definitely keep this in mind!
- tekknolagi 4y agoYou might like my Lisp compiler series in C: https://bernsteinbear.com/blog/compiling-a-lisp-0/ https://bernsteinbear.com/blog/compiling-a-lisp-0/
- sph 4y agoWhat language constructs should a (Turing complete) Lisp have to be considered one? Is there a spec somewhere, a minimal conformance guide? I don’t think it’s just the parens that make the Lisp. I suppose it needs: * car and cdr * if * list * eval * quoting and quasiquoting What else?
- linguae 4y agoOne of the most important Lisp primitives is lambda, which provides higher-order functions. It is a fundamental primitive, and the name lambda is derived from the lambda calculus which influenced the design of Lisp.
- nils-m-holm 4y agoQuasiquoting is easily done in LISP, but you will need ATOM, and I would argue for CONS in the place of LIST. Exposing EVAL is not necessary at all. See http://t3x.org/klisp/22/ http://t3x.org/klisp/22/
- rags2riches 4y agoI wrote an interpreter on a whim a long time ago. Mainly to show a friend how quick it was to get something going. I continued working on it, had great fun. Until I got to quasiquoting. That's where my head started spinning and I lost steam.
- sph 4y agoWhy would it be hard to implement? (Keep in mind I have never written a lisp so my comment is uneducated) Quasiquoting means creating a list where some elements are evaluated at runtime. Not dissimilar to string interpolation.
- KineticLensman 4y ago> Quasiquoting means creating a list where some elements are evaluated at runtime Take a look at the awesome 'Make A Lisp' (MAL), in particular the section on quoting: https://github.com/kanaka/mal/blob/master/process/guide.md#step-7-quoting https://github.com/kanaka/mal/blob/master/process/guide.md#s... This has a fairly good description of what happens during quasi-quoting.
- nonrandomstring 4y agoNice. This is the perfect level for teaching/examples for a level 6 languages module. Thanks for writing and sharing this.
- mbrodersen 4y agoIf you want to go even more minimalist then roll your own pure lambda calculus evaluator and figure out how to do if-then-else and math in it. It is good fun!