Live data from Hacker News

Graphical User Interface Using Flutter in Embedded Systems [pdf]

static.sched.com

61–70 of 202 posts

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#61
post #30

Somewhat of an aside, since this article is about Flutter on embedded systems where React Native isn't even a consideration but... I've used both Flutter and React Native. Hands down, Flutter is the more enjoyable experience. Everything from the language, to the toolkit, to the IDE, to the final product, is just BETTER. React Native is a bloated, hacky, slow, garbage pile by comparison.

I can't figure out flutter. I see so many rave reviews. But I personally tried it and strongly disliked it. The toolkit and Android Studio run horribly slow - like really slow. And the output is basically this generation's flash. Some of the samples I tried on their gallery are mediocre. Very slight, but noticeable sluggishness. Some are just terrible; the 2d transformations moves at like 7fps. Plus there are so many…

You do not have to use Android Studio. Use it with Visual Studio code or your FOSS variant of it with the Flutter plugin. That works really well.

> Also dart is a real PITA coming from typescripts which is basically c#.

That's surprising to me. Coming from Ruby Dart was great. Not better, but when you are expecting a tuned up javascript Dart was such a nice surprise. I'd have expected it'd be the same for someone coming from C#. You worked with a current version and gave it a fair shot?

I'm in the Flutter is great camp. The UI you produce with it work great, and the whole process is great. Very powerful and at the same time manageable, a smart small concept at its core, with much around it that makes it powerful. Combine it with GetX and the code you get can also be really nice.

But for Linux? No way, not until they have got a proper beta that is not tied to snap. But maybe Sony is working on that and showing it here? Or I'm just not aware that this is not a real requirement, despite the website making it sound that way?

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#63
post #28

Honestly I don't get the appeal of Dart/Flutter for this use case for two major reasons: 1. Dart is garbage-collected; and 2. Dart has optional typing, which is to say it supports type hints but is essentially dynamically rather than statically typed. This presentation claims low overhead so I'm open to be proven wrong here. I wonder how much of that (if true) is Flutter and how much is Wayland (over X). I'd really l…

I work on the Dart team.

> 1. Dart is garbage-collected;

Yup. Most languages used for UI programming these days are. JS and C# are probably the biggest two. UI programming is at a really interesting intersection between two difficult constraints:

* Much of the work is subjective, exploratory, and frequently-changing. It's hard to evaluate whether a UI looks and feels right until you code it up and try it. When you do, you often realize you need to change things. Also, product people really like to "refresh" application UIs frequently so there's a ton of churn. All of this means that developer productivity is absolutely paramount. You need to be able to make small iterative changes quickly to evaluate them, and you need to be able to do sweeping re-writes efficiently. That means you want a high-level language and GC is a big part of that.

* At the same time, the program is real-time interactive software running on user hardware that you don't control. So just like games, execution performance and latency is critical. A slow language implementation can degrade the application's appeal in ways that materially affect its success.

Balancing those is hard. Fortunately, people have been hacking on GCs for decades and have gotten really good at them. The Dart VM's garbage collector has been designed from day one for soft-realtime interactive performance. It's generational with a very fast nursery allocator and collector, doesn't stop the world, and (I believe) can do a full collection in the background.

Also, the language itself was somewhat designed to be GC friendly. Unlike dynamically typed languages like JS, object shape doesn't change at runtime so an instance is only ever a single allocation.

> 2. Dart has optional typing, which is to say it supports type hints but is essentially dynamically rather than statically typed.

As my colleague mraleph said, this hasn't been true for a couple of years, though it tends to take a long time for knowledge about this to percolate through the world. Dart is now a typical statically-typed language very similar to C# and Scala.

> But GC isn't just about overhead (although that is a concern). It's about predictability of performance. It's about tuning the VM and the characteristics of STW GC pauses (if any).

Exactly right. The Dart VM was always intended for client-side applications, so it's designed around low latency performance.

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#64
post #28

Honestly I don't get the appeal of Dart/Flutter for this use case for two major reasons: 1. Dart is garbage-collected; and 2. Dart has optional typing, which is to say it supports type hints but is essentially dynamically rather than statically typed. This presentation claims low overhead so I'm open to be proven wrong here. I wonder how much of that (if true) is Flutter and how much is Wayland (over X). I'd really l…

Embedded devices which have a UI are by now normally so fast that garbage-collection doesn't matter at all. Similar you tend to not need to turn the GC at all for writing UI applications like that, the defaults are just good enough. Lastly while dart can be dynamically typed (EDIT: it's opt-in dynamic typing instead of opt-in static typing) it's typed statically "good enough". I love static typing (e.g. rust, scala) but in difference to type script I haven't run into any major gotchas when using dart. It feels very Java-ish just without the bad parts of java tbh.

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#65
We need source for that GTK+ example used to imply GTK+ is broken on Wayland.

It could very well be PEBKAC, client-side decorations make being coordinate system aware much more important. If your code assumes everything's in drawable coordinates, it'll work in a top-level window on X11, but may break when Wayland w/CSD shifts things.

That slide is potentially quite damaging to GTK+'s reputation, to not even provide a way for us to independently verify the results is frustrating.

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#66
post #34

Earlier quoted context omitted.

An important distinction is Embedded and Real-time. Embedded is the all-encompassing tent, while Real-time is a subset thereof. Embedded includes things with GUIs, like fridges. We're not dealing with 128k of RAM. These can run basic GC'd apps just fine. Pauses really aren't any more of a concern than on desktop, or even less so.

My experience is not this. I've never seen an embedded app with GC. And embedded is usually dog slow processor running at minimum clock, to save power. So pauses are 10X or more the issue re: desktop.

> And embedded is usually dog slow processor running at minimum clock, to save power.

It used to be like this for a long time, but nowadays the market is moving towards stronger embedded CPUs, either just because they are affordable (raspberry pi), or the power is actually wanted for something (e.g. nvidia jetson for video processing and AI)

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#67
post #30

Somewhat of an aside, since this article is about Flutter on embedded systems where React Native isn't even a consideration but... I've used both Flutter and React Native. Hands down, Flutter is the more enjoyable experience. Everything from the language, to the toolkit, to the IDE, to the final product, is just BETTER. React Native is a bloated, hacky, slow, garbage pile by comparison.

I can't figure out flutter. I see so many rave reviews. But I personally tried it and strongly disliked it. The toolkit and Android Studio run horribly slow - like really slow. And the output is basically this generation's flash. Some of the samples I tried on their gallery are mediocre. Very slight, but noticeable sluggishness. Some are just terrible; the 2d transformations moves at like 7fps. Plus there are so many…

[deleted]

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#68
One of the main bonuses of Flutter is also its underlying design - it really just needs a Canvas to render to and not much else. This makes it easy to port to other platforms (even web) and it allows you to have a very lightweight embedded system running a builtin app. This makes debugging easier as well, since you can just write the app on desktop, test in emulators and then deploy.

Our experience matches Sonys in that it works very well for embedded devices.

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#69
post #24

Earlier quoted context omitted.

Took me a while to get on board with Flutter, only really started enjoying it after I gave it a few goes. Coming to Dart after Swift and Kotlin feels like a big downgrade but languages aren't that important, as you said the whole environment is so much more streamlined than Android dev. I'm using it for Android only however and keeping my existing iOS app in Swift.

Off topic but regarding language design, what are some pros about swift that Kotlin hasn't?

I think he's probability talking about not wanting to rewrite existing apps which are working fine already in Swift.

Re: Graphical User Interface Using Flutter in Embedded Systems [pdf]

#70
post #65

We need source for that GTK+ example used to imply GTK+ is broken on Wayland. It could very well be PEBKAC, client-side decorations make being coordinate system aware much more important. If your code assumes everything's in drawable coordinates, it'll work in a top-level window on X11, but may break when Wayland w/CSD shifts things. That slide is potentially quite damaging to GTK+'s reputation, to not even provide a…

GTK doesn't need Sony to damage their reputation. Trying to force CSD on everyone is damaging enough.
Post reply on HN