3 ms·
My impression is that part of the problem is that Emacs Lisp is a large language (lots of data types and functions implemented in C) and one without any formal
by skissane 3y ago
My impression is that part of the problem is that Emacs Lisp is a large language (lots of data types and functions implemented in C) and one without any formal specification, which makes duplicating it correctly in another system very difficult. By contrast, Scheme is a smaller language and has a reasonably clear spec.
Which makes me wonder – instead of trying to port GNU Emacs to run on top of Scheme, might it be easier to produce a Scheme implementation that ran on top of Emacs Lisp? Possibly Emacs Lisp is missing some of the primitives required to implement Scheme efficiently, but the amount of code required to add those primitives will likely turn out to be less than that required to reimplement the whole of GNU Emacs in Scheme – and adding those new primitives may make Emacs Lisp a better language, thus benefitting even those users who aren't interested in Scheme in itself.
- davexunit 3y agoGuile has a generic VM and extensible compiler tower, so a bug for bug port of elisp was proving to be an effective method. Unfortunately, the project did not interest the Emacs devs so there just wasn't the buy-in necessary to work through the finer details and make it happen for real. You can open a Guile REPL today and switch the language from Scheme to Elisp and hack away. What makes the whole thing so appealing is that the Elisp compiler simply lowers the code to Guile's "tree intermediate language" (Tree-IL) and gets a free ride the rest of the way through optimization and bytecode emission. The biggest impact Elisp support had on core Guile was that a new immediate type had to be added to represent 'nil'. Soon it won't even be much of a stretch to compile Elisp to WebAssembly (would be funny!) once that backend is ready for Scheme. Guile is undervalued as a platform for language implementation and Emacs missed out on a cool opportunity.