I would strongly recommend everyone try the native-comp Emacs 28 branch. Native compilation of Elisp files has greatly improved performance and start-up time, with no downside.
Though it's bleeding edge, I haven't experienced any issues: everything just works.. faster!
It always amazes me that some people are willing to put in such hard work, alone, for open source. The fact that one guy managed to speed up all of Emacs 2x-20x in his spare time for no pay is frankly amazing. Certainly puts my side-projects to shame.
Thanks for this! I use Emacs but haven’t invested any time in my setup for a long time. After I get back from my morning hike, I am going to invest some time on this. Thanks again.
> It always amazes me that some people are willing to put in such hard work, alone, for open source.
Apart of a few well known projects, the open source world is not so rosy.
I'm building an app that exports GPX files (XML file where you can store GPS positions, POIs, routes etc).
All the examples files on the official website ( https://www.topografix.com/gpx.asp ) are broken (they return a blank page) and to validate that your file is compliant you have to compile a 15 years old C++ library first (for some reason they refuse to release a binary).
Thanks but I already wrote the code and after catching a couple gotchas with the validation tool it's fully compliant now.
My point was not that GPX is hard (it's not) but that when something is open source most of the time you have to put some elbow grease in it because no one is paid to make it polished.
FWIW, it took me less time to write the GPX export code than to look for a binary of the validation tool, fail, then launch WSL and compile the goddam tool.
I have built my own OSM server to pre-generate tiles so my app has offline capabilities (I have a very slow internet connection so online maps are quite laggy).
I use it mostly to build routes that I export as gpx files to my Android phone (vehicle nav with Osmand and trekking with Iphigénie).
How do cool kids install Emacs with native-comp support on OSX these days? emacs-plus formula doesn't support it yet and neither does the Mitsuharu's port.
Me too, actually. Just found out today that it's not actually doing native comp. >:-( I haven't been able to build GCC with libjit support. (Used Clang while building; that solves some problems with GCC.) I've tried testing GCC/libjit on a smoketest and it hasn't worked. Please let me know what you get working!
Daamn... I've been building it with clang for the past hour (I dunno why the heck this taking soooo long, I think on Linux it builds much faster). I guess it won't work for me either :(
upd: Looks like the proper way of building is with gcc, but it builds without GUI. I need GUI.
Thank you for the kind words, I'm happy you find the tips useful. I stopped experimenting with native-comp in OSX for now. Sadly, I have only one Mac. Every attempt to compile it takes way too long, and getting Catalina running in VM is similarly challenging. But If I learn anything new I will definitely try again, and of course I will keep you posted.
Have you ever tried flatpak.
If so this may be helpful
https://github.com/fejfighter/pgtk-emacs-flatpak
Pre-configured flatpak manifest to build an emacs branch with libjanson, libgccjit and dependencies
The only tricky part for me was having to build gcc (for newer libgccjit). But it wasn't too bad. And you might not have to do that at all depending on your Debian version. Hour effort approx.
There was some minor brokenness native comp caused to my setup so still not using this branch. But most stuff did surprisingly work perfectly well.
mkdir gcc
cd gcc
git clone git://gcc.gnu.org/git/gcc.git src
mkdir build
mkdir install
PREFIX=$(pwd)/install
cd build
../src/configure \
--enable-host-shared \
--enable-languages=jit,c++ \
--disable-bootstrap \
--enable-checking=release \
--prefix=$PREFIX \
--disable-multilib
nice make -j4 # altering the "4" to however many cores you have
[0]
May need to install some prerequisites listed here https://gcc.gnu.org/install/prerequisites.html (the error message from the configure might not be obvious so better go through the list first, think I needed MPC and MPFR, whatever I found with apt-cache search libmpc and libmpfr worked).
And then configure and make emacs with PATH, LIBRARY_PATH, LD_LIBRARY_PATH including your gcc build (install/bin and install/lib).
I just build this from source on my macbook. I noticed significantly higher CPU usage while scrolling. (30%! Non-native comp Emacs 28 w/GUI is around 10–20% when scrolling through a file with lsp mode turned on.) Is this expected? The scrolling seems to stutter at times for me. What am I doing wrong?
Darn it. When I try running the `native-compile-async` function, I get thrown into the debugger with a message telling me that Emacs wasn't compiled with native compiler support.
I did have to use clang instead of gcc to get past some errors about not finding Appkit.h. I'll have to do more digging and try and get gcc working. Thanks for your help though!
oss will have to mature a bit like good ol corporate programming did
an OSS project will do so much and may die, the next one will try a new branch (from scratch, influenced a bit by the other or fully reusing the old ones)
to save energy it's good to think and plan for continuations.. your project will be much more useful if kept clear so other can jump in and extend or rewrite it without struggle
Though it's bleeding edge, I haven't experienced any issues: everything just works.. faster!
It always amazes me that some people are willing to put in such hard work, alone, for open source. The fact that one guy managed to speed up all of Emacs 2x-20x in his spare time for no pay is frankly amazing. Certainly puts my side-projects to shame.