I'm curious if Rust would have prevented the memory correctness errors assuming it replaced Zig in this scenario. It sounds like the vast majority were due to Zig/C interactions which makes me believe Rust would have had the same issues, but as a Go developer I am only guessing. I'm curious if there is a language that provides more tools to ensure correctness even when you're interacting with a huge amount of C.
It is so much more difficult to write c bindings in rust. Maybe they wouldn’t even be able to write gtk bindings in rust
We rewrote the Ghostty GTK application
131–140 of 228 posts
Re: We rewrote the Ghostty GTK application
#132Earlier quoted context omitted.
Might be $TERM needs to be set or you need to add ghostty to terminfo
> Might be $TERM needs to be set or you need to add ghostty to terminfo Yeah, except that the specific terminfo needed for ghostty isn't installed anywhere on the boxes you ssh into ... you need to manually install it on every single one of them. That in and of itself makes it truly painful to switch to ghostty. And there are still a lot of other issues, like e.g. building the tip is a freaking nightmare of dependenc…
Yeah this is going to be an issue with any of the newer terminal emulators. No big deal. Updating terminfo is easy. If you can't then just set TERM=xterm
> Not ready for prime time by a mile IMO.
Nah, the issue is your lack of experience and understanding of the basics is terminals.
Re: We rewrote the Ghostty GTK application
#133Earlier quoted context omitted.
Might be $TERM needs to be set or you need to add ghostty to terminfo
> Might be $TERM needs to be set or you need to add ghostty to terminfo Yeah, except that the specific terminfo needed for ghostty isn't installed anywhere on the boxes you ssh into ... you need to manually install it on every single one of them. That in and of itself makes it truly painful to switch to ghostty. And there are still a lot of other issues, like e.g. building the tip is a freaking nightmare of dependenc…
As for $TERM, you can simply default it to `xterm-256color` which is more than enough
Re: We rewrote the Ghostty GTK application
#134Earlier quoted context omitted.
Reading the report you reference and other issues linked there, I would say that multiple attempts were made to fix it, all of which unfortunately required some heuristics and all of which have broken something else that was deemed worse. It seems to boil down to an issue in the underlying X11 machinery and it would need to be fixed there first to build a basis on which proper fixes can be implemented. Given that X11…
Other toolkits don't seem to have this issue on X11.
The issue comes from XInput2 (https://www.x.org/releases/X11R7.7/doc/inputproto/XI2proto.t...)
So I guess the "fix" would be to have two completely separate input handlers on X11, one of which supporting smooth scrolling and multitouch, the other not and then offering users a toggle in the style of
[ ] do not ignore the first scroll input after focus loss, but disable smooth scrolling and multitouch
Plus handling all the potential issues by having two separate input handlers.
That's asking a bit much for this particular issue und greatly smells like a case of XKCD 1172
Re: We rewrote the Ghostty GTK application
#135Earlier quoted context omitted.
> Might be $TERM needs to be set or you need to add ghostty to terminfo Yeah, except that the specific terminfo needed for ghostty isn't installed anywhere on the boxes you ssh into ... you need to manually install it on every single one of them. That in and of itself makes it truly painful to switch to ghostty. And there are still a lot of other issues, like e.g. building the tip is a freaking nightmare of dependenc…
> the specific terminfo needed for ghostty isn't installed anywhere on the boxes you ssh into ... you need to manually install it on every single one of them. Yeah this is going to be an issue with any of the newer terminal emulators. No big deal. Updating terminfo is easy. If you can't then just set TERM=xterm > Not ready for prime time by a mile IMO. Nah, the issue is your lack of experience and understanding of th…
lol.
sure, very easy to do this on order of magnitude 1000 remote machines whose various OS's are entirely managed by automation.
Re: We rewrote the Ghostty GTK application
#136Fun fact. In Ghostty and (some) other GTK apps, if your mouse leaves the window, the first scroll click after re-entering the window is ignored. This is due to an ancient bug first identified in 2015. https://bugzilla.gnome.org/show_bug.cgi?id=750994 There are no plans for a fix. The maintainer recommends waiting for Wayland.
Re: We rewrote the Ghostty GTK application
#137Earlier quoted context omitted.
This is what people mean when they say "make invalid states unrepresentable", languages with union types can easily avoid this problem.
It doesn't sound like they are talking about invalid states, more like they are taking about the kind of thing that in Rust would be represented by `Option >` or suchlike. Maybe your point is that in Rust much less ceremony is necessary to avoid hitting a null pointer when doing this. But still, in either language it's easy to end up with hard to follow logic when doing this.
For example this is something you can do with typescript.
function(args: Arguments) { ... }
type Arguments = { a: number, b: number } | { a: number, b: string, c: number }
the Arguments { a: 1, b: 1, c: 1 } is not representable.Re: We rewrote the Ghostty GTK application
#138Earlier quoted context omitted.
Not saying you are wrong, but this is akin to “this is the year of the Linux Desktop”. You probably don’t have this telemetry but have you thought about how having window support helps Zig adoption? Anecdotal, at day job, we started to use Zig build system to target Windows because that’s where the customers are.
Yeah. I just wish Microsoft were better stewards of the OS.
Re: We rewrote the Ghostty GTK application
#139Earlier quoted context omitted.
In general: whenever you call into C, you get all the safety of C, because C code can trivially have memory corruption bugs that corrupt memory "belonging" to Rust as well, inducing undefined behavior across your whole program [0]. In addition, it's often considered permissible for C APIs to exhibit undefined behavior if their API contracts are violated. This means that a bug in Rust code that calls into a C API inco…
> The typical approach to using C libraries from Rust is to create a "safe wrapper" around the unsafe FFI calls that uses Rust's type system and lifetimes to enforce the safety invariants. Calling it a "safe" wrapper, when that safety is entirely dependent on (a) the correctness of the hand-written wrapper, (b) the safety of the underlying FFI code, has always been a huge stretch of terminology. It's more like a veil…
It's much much easier to say that a reference is alive here, and only here can we derefence it, AND every other business code elsewhere.
Re: We rewrote the Ghostty GTK application
#140Earlier quoted context omitted.
> the specific terminfo needed for ghostty isn't installed anywhere on the boxes you ssh into ... you need to manually install it on every single one of them. Yeah this is going to be an issue with any of the newer terminal emulators. No big deal. Updating terminfo is easy. If you can't then just set TERM=xterm > Not ready for prime time by a mile IMO. Nah, the issue is your lack of experience and understanding of th…
> Updating terminfo is easy. lol. sure, very easy to do this on order of magnitude 1000 remote machines whose various OS's are entirely managed by automation.