After watching this year’s EmacsConf and seeing Guile Emacs being resurrected I thought to myself - why limit ourselves to Guile? Sure, Guile isn’t just a Scheme implementation, thanks to its compiler-tower-based design. Other languages exist for Guile VM, such as Emacs Lisp, and Guile manual lists the following languages with various stages of completeness:
ECMAScript
Brainfuck
Lua
Ruby
Python
Sure, it would be nice, if Emacs could natively run all of these, but we have to understand, that Guile Lua is not PUC Lua. Even LuaJIT has difficulties maintaining full compatibility with modern releases of Lua, having us stuck in the realm somewhere between Lua 5.1 and 5.2, while PUC Lua is already 5.4. Future releases would bring more differences, making PUC Lua and Luajit diverge even more.
And Lua is a simple language, unlike something like JS, Ruby, or Python. So I wouldn’t bet on the fact that Guile Ruby would be exactly the same as Ruby. Maybe it will, but it’ll probably take years.
So I thought, why not just use Lua as is? The only thing we can’t do is to run Fennel functions from Emacs Lisp. There were attempts at bringing Lua VM into Emacs, running in the same process, however, as I know, it isn’t stable enough.
However, Emacs can connect to a Fennel REPL, like it does for many other languages, such as Common Lisp or Clojure. Sure, the language is running in a separate process, and this comes with a lot of nuances, but it’s still a possible route.
... continue reading