It's nice to be able to use existing design systems and components, and to be able to validate in a web browser in quicker build loops before doing the full Tauri builds. I still manually QA across platforms pretty aggressively but Tauri's "cross-platform from day one" really isn't much of a stretch. The project if curious: https://github.com/zecrocks/zkv
The state of building user interfaces in Rust
71–80 of 156 posts
Re: The state of building user interfaces in Rust
#72I suspect if such a filter was applied there would be very few. Probably just the bindings to gtk, qt or appkit.
Re: The state of building user interfaces in Rust
#73Which of these has effective accessibility support? I suspect if such a filter was applied there would be very few. Probably just the bindings to gtk, qt or appkit.
Re: The state of building user interfaces in Rust
#74I'm building Hypen (https://hypen.space), a UI framework with a DSL that works in in Rust, TS, Go, Kotlin, Swift, and all over the place, as long as you can use WASM or binaries.
Some cool things about it:
- Renders natively on Desktop, Web (DOM and Canvas), Android and iOS.
- Streaming-first (SSR), so you can stream native apps from the server
- Custom tailwind parser so it supports your favorite shorthands
- Support for streaming apps from CF workers with 5 lines of JS/TS
- You can embed any Hypen app into another Hypen app like its an iframe, with just 1 line of code
- Has a custom "browser" for Hypen apps, both on desktop and on mobile, so you can easily check how your app looks anywhere
- Coming soon - stdlib and WASI interface to enable full WASM portability across platforms
Note: Desktop support is still a bit early and needs more crossplatform testing
I started building this years ago, first manually, now accelerating it with LLM's which are incredible for mindnumbing tasks like writing frameworks like these requires. Its still in an "early alpha" but it's getting closer to maturity and a "stable beta" by the day, hopefully fully stable 1.0 by end of the year.
Re: The state of building user interfaces in Rust
#75While part of the Windows crate, I think windows-reactor deserves explicit mention. https://github.com/microsoft/windows-rs/tree/master/crates/s... It's a react-style API for WinUI3 apps, meaning it's not trying to mimic the Windows LAF. It's merely a binding.
Re: The state of building user interfaces in Rust
#76qmetaobject-rs gives you the best of both worlds: logic in rust, UI in arguably world's best cross platform framework Qt.
As a "batteries included" framework Qt is undoubtably amazing but I used it on a project recently and it struck me as dated compared to Flutter or React Native. Maybe I'm doing it wrong but I had to write a lot of boilerplate C++ even when using QML. The layout engine feels byzantine. The state management is mostly manual. Flutter is a lot more consistent, reactive, and all done in one way (Dart) and it supports hot…
Re: The state of building user interfaces in Rust
#77I also have a horse in this race, would love to have it included! I'm building Hypen ( https://hypen.space ), a UI framework with a DSL that works in in Rust, TS, Go, Kotlin, Swift, and all over the place, as long as you can use WASM or binaries. Some cool things about it: - Renders natively on Desktop, Web (DOM and Canvas), Android and iOS. - Streaming-first (SSR), so you can stream native apps from the server - Cus…
(I'm not affiliated, but have made PRs there in the past)
Re: The state of building user interfaces in Rust
#78Unfortunately, I had the expectation that it should be as simple as making an HTML page. My failure to find a library or a framework to make GUI application made me learn a lot about how GUI works. I realized that making GUI for browser and for desktop are quite different problems. Browser makes easy what's difficult having a desktop oriented GUI framework - text rendering. However, the situation is fair the other around. GUI framework makes easy what's difficult in a browser - drawing arbitrary shapes. As a result, a web-frontend programmer struggles to figure out how to write some text having something like Qt, a GUI programmer tries to find the API to the bitmap in a browser.
It's fair noticed in the previous comments that a GUI framework brings a lot. That's because the problem is complex:
1. Create a window
2. Communicate with the window compositor (you do in WinAPI too btw). How to access the system tray and the child window.
3. Communicate with the operating system.
4. Handle the user input. Callback vs event streams. The user has 4 keyboards for some reason.
5. Rendering. Subpixels, shapes, different DPI. The user has 6 monitors.
6. Text rendering.
7. Widgets. Where probably the most difficult part is to make a textbox, because it involves the solutions of all previous steps.
The steps above touch only the visual part. There's also audio, accessibility, somebody wants the GUI framework to solve the networking.
After all of this research, I picked simply SDL for my project.
1. It's easy to compile.
2. It's small.
3. It relies on the subjectively common dependencies.
4. It's fairly straightforward to upgrade. Given that, you have to create a lot from scratch the part with updating is smaller comparing to a Qt-based solution.
5. It has batteries. My favorite is SDL_ttf which allowed me recently to implement selection of the text which is quite a bit through towards a textbox.
Having a project on SDL requires a lot of knowledge, but not a lot of code.
Re: The state of building user interfaces in Rust
#79Building a GUI framework in Rust comes with certain challenges. Ralph Levien, author of druid and xilem made some good posts about it. I'll link one here. https://raphlinus.github.io/rust/gui/2022/07/15/next-dozen-g...
Re: The state of building user interfaces in Rust
#80Earlier quoted context omitted.
Is that actually needed? Styling is largely a user decision. They might have defaults yes, but if you looked at a raw HTML page with no CSS styling, you might come to the conclusion that websites have an ugly GUI...
This is the mindset that gives you Java-Style GUIs.