Live data from Hacker News

We rewrote the Ghostty GTK application

mitchellh.com

201–210 of 228 posts

Re: We rewrote the Ghostty GTK application

#201
post #3

Nice example of how good programming is often about meeting systems where they are: Whatever your feelings are about OOP and memory management, the reality is that if you choose GTK, you're forced into interfacing in some way with the GObject type system. You can't avoid it. Well you can avoid it and we did avoid it. And it leads to a mess trying to tie the lifetimes of your non-reference-counted objects to the refer…

GTK having this kind of scheme is why Vala was made and inspired by C# but uses GObject and all its joys, then transpiles your code to C. This is why a surprising number of GTK applications (more than I realized) are coded in Vala. I lowkey wish they had just adopted D instead of building up Vala. D is basically compiled C# to me in its own ways.

The GTK C API definitely feels like it's begging for a domain-specific language. I guess that language turned out to be Vala, and from what I could see it was a pretty nice language.

My takeaway from all this is a little bit different though: I feel this whole situation ultimately some credence to the Scheme/Racket philosophy, where you can effectively make yourself a domain-specific language without ever leaving the base language. In an alternate universe, we don't choose between adopting D or inventing Vala. We can just stay in Racket.

Re: We rewrote the Ghostty GTK application

#202
post #77

Earlier quoted context omitted.

It doesn't mean his platforms, it means the top ones, so at least his and hundreds of millions of others'

Terminals are not really targeting that entire demographic, and for the one they serve probably Mac/Linux form a majority vs Windows.

This is a wild take.

Re: We rewrote the Ghostty GTK application

#203

Earlier quoted context omitted.

Terminals are not really targeting that entire demographic, and for the one they serve probably Mac/Linux form a majority vs Windows.

This is a wild take.

Is it? I've heard of people using a non-Microsoft terminal on Windows besides git bash and cygwin probably no more often than I could count on one hand. And people don't ever use those for the terminal, but usually for GNU. On the other hand, I find it uncommon to see anyone who chooses to use a terminal regularly using the MacOS default terminal, and there is no default Linux terminal. I find it hard to imagine a world where that take is wild.

Re: We rewrote the Ghostty GTK application

#204

Earlier quoted context omitted.

Yes, its a hard dependency. But we go out of our way to add CSS classes to our UI widgets and even have a configuration in Ghostty to supply custom CSS directly (without you having to mess with gsettings or anything). We've seen some pretty incredible customizations in our showcase channel in Discord. We haven't committed to our CSS classes yet as a stable API but we plan to do that in the next release cycle. Still,…

> CSS classes GTK has gotten so fat that it's more like a 2nd-rate Electron. Not that Electron would have done Ghostty any good... I have a bad feeling that the only decent & consistent UI option under Linux is to target Win32 API, then run it under Wine.

The negative aspects of Electron have little to nothing to do with CSS, and you're only invoking it here to poison the well by association.

Re: We rewrote the Ghostty GTK application

#206
post #204

Earlier quoted context omitted.

> CSS classes GTK has gotten so fat that it's more like a 2nd-rate Electron. Not that Electron would have done Ghostty any good... I have a bad feeling that the only decent & consistent UI option under Linux is to target Win32 API, then run it under Wine.

The negative aspects of Electron have little to nothing to do with CSS, and you're only invoking it here to poison the well by association.

You are projecting. Personally speaking, I would choose Electron waaaay before I'd choose GTK. That probably wasn't an option for his optimized terminal, but would be Good Enough™ for just about anything else.

Re: We rewrote the Ghostty GTK application

#207
post #37

Earlier quoted context omitted.

Well... a terminal is a GUI app, so they had to choose some GUI framework. On Linux GTK is as good a choice as any. (Yes I know you can skip the framework and talk to X11/Wayland directly, like xterm/foot do, but that's a pain all of its own.)

What about Qt? Would that have been a better experience? Or would you experience different issues?

Qt has no official C bindings. This makes it difficult for a new language to write Qt bindings, unlike for GTK.

Re: We rewrote the Ghostty GTK application

#208

Earlier quoted context omitted.

I like Linux because it gives me the freedom to make my system behave how I want. The GNOME devs seem to think that GNOME should only behave how they want. For example, last time I checked, GNOME required a third-party plugin just to move the clock from the center of the status bar to the side. I'm not at all surprised to see that this mindset extends to GTK.

> The GNOME devs seem to think that GNOME should only behave how they want. For many years I followed this whole outrage but wasn't really sure whom to believe because I didn't have any stakes in the matter. Then the GNOME/GTK devs removed support for key themes[0,1] and I still have no idea why. The arguments they brought forward make absolutely no sense to me. Now I get where people were coming from. [0]: https://o…

Sun donated a bunch of UI guidelines to the GNOME project back in the really early days. Those guidelines basically boiled down to "You users are idiots, and power users don't matter, so get rid of as many options and force a single way of interacting with the software." The GNOME development philosophy just expanded on this.

Re: We rewrote the Ghostty GTK application

#209

Earlier quoted context omitted.

You didn't explain anything wrong with GTK. You just brought up Electron out of nowhere.

Electron is bringing an entire web browser in to provide a cross-platform user interface. GTK has become almost a web browser to provide a cross-platform user interface. That is why I started off with > CSS classes To spell it out, I think it is all excessive.

I don't think you know enough about GTK if you think having a CSS parser is bloat in a UI toolkit versus a whole theming engine.

Re: We rewrote the Ghostty GTK application

#210

Earlier quoted context omitted.

Electron is bringing an entire web browser in to provide a cross-platform user interface. GTK has become almost a web browser to provide a cross-platform user interface. That is why I started off with > CSS classes To spell it out, I think it is all excessive.

I don't think you know enough about GTK if you think having a CSS parser is bloat in a UI toolkit versus a whole theming engine.

Their CSS implementation is broader than what most actual browsers had 10 years ago. I would not have commented if I weren't already painfully familiar.

https://docs.gtk.org/gtk3/css-overview.html

It even has a DOM inspector window:

https://askubuntu.com/questions/597259/how-do-i-open-gtk-ins...

Post reply on HN