logoalt Hacker News

FEXPRs vs. vtable: how LispE interpreter works

18 pointsby birdculturelast Tuesday at 11:57 PM4 commentsview on HN

Comments

Joker_vDtoday at 1:35 PM

> What LispE proposes is to turn each instruction of the language into a derived class that exposes an eval method. Every class has its own override of eval. And since all these classes derive from a single mother class with an original and evocative name, Element, you can build a C++ vector that holds them all. And that is where the miracle happens: the AST is kept alive, but each node is an object that can be optimized to the hilt with the full C++ arsenal.

That's... a tree-walking interpreter. And IIRC the most overhead of it comes from traversing the tree itself, then from the overhead of invoking (virtual) eval() methods, and only then from whatever inefficiencies are inside of those tiny eval() implementations.

show 1 reply
rjswtoday at 2:39 PM

Lisp has had good native compilers for a long time, just use one of those.

sourdecortoday at 1:46 PM

What I find interesting is not only that this is a cool alternative Lisp but that it is developed by a Korean company called Naver[0].

[0]: https://github.com/naver

[1]: https://www.naver.com/