Live data from Hacker News

I built a GPU back end for Emacs

en.andros.dev

61–70 of 117 posts

Re: I built a GPU back end for Emacs

#62
post #10

Well done. Here’s hoping that a hand-written GPU backend gets developed based on this wonderful proof of concept. There’s no reason to not take advantage of the state of the art hardware when it’s available. And screens are only moving toward 4k and higher (6k or 8k).

Or that GNU updates a policy that will very rapidly go from probably net silly/mildly contestedly useful to completely ridiculous in a year or two. Not allowing LLM code will be basically turning down the work of the worlds best programmers running at 50x speed in couple years, and will functionally doom any software project that enforces such a policy.

that policy should only ever be relaxed towards legacy contributors and those they can vouch for.

otherwise, allowing sloptributions opens the gates to a myriad you-know-who who used to submit pull requests for ESL rewrite of two sequences in README.md and now submit chatgpt-generated refactors - which waste even more human time - just so they can proudly put "open source contributor" on their resumes.

Re: I built a GPU back end for Emacs

#63
post #42

Emacs user for >32 years now. It's a pity this won't get merged. There is a big usability/accessibility factor to consider here: I really wish I could have something like the Ghostty cursor_blaze.glsl shader for highlighting where the cursor is when you switch windows/buffers/apps. Most people think GPU equals silly toys like video in a text window, but there is much more to it than that. [and yes, I know about beaco…

I would love to have something like nvim's "smear-cursor". iirc someone wrote a patch (it was posted on r/emacs) - I'll attach it if I find it. My first thought was "is it doable as a dylib?"

Re: I built a GPU back end for Emacs

#64
post #5
post #4

This was almost a good read (a very good goal and a sensible approach), But the pacing of the article smells of LLM. I would suggest to do another pass at editing it out as it diminishes the story.

If you've reached that conclusion, I'm truly proud of my writing technique. I'm sorry to say, though, that your instincts are failing you this time. I write my articles by hand over several days, although it's true that I do consult AI to improve my style, expressions, find synonyms, create tables, and correct spelling mistakes. Thank you for your comment!

I think you'd get your point across better if you avoid consulting AI to improve your style, may lead to less distracting threads like this.

Re: I built a GPU back end for Emacs

#67
post #20
post #8

https://github.com/tanrax/emacs-gpu/blob/main/.github/assets... This massive speed-up on 4K screens makes me want to try it. The wayland pgtk version has such terrible latency I have to use the X11 build to avoid gnashing teeth during my working hours. And I think it's the X11 version that uses cairo, so the actual speedup in my case might be even larger. I reported the issue years ago, the pgtk maintainer confirmed,…

Good news on the Wayland front: there is already a working branch (wayland-pgtk-backend) that adds a PGTK binding on top of the same EGL/GLES driver, pending merge to main. If you want to try it before that, the branch is available on the repo.

I can't find that branch here - https://cgit.git.savannah.gnu.org/cgit/emacs.git

Am I looking in the wrong place?

Re: I built a GPU back end for Emacs

#68
post #34

Earlier quoted context omitted.

I have perf issues with emacs-pgtk on a 4k screen on Wayland with Niri in both Emacs as a client and not. The issues appear with typing or scolling, the delay and lag become noticeable. For me the issue is only unbearable when running fractional scaling, for some reason. I'm going to try the branch mentioned in the sibling comment, though.

I have almost the exact same setup as you and even have strange behavior with fractional scrolling. I'm on NixOS so the setup is even inspectable: https://codeberg.org/arik/dotfiles After resetting the scale from 1.2 to 1.0 through 'niri msg output HDMI-A-2 scale 1' I actually noticed a performance increase! I will have to troubleshoot this, although you may have stumbled on a great lead toward the root cause.

I didn't invent this mitigation FWIW - I saw it mentioned in one or another thread about this by someone else - possibly on the big reddit thread on this topic, not sure.

Re: I built a GPU back end for Emacs

#69
post #60
post #42

Emacs user for >32 years now. It's a pity this won't get merged. There is a big usability/accessibility factor to consider here: I really wish I could have something like the Ghostty cursor_blaze.glsl shader for highlighting where the cursor is when you switch windows/buffers/apps. Most people think GPU equals silly toys like video in a text window, but there is much more to it than that. [and yes, I know about beaco…

GPU speedups are welcome, but you don't need a shader and a gpu to insert a flashy effect. Emacs has had this for decades: `pulse.el`. And building your own is very simple also. You'll still need someone to write the glue code to trigger the pulse, but then a gpu patch on the backend wouldn't give you that either. I'm sure someone on MELPA/Github has written code to do just this already.

> Emacs has had this for decades

Pulse works, but honestly it pales when compared to neovim's effect. It would be nice to have a machinery to create things like that in Emacs.

Re: I built a GPU back end for Emacs

#70
post #12

Earlier quoted context omitted.

Very much this. I really dislike the somewhat corporate and characterless sounding tone of AI. I really liked the part where he tried to get it into upstream emacs, most of these type of projects never even get there. But yeah things like "bring honest numbers" sounds just weird.

Please, have some mercy, English is not my first language! Thanks for the advice, I'll keep it in mind.

People are paranoid that everything they read was written by a LLM. It's likely that they are even more suspicious because you used one to code.

You should be proud of both the work you did and the article :-).

Post reply on HN