Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: A Custom Lisp in C (github.com/codr7)
15 points by codr7 on Sept 4, 2021 | hide | past | favorite | 3 comments



This actually looks pretty cool and aligns with how I'd probably build a lisp.

I know the brackets are seen as heretical to all outside of Clojure, but it really helps the eyes IMO if you're not using a fancy editor or aren't super experienced with Lisp.

The stack is a really nice feature and I think merging the best of Lisp & Forth makes sense in some ways. I think some of the HP calculators supported a programming language called RPL which is a stack based (RPN) language with some lispy elements iirc.


I like the absence of globals that so often litter vm interpreters. This makes it great for embedding.

Is there a structural reason why its slower than python or is it just a temporary lack of optimisation?


That's intentional, for embedding and for firing up sub interpreters in separate threads.

Don't know, both use computed goto so dispatch shouldn't be the problem. But Python is VERY well optimized by now and aLisp is a few weeks old.

I did implement the whole thing on top of a single data structure, an embedded double linked list, which is somewhat unusual I guess. But most of the nodes are slab allocated by type so data locality shouldn't be it either.

aLisp is definitely more static than Python, which barely has any structure at all; I'm hoping that will lead to more opportunities for optimization down the line.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: