News for hackers. Stuff that matters.
Re:Emacs 27.1 by smabie on Tuesday August 11, 2020 @02:58AM (#24117853)
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.

Re:Emacs 27.1 by yewenjie on Tuesday August 11, 2020 @05:08AM (#24118558)
I second every single line of this comment.

Here's the update log of the project.

https://akrl.sdf.org/gccemacs.html

Re:Emacs 27.1 by mdaniel on Tuesday August 11, 2020 @04:26PM (#24125565)
With https://akrl.sdf.org/gccemacs.html#orgfc80a25 being the relevant starting point in that sea of text (the PKGBUILD is also handy for seeing what's going on: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=emacs... )
Re:Emacs 27.1 by josteink on Tuesday August 11, 2020 @03:52AM (#24118159)
> It always amazes me that some people are willing to put in such hard work, alone, for open source.

For many people this is about scratching an itch, their own itch.

They improve upon it not for the sake of "open source", but for the sake of making the very same tools they rely on to be better tools.

This is how open-source used to work, and this is how it grew.

Re:Emacs 27.1 by mark_l_watson on Tuesday August 11, 2020 @10:35AM (#24120679)
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.
Re:Emacs 27.1 by jmnicolas on Tuesday August 11, 2020 @04:24AM (#24118325)
> 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).

Re:Emacs 27.1 by gallexme on Tuesday August 11, 2020 @06:44AM (#24119001)
Have a look at https://gdal.org/index.html

Solved a lot of weird open formats issue we had

Re:Emacs 27.1 by jmnicolas on Tuesday August 11, 2020 @08:15AM (#24119492)
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.

Re:Emacs 27.1 by iudqnolq on Tuesday August 11, 2020 @05:46AM (#24118723)
What does your app do? That's an area I'm pretty interested in.
Re:Emacs 27.1 by jmnicolas on Tuesday August 11, 2020 @05:59AM (#24118771)
It's a desktop (Windows) map viewer.

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).

Re:Emacs 27.1 by tosh on Tuesday August 11, 2020 @05:52AM (#24118745)
this sounds super useful to me (I have been in similar situations in the past @ various formats that aren’t super popular).
Re:Emacs 27.1 by jmnicolas on Tuesday August 11, 2020 @06:01AM (#24118780)
What sounds useful ? The app ? If you don't have complex requirements there's surely something available for your platform.
Re:Emacs 27.1 by iLemming on Tuesday August 11, 2020 @01:59PM (#24123515)
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.
Re:Emacs 27.1 by ashton314 on Tuesday August 11, 2020 @04:22PM (#24125523)
I'm not sure if I'm cool or not, but I built mine from source. Took a bit of doing. I found a helpful tutorial here:

https://gist.github.com/AllenDang/f019593e65572a8e0aefc96058...

Re:Emacs 27.1 by iLemming on Tuesday August 11, 2020 @10:48PM (#24128137)
Oh, you're amazing! This is awesome, thank you. I just built it. Running smoothly.
Re:Emacs 27.1 by iLemming on Wednesday August 12, 2020 @01:34PM (#24134521)
I spoke too soon. I missed a step in the instructions. It's not working as expected. I'm gonna have to try again. Combining things from that gist and using some bits from here: https://gist.github.com/mikroskeem/0a5c909c1880408adf732ceba...
Re:Emacs 27.1 by ashton314 on Wednesday August 12, 2020 @03:29PM (#24135800)
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!
Re:Emacs 27.1 by iLemming on Thursday August 13, 2020 @08:02PM (#24151502)
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.

Re:Emacs 27.1 by ashton314 on Saturday August 15, 2020 @11:11PM (#24174641)
Dude, if you can get it built, please either send me all the instructions or just post the binary.

Thanks for all your great tips on Twitter, btw. :)

Re:Emacs 27.1 by iLemming on Sunday August 16, 2020 @12:26AM (#24175107)
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.
Re:Emacs 27.1 by ashton314 on Monday August 17, 2020 @01:22AM (#24184263)
:)

I might try compiling it on my personal machine this week while I’m at work. I’ll keep you informed as well if anything interesting happens.

Re:Emacs 27.1 by cmrdporcupine on Tuesday August 11, 2020 @09:45AM (#24120164)
Is anybody distributing debian packages of builds off this branch? It's been some years since I built emacs from source...
Re:Emacs 27.1 by declanqian on Friday August 14, 2020 @08:42AM (#24157119)
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

edit: formatting

Re:Emacs 27.1 by auganov on Tuesday August 11, 2020 @09:56AM (#24120261)
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.

Re:Emacs 27.1 by cmrdporcupine on Tuesday August 11, 2020 @10:04AM (#24120347)
Yeah I just ran through the checkout and configure process and found: configure: "error: Installed libgccjit has failed passing the smoke test."

FWIW this is libgccjit-10-dev, the most recently available package I could find in my install (debian based Google gLinux).

Not sure if I have the motivation to go build it, but who knows! Beats writing design docs, which is the other thing I could be doing ;-)

Re:Emacs 27.1 by auganov on Tuesday August 11, 2020 @10:26AM (#24120567)
Yea was same for me. It's really not that bad.

   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).

[0] taken and modified from https://gcc.gnu.org/onlinedocs/gcc-6.4.0/jit/internals/index...

Re:Emacs 27.1 by ashton314 on Tuesday August 11, 2020 @04:24PM (#24125543)
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?
Re:Emacs 27.1 by smabie on Tuesday August 11, 2020 @04:48PM (#24125790)
Did you compile all of the Elisp files using a high optimization level?

If so, you might want to get in contact with the author. I imagine that OSX isn't as well tested as Linux.

Re:Emacs 27.1 by ashton314 on Tuesday August 11, 2020 @08:48PM (#24127573)
I might try setting that. I’m pretty new to all this; could you point me to where I can find instructions on how to set the optimization level?
Re:Emacs 27.1 by smabie on Tuesday August 11, 2020 @11:32PM (#24128365)
I think you can just do:

  (setq comp-speed 3)
Then you should tell it to recompile all of your elisp files:

  (native-compile-async "~/.emacs.d/elpa/" <n> t)
  (native-compile-async "<path/to/system/elisp/files>" <n> t)
Where <n> is the number of threads you want. It's also possible than you have deferred compilation and that's the problem?
Re:Emacs 27.1 by ashton314 on Wednesday August 12, 2020 @12:04PM (#24133435)
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!

Re:Emacs 27.1 by ashton314 on Wednesday August 12, 2020 @10:37AM (#24132442)
Thank you! I’ll give this all a try.
Re:Emacs 27.1 by rStar on Thursday August 13, 2020 @07:08PM (#24150810)
Re:Emacs 27.1 by agumonkey on Tuesday August 11, 2020 @07:20AM (#24119173)
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