arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2004.02504cs.PL
收藏

将GNU Emacs引入本机代码

Bringing GNU Emacs to Native Code

Andrea Corallo, Luca Nassi, Nicola Manca

摘要:

Emacs Lisp(Elisp)是Emacs文本编辑器家族使用的Lisp方言。GNU Emacs目前可以执行Elisp代码,无论是解释的还是编译成字节码后的字节解释的。在这项工作中,我们将讨论一个优化的Elisp针对本机代码的编译器方法的实现。本机编译器使用字节编译器的内部表示作为输入,并利用libgccjit使用GNU编译器集合(GCC)基础设施实现代码生成。生成的可执行文件存储为二进制文件,可以动态加载和卸载。该编译器的大部分功能都是用Elisp本身编写的,包括几个优化通道,以及一个与GNU Emacs核心和libgccjit接口的C后端。虽然仍在进行中,但我们的实现能够引导功能Emacs并编译所有词法范围的Elisp文件,包括整个GNU Emacs Lisp Package 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑