Juicemacs: Exploring Speculative JIT Compilation for ELisp in Java
Kana (they/them) - IRC: kanakana, Blog: https://kyo.iroiro.party - ActivityPub: @kana@f.iroiro.party - Bluesky: @kana.iroiro.party, kana@iroiro.party
The following image shows where the talk is in the schedule for Sat 2025-12-06. Solid lines show talks with Q&A via BigBlueButton. Dashed lines show talks with Q&A via IRC or Etherpad.
Format: 20-min talk ; Q&A: Etherpad https://pad.emacsconf.org/2025-juicemacs
Etherpad: https://pad.emacsconf.org/2025-juicemacs
Discuss on IRC: #emacsconf-dev
Status: Ready to stream
Saturday, Dec 6 2025, ~8:15 AM - 8:35 AM MST (US/Mountain)
Saturday, Dec 6 2025, ~7:15 AM - 7:35 AM PST (US/Pacific)
Saturday, Dec 6 2025, ~3:15 PM - 3:35 PM UTC
Saturday, Dec 6 2025, ~4:15 PM - 4:35 PM CET (Europe/Paris)
Saturday, Dec 6 2025, ~5:15 PM - 5:35 PM EET (Europe/Athens)
Saturday, Dec 6 2025, ~8:45 PM - 9:05 PM IST (Asia/Kolkata)
Saturday, Dec 6 2025, ~11:15 PM - 11:35 PM +08 (Asia/Singapore)
Sunday, Dec 7 2025, ~12:15 AM - 12:35 AM JST (Asia/Tokyo)
Description
Just-in-time (JIT) compilation helps dynamic languages run fast, and
speculative compilation makes them run faster, as has been showcased
by JVMs, LuaJIT, JavaScript engines, and many more JIT runtimes.
However, Emacs native-compilation, despite its JIT compilation
(native-comp-jit-compilation), does not speculate about runtime
execution, making it effectively a JIT-ish AOT (ahead-of-time)
compiler. By introducing a speculative runtime for ELisp, we could
potentially improve ELisp performance even further, with many new
optimization opportunities.
Juicemacs is my work-in-progress toy project re-implementing Emacs in Java. At its centre sits an ELisp JIT runtime powered by Graal Truffle, a JIT interpreter framework based on partial evaluation and Futamura projections. This talk will cover the following along with some demonstrations:
What is Juicemacs and its ambition? How compatible is it (or does it plan to be) with GNU Emacs and how feature-complete is it now?
What is speculative compilation? How is it useful for an ELisp JIT runtime?
How is the performance of Juicemacs compared to Emacs nativecomp? How do we interpret the benchmarks?
What is Truffle and partial evaluation? What is needed if we are to implement a speculative runtime in C without Truffle?
What JIT techniques and other things does Juicemacs plan to explore? How to get involved?
Relevant links:
Accompanying blog post (slides + transcript + more discussions): https://kyo.iroiro.party/en/posts/juicemacs-exploring-jit-for-elisp/ (scheduled to become available after the talk)
Project repository: https://github.com/gudzpoz/Juicemacs or https://codeberg.org/gudzpoz/Juicemacs
ERT testing results: https://emacsen.de/dev/tests/
Zulip chat (devlog + discussions): https://juice.zulipchat.com
About the speaker:
Hello! This is Kana, an Emacs hobbyist and Java lover from China. A few years ago I discovered the Truffle JIT compilation framework and have since hoped to implement a JIT runtime myself. Last year I finally started implementing one for ELisp, called Juicemacs, and have made some progress. In this talk I will share what I've learned during the journey, including how three interpreters out of four (or more?) in Emacs are implemented in Juicemacs and how speculative compilation can make some optimizations possible.
Questions or comments? Please e-mail kana@iroiro.party
