Live data from Hacker News

Show HN: Rust GUI Library via Flutter

cjycode.com

51–60 of 108 posts

Re: Show HN: Rust GUI Library via Flutter

#51
post #49
post #41

I use Flutter for my desktop UI and Rust for my backend. However, I chose to separate the two using gRPC instead of the bridge. This allows me to be agnostic of language on both sides and I suspect gives me a cleaner interface for mocking the backend from my frontend. It also makes it easy to place the UI and backend on different machines giving a true client/server architecture. The con is likely that the interface…

Do you run a gRPC service on the desktop where the UI runs, and connect the 2 via localhost?

Not op but I’m developing an application with this exact approach as we speak, although my backend code is in Dart also.

You can also do gRPC over Unix domain sockets too if you’re sticking with desktop but overall I really like this approach as it makes it trivial for me to move from desktop app to web app with only some minor config changes.

Re: Show HN: Rust GUI Library via Flutter

#52
post #40

Earlier quoted context omitted.

Not at all, pretty much all popular languages (except C/C++) are as safe as (safe) rust. The only safety rust brings to the table is memory safety, which most languages achieve with a runtime and a garbage collector, which have a performance tradeoff.

In three most narrow definition of safety I agree. But that's a very narrow definition. Rust does offer a lot more: - no undefined behavior - many classes of concurrency bugs prevented by the type system - standard library and much of the ecosystem makes invalid states unrepresentable. E.g. a String is always valid UTF8 Those are things that are true to varying degrees for other languages. Dart does pretty well imho.…

Rust's concurrency is only safe in the very specific use case of threads trying to access common resources on the same memory space.

It does nothing to prevent data races between processes, or concurrency errors between threads accessing resources that are external to the process.

Scenarios quite relevant in distributed systems.

Re: Show HN: Rust GUI Library via Flutter

#53
post #19

Earlier quoted context omitted.

Thank you! I heard some people saying that, for apps using JavaScript, Tauri is replacing Electron and is popular nowadays, since Electron is very widely used. It seems Tauri cannot let Rust communicate with JavaScript very seamlessly yet, e.g. https://tauri.app/v1/guides/features/command/ seems to have mainly basic features. oneshtein mentioned below that Tauri does not support mobile as first class citizen yet as w…

Thanks for the info! I will keep an eye on this for future projects, keen to try it out. I’m currently working on a project being converted from Electron to Rust/Tauri. I recall Flutter being discussed, but our frontend dev was more comfortable with React.

You are welcome and looking forward to it!

Re: Show HN: Rust GUI Library via Flutter

#55

How is the a11y story with this? I did not find any info about it in the document, but I can not imagine anyone releasing a GUI kit in 2024 without extensive a11y support, so why not mention it?

Do you mean in Flutter generally? I'd say it's very good, easy to build in on widget by widget basis, very easy to check and rest when running builds.

Re: Show HN: Rust GUI Library via Flutter

#56
post #44
post #27

Earlier quoted context omitted.

> I know Flutter/Dart doesn't get much love here on HN but in my opinion I think it's much easier to reason about than a system like React which I think is the wrong level of abstraction compared to Flutter's render the entire widget tree approach. Could you expand on this a bit? My impression was that Flutter and React had relatively similar approaches to components, but I haven't had much experience with Flutter ye…

React = one small piece of a very large required ecosystem (HTML + CSS + Javascript + NPM + React + Vite + ???) Flutter = a UI framework for mobile/desktop/web (Flutter + Dart) On top of the purpose built nature, nearly everything is a Widget, even layout/styling making it pretty easy to grok very quickly.

flutter does a so so job on desktop and it's web version is wasm based.

the job market for dart flutter is a drop while react is the lake.

react with electron, react native, react itself together are still the only ones production ready cross platform GUI with widest adoption

Re: Show HN: Rust GUI Library via Flutter

#57
post #49
post #41

I use Flutter for my desktop UI and Rust for my backend. However, I chose to separate the two using gRPC instead of the bridge. This allows me to be agnostic of language on both sides and I suspect gives me a cleaner interface for mocking the backend from my frontend. It also makes it easy to place the UI and backend on different machines giving a true client/server architecture. The con is likely that the interface…

Do you run a gRPC service on the desktop where the UI runs, and connect the 2 via localhost?

As one option, yes, the other option is to run them on different machines. App isn't done yet but the idea is that you are presented an option to either connect locally (if localhost detected) or remotely via auth on UI startup.

Re: Show HN: Rust GUI Library via Flutter

#58

Cool, but the point of having stuff in Rust is to ideally have everything in Rust, or you're by definition not getting all the safety benefits of Rust.

While dart is definitely not like rust, dart is a very safe language. I'd love a dart+rust project if the package ecosystem wasn't such a mess in dart

Re: Show HN: Rust GUI Library via Flutter

#59
post #5

I have been using this to build an app[0] for the last couple of years and I want to say that it has been a pleasure to use, there are some wrinkles but overall I have been very happy with the experience. Upgrading from v1 to v2 was not too difficult and v2 is a significant upgrade with lots of useful features, massively improved codegen experience and support for tokio async were the big gamechangers for me. Writing…

Flutter is not bad, but I hesitate diving into it based upon who controls it. Using a Google product feels like you're in constant threat of it just disappearing.

It also still has all the remnants of mobile and fingers and not desktop and mouse. Support for improving this is non-existent in my experience.

Re: Show HN: Rust GUI Library via Flutter

#60
post #47
post #36

Earlier quoted context omitted.

At a basic level Flutter renders the entire widget tree and caches components that don't need to re-render rather than applying a diff of changes to the DOM. But it's really the Flutter/Dart API and widgets that make it much easier to work with, if I need to load some data asynchronously I use a `FutureBuilder`, if I need a stream of events I can use `StreamBuilder` etc. Compared to Reacts state, hooks, memo, effects…

I don't quite understand the point about rendering, unless you mean it in the Angular sense (i.e. on every state update, the whole app gets rendered, and elements are updated to the new state during that render). But I can imagine that the API can be easier. I think React handles state fairly well, but as soon as that state needs to interact with things outside the React world (http requests, continuously updating da…

react and flutter are pretty much the same thing, i do both for a living i am not sure what this person is going on about
Post reply on HN