Why Nostr? What is Njump?
2023-02-25 04:18:35
in reply to

M. Dilger on Nostr: I don't know, all I can tell you is what I have tried and how that went. #[0] is ...

I don't know, all I can tell you is what I have tried and how that went. is working out design ideas but I don't think he's interested in the coding part. Are you?

I tried Tauri and found the undebuggable magic that hooks Rust and JavaScript together to be a massive minus. I have performance problems and I could not figure out why. Using javascript rendering with VueJS or similar was nice (it is what I do for my day job), but it just didn't work. I hear "good things" from other places about Tauri, but it didn't work for me.

I tried gtk4 (since it's newer than gtk3 and new projects maybe should use the newer one), but the rust bindings are not documented and are not quite like the C++ bindings, so it was very painful trying to figure out how to do in rust what is well documented in C++. The people who wrote the rust bindings were no help at all. I found that slowed me down so much that I abandoned gtk4.

I did not try QT.

I did not try other rust-native UIs such as druid, iced, slint, or azul.

egui has two problems, but they aren't as bad as originally imagined.

First, it is not easy to do beautiful interfaces. You don't get beautiful fonts with color emojis or subpixel anti-aliasing or even hinting for that matter. The default widgets are ugly 1990s looking things, so you may have to build many of your own widgets. BUT given that it is OpenGL you can draw anything that OpenGL draws so strictly speaking there are no limits to what you can do. It's just that some things are very complicated and most people don't want to build the top-end of a GUI from scratch.

Second, it is immediate mode, which means it re-renders every frame. This turns out to be no big deal at all. I run it at 10 FPS and it looks fine. Many frames don't require a redraw as nothing has happened, so it might only draw 1 frame per second. And the rust code that specifies what to draw is much faster and simpler than the pixel shaders (for example) that determine what color each pixel needs to be, and we aren't doing anything like that in rust per frame. So I find my CPU appears pretty much idle, even though it is respecifying what to draw for up to 10 times per second. I find it "fun" to make sure the UI code doesn't block and doesn't do anything compute intensive, and optimizing it really is my cup of tea.

So in summary I'm not against sticking with egui, but to make it look beautiful and to fix the UX, it will probably require some uphill UI development which might have been easier in a different GUI.

/wall-of-text
Author Public Key
npub1acg6thl5psv62405rljzkj8spesceyfz2c32udakc2ak0dmvfeyse9p35c