Post AdBkqa2kq2NRdFcl0a by brokenix@emacs.ch
(DIR) More posts by brokenix@emacs.ch
(DIR) Post #AdBkqa2kq2NRdFcl0a by brokenix@emacs.ch
2023-12-26T03:06:35Z
0 likes, 1 repeats
In the type tunnel pattern, a generic interface layer uses a family of shims to translate a heterogeneous set of types to a single primitive type used by an underlying API to rewrite #Emacs core in CL is not a trivial task. Implementing Emacs renderer and all of its features is not something one can just do in an afternoon. There is about ~1600 EL primitives written in C. Of those, there is ~200 which also are #CL primitives and which some out with EL shim to CL. Some of those ~1400 left are not needed due to nature of having Emacs in sbcl; like not running on some exotic OS:s or not needing things like native compiler ( #sbcl itself is a native compiler). A huge part of implementing those ~1400 primitives is probably not so hard, it is just translating to already provided functionality in some form for I/O, networking, etc. But implementing Emacs renderer and text processing is a huge and difficult part and should not be underestimated#Guile can implement Emacs Lisp better than Emacs can.We can compile Emacs Lisp to Guile's VM, and make C shims to present a suitably compatible C interface to the rest of Emacs' C primitives.No one will notice! Except that after a switch, Emacs would be faster, more powerful, and have the ability to access all of Guile's facilities -- the Scheme language, other languages implemented for Guile (Javascript, Lua, ...), a proper ffi, dynamically loadable libraries, a module system, the numeric tower (rationals, bignums, etc), Guile's existing libraries, delimited continuations (!), fast bytevector access, native threads, etc.On a language level, I am convinced that not only can Guile implement Emacs Lisp, but it can provide a coherent story for tight interaction between e.g. minor modes in Javascript and Scheme and Elisp, etc. More details will come later, though feel free to bring up specific points.There have been some suggestions on the list that "Guile people want to rewrite Emacs in Scheme". Though Scheme does have some facilities to offer env SHELLOPTS=xtrace \ BASH_XTRACEFD=7 7>&2 \ PS4='[$?][$BASHPID|${BASH_SOURCE:-$BASH_EXECUTION_STRING}|$LINENO]+ ' \ sh -c 'env sh -c /; exit'[0][30625|env sh -c /; exit|0]+ env sh -c /[0][30626|/|0]+ /sh: /: Is a directory[126][30625|env sh -c /; exit|0]+ exithttps://www.reddit.com/r/emacs/comments/11nf8ry/rebuilding_emacs_from_scratch_what_would_you_do/https://news.ycombinator.com/item?id=23236569