logoalt Hacker News

Exploring Speculative JIT Compilation for Emacs Lisp with Java

20 pointsby gudzpozlast Friday at 4:08 PM1 commentview on HN

Comments

quotemstrtoday at 5:58 AM

Using Truffle for elisp is very cool.

> In GNU Emacs, with tagged pointers, you can know an object is a cons simply by looking at the pointer.

Another thing is that these objects don't need type words. In a conventional GC-adaptation of Emacs (e.g. the igc branch, or this article) one models cons cells, floats, and so on as regular objects consisting of a type word followed by the object payload. A cons cell is only two words long, so when you model it as a regular object, the type word makes it 50% larger!

The regular Emacs GC, for all its faults, densely packs cons cells and other small object types in specialized blocks, avoiding the need to pay the per-object type word overhead and thereby getting better space use and cache locality.

It'd be nice to get a modern GC with specialized heaps just for cons cells, floats, and other small objects