Bringing GNU Emacs to Native Code

04/06/2020
by   Andrea Corallo, et al.
0

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 scoped Elisp files, including the whole GNU Emacs Lisp Package Archive (ELPA). Native-compiled Elisp shows an increase of performance ranging from 2.3x up to 42x with respect to the equivalent byte-code, measured over a set of small benchmarks.

READ FULL TEXT
research
12/11/2010

On the Implementation of GNU Prolog

GNU Prolog is a general-purpose implementation of the Prolog language, w...
research
12/06/2022

Formally Verified Native Code Generation in an Effectful JIT – or: Turning the CompCert Backend into a Formally Verified JIT Compiler

Modern Just-in-Time compilers (or JITs) typically interleave several mec...
research
10/05/2020

Sampling Optimized Code for Type Feedback

To efficiently execute dynamically typed languages, many language implem...
research
06/14/2018

o-glasses: Visualizing x86 Code from Binary Using a 1d-CNN

Malicious document files used in targeted attacks often contain a small ...
research
07/26/2022

Reimplementing the Wheel: Teaching Compilers with a Small Self-Contained One

We report on a one-semester compiler construction course based on the id...
research
09/17/2021

CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research

Interest in applying Artificial Intelligence (AI) techniques to compiler...
research
12/04/2020

Automating Seccomp Filter Generation for Linux Applications

Software vulnerabilities in applications undermine the security of appli...

Please sign up or login with your details

Forgot password? Click here to reset