Bringing GNU Emacs to native code [video]
toobnix.org
Bringing GNU Emacs to native code [video]
1–10 of 84 posts
Re: Bringing GNU Emacs to native code [video]
#2Re: Bringing GNU Emacs to native code [video]
#3This seems convoluted compared to say moving the Lisp implementation from Emacs Lisp to Common Lisp, of which several native code compiling implementations exists.
Re: Bringing GNU Emacs to native code [video]
#4This seems convoluted compared to say moving the Lisp implementation from Emacs Lisp to Common Lisp, of which several native code compiling implementations exists.
Re: Bringing GNU Emacs to native code [video]
#5Re: Bringing GNU Emacs to native code [video]
#6This seems convoluted compared to say moving the Lisp implementation from Emacs Lisp to Common Lisp, of which several native code compiling implementations exists.
Re: Bringing GNU Emacs to native code [video]
#7This seems convoluted compared to say moving the Lisp implementation from Emacs Lisp to Common Lisp, of which several native code compiling implementations exists.
I assume you mean writing an Emacs lisp interpreter in Common Lisp — which could be done with a small lexer, a lot of macros, and some library support. That would probably be a win.
Re: Bringing GNU Emacs to native code [video]
#8This seems convoluted compared to say moving the Lisp implementation from Emacs Lisp to Common Lisp, of which several native code compiling implementations exists.
Rewriting thousands of packages (some of which have had man-decades of work poured into them) would also be rather convoluted.
You can easily hack the readtable in Lisp, and rewrite Emacs Lisp sexps as Common Lisp sexps.
Some interesting things to consider are file-local variables, buffer-local variables, dynamic-scope/lexical-scope, how to handle floating point (-0.0e+NaN in Emacs Lisp, custom floating point rouding modes/traps in SBCL for example), but this looks like a reasonable approach overall.
For example (just a draft, this might be incorrect):
USER> (defun make-local-variable (symbol)
(eval `(define-symbol-macro ,symbol (bvar (quote ,symbol)))))
MAKE-LOCAL-VARIABLE
USER> (make-local-variable 'foo)
FOO
USER> (macroexpand-all '(list foo))
(LIST (BVAR 'FOO))
T
T
The BVAR forms would then be able to access a buffer variable, with the current buffer. This works with SETF too (but Emacs Lisp SETQ should be replaced by SETF during the transform).BVAR could expand into code that calls FFI functions, for compatibility. Using an FFI approach would allow to progressively rewrite some parts of the runtime into CL.
Just to clarify, I know this is a huge work to undertake, but this comes from the assumption that we want to keep all existing Elisp files running identically.
Re: Bringing GNU Emacs to native code [video]
#9Earlier quoted context omitted.
Rewriting thousands of packages (some of which have had man-decades of work poured into them) would also be rather convoluted.
You don't need to rewrite packages if you have a layer where Emacs Lisp is compiled/interpreted as Common Lisp. You can easily hack the readtable in Lisp, and rewrite Emacs Lisp sexps as Common Lisp sexps. Some interesting things to consider are file-local variables, buffer-local variables, dynamic-scope/lexical-scope, how to handle floating point (-0.0e+NaN in Emacs Lisp, custom floating point rouding modes/traps in…
Re: Bringing GNU Emacs to native code [video]
#10Earlier quoted context omitted.
I assume you mean writing an Emacs lisp interpreter in Common Lisp — which could be done with a small lexer, a lot of macros, and some library support. That would probably be a win.
Depends on how difficult it is to integrate Common Lisp into Emacs. Or would you just be rewriting Emacs in Common Lisp?
There are small syntactic differences between Emacs lisp and Common Lisp so a lexer that handled those would suffice.
There are some small semantic differences but they could be handled by porting code. And the Emacs c code could be rewritten in lisp or ported into the Common Lisp implementation, depending on your taste.