<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kyou is kyou is kyou is kyou (Posts about java)</title><link>https://kyo.iroiro.party/</link><description>Java, JVM, GraalVM, Truffle, etc.</description><atom:link href="https://kyo.iroiro.party/en/categories/java.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:gudzpoz@live.com"&gt;Kana&lt;/a&gt; CC BY-SA 4.0</copyright><lastBuildDate>Mon, 02 Feb 2026 13:28:24 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Exploring Speculative JIT Compilation for Emacs Lisp with Java</title><link>https://kyo.iroiro.party/en/posts/juicemacs-exploring-jit-for-elisp/</link><dc:creator>Kana</dc:creator><description>&lt;div&gt;&lt;blockquote&gt;
&lt;p&gt;
This Org-mode file was used for an &lt;a href="https://github.com/rlister/org-present"&gt;&lt;code&gt;org-present&lt;/code&gt;&lt;/a&gt; presentation at &lt;a href="https://emacsconf.org/2025/talks/juicemacs/"&gt;EmacsConf 2025
– Juicemacs&lt;/a&gt;. This blog post is adapted from that presentation, with added
transcript and explanations for a bunch of things I didn't dig into during the
presentation.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure&gt;

&lt;figure&gt;
&lt;a href="https://emacsconf.org/2025/talks/juicemacs/" width="400"&gt;&lt;img src="https://kyo.iroiro.party/images/juicemacs-exploring-jit/emacsconf-pre.jpg" alt="emacsconf-pre.jpg" width="400"&gt;&lt;/a&gt;

&lt;/figure&gt;
&lt;/figure&gt;

&lt;p width="64"&gt;
&lt;img src="https://kyo.iroiro.party/images/juicemacs-exploring-jit/emacsconf-logo1-256.png" alt="emacsconf-logo1-256.png" width="64"&gt;
For &lt;a href="https://emacsconf.org/2025/"&gt;EmacsConf 2025&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Project: &lt;a href="https://github.com/gudzpoz/Juicemacs"&gt;https://github.com/gudzpoz/Juicemacs&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Contact: See &lt;a href="https://kyo.iroiro.party/en/posts/juicemacs-exploring-jit-for-elisp#menu"&gt;the navigation bar&lt;/a&gt; (or join &lt;a href="https://juice.zulipchat.com"&gt;the Zulip chat&lt;/a&gt;)
&lt;/p&gt;






&lt;p&gt;
&lt;/p&gt;&lt;p&gt;&lt;a href="https://kyo.iroiro.party/en/posts/juicemacs-exploring-jit-for-elisp/"&gt;Read more…&lt;/a&gt; (33 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>emacs</category><category>java</category><category>perf</category><guid>https://kyo.iroiro.party/en/posts/juicemacs-exploring-jit-for-elisp/</guid><pubDate>Fri, 05 Dec 2025 01:00:00 GMT</pubDate></item><item><title>Writing a Lisp JIT Interpreter with GraalVM Truffle</title><link>https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/</link><dc:creator>Kana</dc:creator><description>&lt;div&gt;&lt;nav id="table-of-contents" role="doc-toc"&gt;
&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;div id="text-table-of-contents" role="doc-toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#what-is-graal-and-truffle"&gt;1. What is Graal and Truffle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#speculation-and-truffle-dsl"&gt;2. Speculation and Truffle DSL&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#generatenodefactory"&gt;2.1. &lt;code&gt;@GenerateNodeFactory&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#runtime-macro-expansion"&gt;3. Runtime Macro Expansion&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#frames-within-frames"&gt;3.1. Frames Within Frames&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#special-forms"&gt;4. Special Forms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#built-in-function-inlining"&gt;5. Built-In Function Inlining&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#lazy-ast-creation"&gt;5.1. Lazy AST Creation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#function-redefinition-and-assumptions"&gt;5.2. Function Redefinition And Assumptions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#emacs-lisp-closures"&gt;6. Emacs Lisp Closures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#creating-closures-in-a-loop"&gt;7. Creating Closures In a Loop&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#sharing-ast-between-closures"&gt;7.1. Sharing AST Between Closures&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#anything-more"&gt;8. Anything More?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/nav&gt;
&lt;figure&gt;

&lt;figure&gt;
&lt;img src="https://kyo.iroiro.party/images/emacs-lisp-interpreter-with-graalvm-truffle/mandelbrot-benchmark.svg" alt="mandelbrot-benchmark.svg" class="org-svg"&gt;

&lt;/figure&gt;
&lt;figcaption&gt;
&lt;p&gt;
Mandelbort benchmark: Emacs (native-comp) runs 10x slower than Java or Truffle
implementation &lt;sup&gt;&lt;a id="fnr.benchmark" class="footref" href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/#fn.benchmark" role="doc-backlink"&gt;1&lt;/a&gt;&lt;/sup&gt;
&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;
So I've been working on an interpreter for &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Introduction.html"&gt;Emacs Lisp&lt;/a&gt; using the &lt;a href="https://github.com/oracle/graal/tree/master/truffle"&gt;GraalVM Truffle&lt;/a&gt;
framework for a while now. As I've just completed its AST interpreter and a
bytecode interpreter, I guess its time to give it a little write-up (or rather,
some random babbling of various tricks).
&lt;/p&gt;

&lt;p&gt;
Although the Truffle interpreter covered here is for Emacs Lisp only, most of
the following should also be applicable to other Lisp dialects and maybe other
Truffle-based language implementations.
&lt;/p&gt;

&lt;p&gt;
&lt;/p&gt;&lt;p&gt;&lt;a href="https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/"&gt;Read more…&lt;/a&gt; (22 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>emacs</category><category>java</category><category>perf</category><guid>https://kyo.iroiro.party/en/posts/emacs-lisp-interpreter-with-graalvm-truffle/</guid><pubDate>Thu, 01 May 2025 07:31:36 GMT</pubDate></item></channel></rss>