Bringing GNU Emacs to Native Code
Andrea Corallo, Luca Nassi, Nicola Manca

TL;DR
This paper presents a native code compiler for GNU Emacs Lisp that significantly improves performance by leveraging libgccjit, enabling dynamic loading and unloading of compiled binaries, and supporting the entire ELPA archive.
Contribution
It introduces an optimizing native compiler for Elisp using libgccjit, with most functionality implemented in Elisp and a C backend, enhancing Emacs performance.
Findings
Native-compiled Elisp achieves 2.3x to 42x speedup over byte-code.
The compiler can bootstrap a functional Emacs and compile all ELPA packages.
Most compiler features are implemented in Elisp, with a C backend for integration.
Abstract
Emacs Lisp (Elisp) is the Lisp dialect used by the Emacs text editor family. GNU Emacs can currently execute Elisp code either interpreted or byte-interpreted after it has been compiled to byte-code. In this work we discuss the implementation of an optimizing compiler approach for Elisp targeting native code. The native compiler employs the byte-compiler's internal representation as input and exploits libgccjit to achieve code generation using the GNU Compiler Collection (GCC) infrastructure. Generated executables are stored as binary files and can be loaded and unloaded dynamically. Most of the functionality of the compiler is written in Elisp itself, including several optimization passes, paired with a C back-end to interface with the GNU Emacs core and libgccjit. Though still a work in progress, our implementation is able to bootstrap a functional Emacs and compile all lexically…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Malware Detection Techniques · Software Testing and Debugging Techniques · Parallel Computing and Optimization Techniques
