4 ms·
I was imagining a React style UI framework but for desktop apps. The ingredients I have in mind are React, GraphQL, and Rust. I think these three solve the prob
by ctulek 9y ago
I was imagining a React style UI framework but for desktop apps. The ingredients I have in mind are React, GraphQL, and Rust. I think these three solve the problems of their respective areas the best and combining them together would be priceless.
- Yoric 9y agoHow would GraphQL be useful for a desktop app?
- odammit 9y agoI think GraphQL is useful for getting data for UIs on any platform. - build views without being blocked waiting for a new rest endpoint - get exactly what the UI needs to render [edit] Although to negate my own first point, nb4 being blocked on waiting for new mutations and queries :P
- deleted 9y ago[deleted]
- k__ 9y agoAlso, you can use it to query local data too. This enables you to transparently move data-source around.
- y_u_no_rust 9y agotalk about going backwards ffs
- odammit 9y agoThat’s a good point! Never thought about local data sources. I’ve only mapped over SQL, REST, and redis/etc.
- ComputerGuru 9y agoNative applications don’t need that, though. Modern languages embrace async/await and don’t waste cycles or block the UI or even the backend unnecessarily waiting for network/local IO or user interaction. In that regard, rust is actually behind. Async/await is still coming.
- odammit 9y agoNative applications don’t get blocked waiting for backend engineers to implement a new REST endpoint? Native applications don’t benefit from smaller responses of just the data they need to render a view? I am confused.
- ctulek 9y agoA typed query language will definitely help for anything you store either locally or remotely. In this case, it would provide information to compiler to do most of the type checking for you. It is not only GraphQL itself I had in mind though. It is also about implementing a client library similar to Apollo GraphQL where you can provide watch queries wrapping your UI components. Watch queries provide great developer ergonomics for handling the flux data flow, that is, whenever there is a change to your data in store, if the corresponding elements in datastore are watched by a query, the UI components wrapped by this watch query are re-rendered with new data, automatically. I think this combination will help desktop development by helping to reduce boilerplate code and by providing a convention to development team. We enjoy this combination already in web UI development for the last one year, in our team.
- danieldisu 9y agoI think Rust may be a bit too low level for that but at least you will be in the HN frontpage with that combination for sure!
- xfer 9y agoHow is rust too low level for a desktop app? All the native ui toolkits are in C/C++ ...
- StavrosK 9y agoIs there any good/mature/sane library for UI in Rust? I'd love to use Rust for a desktop app I want to write.
- lj3 9y agoDoes Nuklear fit your definition of sane UI library? https://github.com/vurtun/nuklear https://github.com/vurtun/nuklear https://github.com/snuk182/nuklear-rust https://github.com/snuk182/nuklear-rust
- StavrosK 9y agoThat looks interesting, but I'm talking about something more like GTK, ie something that looks somewhat native and is easily portable across OSes.
- andrewflnr 9y agoThis comes up in /r/rust periodically, and IIRC the answer is still pretty much "no". It is getting better, though, slowly. I'm on my phone and too lazy to find a link for you, but search /r/rust for discussions about GUI libraries/frameworks.
- steveklabnik 9y agoIntegration with GTK is getting easier and nicer, but there's more work to do.
- 9y ago
- steveklabnik 9y agoThere's been some work on GraphQL and Rust https://www.gjtorikian.com/posts/2017/08/15/wrapping-rust-in-ruby-to-parse-gql/ https://www.gjtorikian.com/posts/2017/08/15/wrapping-rust-in...
- mastax 9y agohttps://github.com/antoyo/relm https://github.com/antoyo/relm is almost that, except elm-inspired rather than react-