论文标题

将gnu emacs带入本地代码

Bringing GNU Emacs to Native Code

论文作者

Corallo, Andrea, Nassi, Luca, Manca, Nicola

论文摘要

Emacs LISP(ELISP)是Emacs Text Editor家族使用的LISP方言。 GNU emacs当前可以在将其编译为字节代码后解释或字节解释。在这项工作中,我们讨论了针对本机代码的ELISP的优化编译器方法的实现。本机编译器采用字节编译器的内部表示形式作为输入,并利用LibGCCJIT使用GNU编译器集合(GCC)基础架构实现代码生成。生成的可执行文件被存储为二进制文件,可以动态加载和卸载。编译器的大多数功能都是用ELISP本身编写的,包括几个优化通过,并与C后端配对,与GNU EMACS CORE和LIBGCCJIT接口。尽管仍在进行中,但我们的实施方法能够引导功能性emacs并编译所有词汇范围范围的ELISP文件,包括整个GNU EMACS LISP PACKANK ARCHIVE(ELPA)。本地编译的ELISP显示,相对于等效字节代码,在一组小基准测试的情况下,性能的增长范围从2.3倍到42倍。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源