News for hackers. Stuff that matters.
Re:Discord is ditching Electron and its new app uses less RAM by ordu on Thursday November 05, 2026 @10:30AM (#50380343)
> Surely there's a better way?

I'd like to know it. I don't think that it can be substantially better. You have to compromise between the amount of customization you are allowed to do and the amount of options you have to pick values for.

I can't vouch for GPUI, I don't know how good its compromise is, but it bears enough similarities to other modern UI-toolkits. I don't think there is a better way, but if you know one, I'd like to know about it.

And, well, don't forget, it is a front-page example, that is not necessarily an example how one should compose their code, it demonstrates what you can do with GPUI. In real life code you'd probably move those children's construction into separate named functions, maybe you'd use some predefined styles to apply to individual elements, instead of picking fg/bg/text-colors, maybe sizes and some other attributes for each one explicitly, and maybe some other tricks.

Re:Discord is ditching Electron and its new app uses less RAM by eviks on Thursday November 05, 2026 @11:06AM (#50380873)
One improvement could be a better way to group and elide units, e.g.

Instead of

.border_1().border_color(rgb(0x0000ff))

You get

.border(1 0x0000ff)

(guess, this can only be in a macro)

Or at least have "color" which understands that it's allied to border instead of having to repeat "border"

> I don't think that it can be substantially better

Don't give up too early, there is no way it can't be, we don't really have any good systems optimized for ergonomics to reach anything great

Re:Discord is ditching Electron and its new app uses less RAM by c-smile on Thursday November 05, 2026 @03:04PM (#50383750)
> .border(1 0x0000ff)

After 10 or so of those you'll start dreaming of

   border-left: 2px solid rgb(0 0 100%);
right?
Re:Discord is ditching Electron and its new app uses less RAM by eviks on Friday November 06, 2026 @02:28AM (#50389258)
If you're dreaming, why would you stop at that when you could dream of much more visually compelling solid left thick border in a single symbol

┠

or more explicitly

├2

that'd be perfectly paired with a dream-like visual designer that doesn't exist?