Native Emacs Compilation on macOS

If you’re like me, you’re probably excited about native compilation coming to Emacs. In case you don’t know, the project, gccemacs (started and headed by Andrea Corallo), brings native compilation to Elisp. That means that not just will Elisp code—and hence Emacs—will run faster but also that some of the C code in Emacs can be replaced with Lisp.

Corallo gave a presentation to the European Lisp Symposium, which I’ve written about before, that discusses how things work and gives the results of some benchmarks. The work is ongoing but the system is already usable. As far as I can tell, the plan is to include it in Emacs 28 but if you can’t wait to try it out, the code is in the Emacs git repository.

If you’re on macOS, Álvaro Ramírez has step-by-step instructions for compiling Emacs with the native compilation enabled. You’ll need to load gcc with jit support if you don’t already have it. After that, it’s pretty simple. Ramírez provides a configure script to set everything the way you’ll need it so all you have to do is run the script and call make to build Emacs. See Ramírez’s post for the details.

This project is a great thing for Emacs and even for making Elisp a more general programming language. I’m already inclined to use Elisp when I can for small utilities and one-offs so improving Elisp is a win for me.

This entry was posted in General and tagged . Bookmark the permalink.