Comment by geofft
6 years ago
Emacs somewhat famously uses "unexec" in its build process, you build a skeletal Emacs in C (mostly the Emacs Lisp implementation), run it, load and compile and process a bunch of Lisp that implements the editor itself, and dump the resulting process memory back out to disk. The result of this eldritch process is the final emacs binary. When you exec emacs, you get an environment that consists of the editor code ready to go.
I'm given to understand that the macOS implementation of malloc had to have special-cased code in it just to support emacs due to this approach.
For the curious: https://opensource.apple.com/source/libmalloc/libmalloc-166....
Why?
Because linkers are too easy?
It really looks like some overly clever college student's weird trick that somehow managed to survive for decades in an established product.
1 reply →
"Removing support for Emacs unexec from Glibc" -- https://lwn.net/Articles/673724/
Interestingly, even if Emacs removes this I see Apple being forced to keep their hack in place as they're not likely to update their version of Emacs anytime soon…
squints Sooo... Elisp has AOT compilation!
The idea is somewhat similar to Android's zygotes, isn't it?