Earlier quoted context omitted.
> Not sure if this will use AOT or JIT though. You can do either. You can compile a snapshot and run that on the JIT VM. This basically gives you faster startup because it doesn't have to do all the source parsing, resolution, type-checking, etc. but gives you the general runtime performance of a JIT VM (think V8 or the JVM). Or you can AoT compile your app all the way to native code. It's similar to how a shipped Go…
I was more referring what Flutter would do out of the box for desktop, but yeah, the question didn't mention Flutter. By the way, is there a good performance breakdown between Dart's AOT vs JIT? I've read some tweets/comments that JIT is still generally faster. Not including warm-up of course.
Flutter desktop shells
271–280 of 322 posts
Re: Flutter desktop shells
#272I'm a web developer, but I would like to learn Flutter. However, I haven't found a good resource to get started with. Everything seems to assume that you're a mobile developer already, except for a few very basic tutorials, which only half-assume that. Does anyone know of something that will take you from zero mobile knowledge to building some simple apps?
I come from a web background and wrote a month of blog posts getting started with Flutter: https://bendyworks.com/blog/a-month-of-flutter
Re: Flutter desktop shells
#273Earlier quoted context omitted.
> they're tools for aiding code comprehension by increasing the locality of code that has no business being distributed into completely different classes That's true for some kinds of code but not others. This is the classic Expression Problem [0]. For some things, it makes sense to keep all of the code for a single operation together. For others, it makes more sense to keep all of the code for a single datatype toge…
> There's a reason OO and UI have been married together for decades. People repeat this a lot, that OO goes with UI, but I don't think it's actually true, and I think e.g. React Hooks and immediate mode GUI in general demonstrate that it's not true. OO has been coupled with UI out of inertia, not because OO has unique strengths when applied to UI. Sum types are a primitive language feature, akin to product types, whi…
It is evidentially true. Thousands of successful applications and a billions of lines of UI code have been written in object oriented languages. It does work and it can't be that bad if that's continuing to happen even after the emergence of other alternatives.
Whether there are better ways is a good question, but I think it's pretty clear that you can ship good apps using OOP for your UI.
> React Hooks and immediate mode GUI in general demonstrate that it's not true.
I'm far enough into my career now — I've been doing UI programming of one form or another since the 90s — to have seen that pendulum swing several times. If there is a silver bullet, we haven't found it. It's probably not immediate mode GUIs because if it was, I wouldn't have seen game teams tear them out to replace them with something more retained several times in the 2000s.
What I think actually happens is that we forget the problems lurking in the solution we are not currently using. The grass over there gets greener and greener until we hop the fence and the cycle starts over. Incremental progress does happen. (I am not keen to revisit MFC any time soon.) But if a given concept (1) has been around a long time (2) has not already supplanted the alternatives, it's pretty unlikely that it is now an amazing solution today. The only time when that isn't true is when the surrounding technology context has changed since then.
For example, neural nets weren't a good solution for AI problems in the 80s because compute was too expensive and we didn't have a lot of data. Now that CPUs are cheap and everyone puts their entire life on the Internet, machine learning is here.
I haven't seen anything around UIs that to me looks like a significantly changed context, so I think we're still orbiting around retained-mode and immediate-mode as both having their own trade-offs and neither being a slam dunk.
> I think that "zen koan" you mentioned earlier is being very generous to subclassing. You want ADTs most of the time!
I really don't think that's true. Just look out there in the world. More code is written in languages doing subclassing every day than in languages with sum types. Despite the fact that sum types have been around since the 70s. You have to have a very uncharitable opinion of all of your fellow programmers to believe they've all been getting this wrong for decades. Heck, the software you are using right now to read this comment is sitting on a stack of several layers of subclass-based architectures! You've got JS running on top of the DOM inside a browser written in C++.
Sum types are really nice. But open-ended subclassing is too.
Re: Flutter desktop shells
#274I really want to like Flutter, but I someone really don't want to spend the time to learn Dart. I can't really quantify it--some mix of yet-another Proprietary Google Technology, yet another ecosystem, yet another X. I'm tired I just want to build stuff that solves problems.
Context: I was a Qt developer in a past life. The alternatives for cross-platform GUI are 1. Electron 2. Frameworks like C++/Qt C/Gtk 3. Bindings to (2) Using frameworks like Qt in native C++ sucks because C and C++ are just terrible languages for GUI development, even with the bolted on object systems and language extensions (Qt extends the C++ language). Using bindings to those frameworks is nice in theory because…
[1] https://github.com/MGWL/QtE5
D's team is doing an incredible job of matching C++ compiler specific ABIs, name mangling/etc -- just so D users can use C++ libraries (including templates) directly from D without loosing the features of the language.
[2] https://dlang.org/spec/cpp_interface.html
Here is also an older video of Walter Bright (2015) talking about the challenges that D is tackling
Re: Flutter desktop shells
#275Earlier quoted context omitted.
Indeed, Flutter would be much more compelling if I could use it with Rust or Swift instead. Dart really doesn’t interest me.
One nice think about Dart I've found is that compile times are very fast (faster than Go) and when editing in VSCode the code intelligence is instant and 100% accurate in my experience. Compare that to Rust where compilation speed is almost as bad as C++, RLS is slower than e.g. Qt Creator's clang lints, and has auto-completions so innaccurate that they are almost worse than nothing. Buuut.... I wanted to make a deep…
Sure, but does it do what you want? :) If that map contains pointers or other types with "interesting" assignment semantics, then your idea of a deep copy and that author of that type's idea may not be the same. Cloning is a surprisingly hard problem.
The two languages you compare to don't have GCs and prefer value semantics. But in most GC languages, everything is by reference and "copying the bits" isn't as meaningful of an operation.
I looked up how to deep clone maps in some other GC languages:
https://stackoverflow.com/questions/4157399/how-do-i-copy-a-...
Ruby: Top suggestion is to marhsall/unmarshall it.
https://stackoverflow.com/questions/5105517/deep-copy-of-a-d...
Python: Import a separate "copy" module. May have to implement some custom methods if you use user-defined objects in the map. The module isn't thread-safe. A comment recommends converting to JSON and back.
https://stackoverflow.com/questions/28288546/how-to-copy-has...
Java: No built in solution. Have to traverse the map yourself and do element-wise copies.
Re: Flutter desktop shells
#276Re: Flutter desktop shells
#277Earlier quoted context omitted.
QML is a declarative language; it has curly braces like JS, but that's about it. It also allows you to extend it with (some old, possibly noncompliant version of) JS, but the declarative markup is a distinct language.
That's like saying every YAML or JSON dialect is a new language. Sure, but not a full-fledged "programming language". QML is quite nice to work with, and well suited to the problem at hand.
Re: Flutter desktop shells
#278Earlier quoted context omitted.
iOS perf on Flutter has been broken for a while: https://github.com/flutter/flutter/issues/813 https://github.com/flutter/flutter/issues/28113 I wish the team would prioritize this more, but I guess that's Google for you.
We've done significant work on that particular issue in the past few months (primarily, caching compiled skia shaders). The issue wasn't iOS specific. If you have cases that are still problematic on the master channel (on iOS or elsewhere) please please please file a new bug with a test case so we can track down the issue.
Re: Flutter desktop shells
#279Earlier quoted context omitted.
I'm the PM for the Flutter developer experience. I'm currently digging into the next steps for our desktop experiment with Flutter and I'm very interested to hear how your xplat desktop app dev options fall short. What do you need from an xplay desktop app dev framework and toolchain? Chris Sells csells@google.com
Hi Chris, that's awesome! My (perhaps idiosyncratic?) priorities in order: - a ui programming model that is thoroughly thought-through. to be honest i think javafx fits this bill, it took long- hard-learned lessons from Swing but rebuilt things up from that learning. the scene graph api model imo is so ideal and then the way they build the widget/controls on top of that...creates a lot of flexibility yet remains simp…
Some issues (it's been some time so memory is a bit hazy):
- Lack of good documentation, both official and alternative (ultimately found a good reference book).
- Lack of customization on some widget, even compared to Swing (remember being really disappointed at how hard it was to modify the built-in tab-view).
- I really don't like the built not-quite CSS. Remember having trouble finding documentation for it. Also why a different language and not just code — like for the rest.
- Was really put off by some parts of the API design, even compared to Swing. Something that I remember is that there was a half-baked support for "theming" that isn't really usable nor used.
- This is much more debatable, and I won't wish ill on people who dismiss it, but it feels like it's completely out of the zeitgeist. I don't know if people doing unsexy jobs use JavaFX, but very people talk/write about it over the internet. Compared to Swing, the dearth of resources is staggering. It also created a lot of FUD that you can easily find if you google a bit. Don't use Swing cause it might be deprecated in favor of JavaFX (unlikely?). JavaFX hasn't really been updated nor hyped since Oracle took over, it's just rotting. IIRC it's not even bundled with the VM anymore, which is more headaches for distribution.
Only exception: https://tornadofx.io/ has some love in the Kotlin community.
- You have to link to different JavaFX jars for different platform, which makes any kind of Maven (etc) based dependency management a nightmare.