HackerPapers

arXiv:2004.02504cs.PL

Bringing GNU Emacs to Native Code

Andrea Corallo, Luca Nassi, Nicola Manca

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 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.

arXiv comments
8 pages, 1 figure
Journal reference
DOI
doi:10.5281/zenodo.3736363
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 3 threads, from May 2020 to May 2021. Found in 2 HN submissions from May 2021 to Sep 2022. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

    • After C and DasBetterC (safer C) have officially become the subsets of D language [1], it will be very interesting what languages will be the de-facto superset of D. With excellent support for metaprogramming and CTFE in D (amongst other features), these supersets language can…

      teleforceView on HNParent context

  1. Bump Emacs Version to 27.1 1 comment
    • That sounds interesting: https://arxiv.org/abs/2004.02504 "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…

      mellingView on HNParent context

    • I'd recognize a LaTeX beamer presentation anywhere. Here is the corresponding paper: https://arxiv.org/pdf/2004.02504.pdf

      pmiller2View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.