5 ms·
I've been playing with Flutter recently and their approach may dominate UI toolkits in the future. They took low level rendering API from Chrome (Skia) and bui
by krzat 9y ago
I've been playing with Flutter recently and their approach may dominate UI toolkits in the future.
They took low level rendering API from Chrome (Skia) and build simple but fast layout engine around that. Already works pretty well on mobile and there are some experiments on desktops:
https://github.com/rxlabz/flutter_desktop_markdown_reader https://github.com/rxlabz/flutter_desktop_markdown_reader
Rust people could maybe do the same with Webrender from servo.
- hardwaresofton 9y agoThe only downside to Flutter is the immense amount of effort to bootstrap an approach like that. I think it made sense for Google since they have the resources and free engineers to throw at the problem, but for more resource-constrained project I'm not sure it's tenable. Nevermind the fact that the ongoing maintenance burden is also a thing -- using iOS7 UI elements on iOS9 is probably a non-starter for a large part of the audience.
- k__ 9y agoAFAIK they did it because when they started there weren't any viable alternatives. Today they would probably invest their time in React-Native or something.
- mnem 9y agoThe downside of custom rendering engines is that they’re rarely as efficient as the standard platform affair. While that’s less impactful on desktop, it can be a killer for batteries on mobile devices and laptops.
- Const-me 9y agoStandard platforms on desktops are decades old and therefore render stuff on CPU. Theoretically, a GPU-centric custom engine can be much more power efficient.
- pcwalton 9y agoThat's not true. There's no magic sauce that the platform vector graphics library has: it's a userspace library like any other (well, except for GDI, but nobody wants to use that anymore). It's absolutely possible to improve upon it.
- mnem 9y agoGenerally platforms providers optimise graphics highly for their own platform. A generic cross platform library rarely invests similar effort for every platform it can run on. The usually applies more to mobile however - most desktops require even the platform providers implementation to be somewhat generic. The other part of the inefficiency is more to do with what the cross platform engine is internally guaranteeing vs what the platform providers will guarantee. For example, let’s say skia here always runs at 60fps. Great, and a lovely user experience - but does it then respect low power mode in iOS or Android, or does it just continue at 60fps eating away through battery power because it’s geared to the common case of all platforms? I’d love this to work, but years of the reality of using cross platform renders has made me quite skeptical of their ultimate benefit to the user. They’re great for developers though - but that’s the wrong way round for convenience usually, I think.
- LeoNatan25 9y agoHow is that different from all the other 20+ year old UI toolkits out there? What is so special here, other than “google”?
- krzat 9y agoFlutter is a lot like Electron, but faster. Also, arguably easier to use. They don't have to support all of the backward compability garbage that HTML/js has.
- LeoNatan25 9y agoqt, gtk and Xamarin / Mono are also "like" Electron but faster and easier to use. Why is the Google fad somehow more important or impressive than those already proven technologies?
- krzat 9y agoPopularity of Electron proves that they are not easier. Even Microsoft wrote VS Code in it. I don't care much about Google but they did pretty good job with Flutter: 1. No special designer needed, you do everything in code. That means everyone can use their preferred editor. 2. Hot reload - you change something and it changes in the running app. 3. Headless testing - No need to own iOS/Android device to test iOS/Android UI. 4. Nice tooling - autocompletion, formatting, etc. Everything done via command line, with optional support for IDE. 5. Extensible - very easy to write your own widgets. There is nothing special about provided components. 6. Platform agnostic - "native look" of Qt/GTK is a lie, they still look off. To me it just triggers uncanny valley vibe. Not to mention that they implement native look from 5 years ago or more. And completely useless on mobiles. Flutter looks the same on every platform unless specified otherwise. Way less platform specific bugs.
- LeoNatan25 9y agoElectron is popular because web "developers" can't be arsed to learn anything other than JS. It's as simple as that. They live in the lie they tell themselves that JS development is easy, when it really isn't, tooling is disastrous, IDE is nonexistent, apps look bad, etc. They are just happy they manage to run something "desktop". All those things you mentioned are true of Xamarin. qt uses actual native controls, so not sure what is a "lie" about it; if something is not behaving correctly, it's a bug, and you open an issue. GTK does look bad and out of place, I agree with that, bug so does Electron. If it's between GTK and Electron, I'll take a proper GTK application. Looks the same = looks bad on all platforms.
- Keyframe 9y agoThis looks promising, but Google has a tendency to abandon technologies, so who knows? I've been looking at something like Electron, but more lightweight. I'd like to build a UI around a custom C graphics engine (OpenGL/DirectX/Metal/Vulkan) for something like a level editor. Electron isn't suited well for that.
- krzat 9y agoYou can copy some of their solutions. I always did my game UI by manually setting positions and sizes, but it should be easy enough to implement their basic widgets - Padding, Column, Text, Align, etc.