News for hackers. Stuff that matters.
Re:Flutter desktop shells by yc-kraln on Thursday April 25, 2019 @10:30AM (#19748518)
I 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.
Re:Flutter desktop shells by weberc2 on Thursday April 25, 2019 @12:07PM (#19749552)
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 you don't have to manually manage your own memory or use their type system, but in practice you still need to understand how their types bridge to your language's types and how their memory management bridges with your language's memory management (typically a GC). So while you're dealing with C types and manual memory management less frequently, when you do have to deal with it, it's more complicated than dealing with it in standard C/C++. So (3) is hardly better than (2).

Electron is probably the most cost-effective option, but it has its own problems (notably the high resource consumption that comes from bundling a whole web browser).

With those considerations in mind, learning a new high level language is the least of all problems, especially if the GUI framework is high-quality.

Re:Flutter desktop shells by mottosso on Thursday April 25, 2019 @12:22PM (#19749689)
> So (3) is hardly better than (2).

As someone developing GUIs with Qt bindings for Python daily, and has been for the past 8-9 years, I respectfully disagree.

Understanding of the underlying types and memory management is rarely an issue (e.g. once every 3 months), and when it is it's incredibly straightforward (e.g. maintaining reference to a window you've just created else Python garbage collects it for you).

Topics like these appear every now and then and remind me how there are still developers out there that still struggle to find the right combination of language and framework, some resorting to Electron because of assertions like this. This is a solved problem for my line of work - VFX and workflow related tools.

Re:Flutter desktop shells by devwastaken on Thursday April 25, 2019 @03:18PM (#19751561)
Python probably does eliminate a lot of problems of QT, much of its being the static typing of c++. However you are still bound by qt's internal widgets. Creating custom widgets requires reasoning about the renderer and qt's internal code.

The styling system of qt is also quite limited. Their 'css' is a small set that does not work well on everything.

HTML+CSS allows for creating almost anything, it's the same on all platforms if the renderer is right. It's seperate from code and easily viewable and debuggable within a browser program. I have yet to see anything similiar with Qt, or a style heavy program like Discord made in Qt without becoming spaghetti.

Re:Flutter desktop shells by pfranz on Thursday April 25, 2019 @04:28PM (#19752201)
I think Python is a poor choice for UI because it doesn't have a history of handling asynchronous things well. It leans on Qt a lot.

But I also disagree that the styling is quite limited. Yeah, css in Qt is pretty limited, but creating a custom widget doesn't require all that much intimate knowledge (depending how custom we're talking). You can tweak the behavior of default widgets easily, you can draw a completely new one by painting and following the rules (for sizing, redrawing, etc). For new interaction models you'll need to be more familiar with the internals, but that's the case if you're stretching the limits of any framework.

Qt works really well for cross-platform apps that adhere to the OS' style and behavior. I think way too many apps waste time and frustrate users by reinventing the wheel. QML seems to be their approach to UIs untethered to the host OS (I don't have any experience) and seems to be their focus for the past handful of years. Their Qt (Widget) demos always show a bunch of cool features I rarely use, but I do pilfer their code for examples when I need something.

For a Discord like example; Maya, Nuke, and Houdini were all originally developed using their own UI toolkits and have migrated to Qt while maintaining each of their distinctive behaviors. They are all cross platform and require relatively low overhead and high performance with heavily customized UI behaviors.

Maya: https://damassets.autodesk.net/content/dam/autodesk/www/camp... Nuke: https://www.foundry.com/sites/default/files/styles/teaser/pu... Houdini: https://d2wvmrjymyrujw.cloudfront.net/media/uploads/products...

These apps did fork Qt5 when they moved from Qt4 to Qt5, but it was mostly Qt4 regressions and did it in a way intending to contribute their changes back into Qt mainline.

Re:Flutter desktop shells by zerkten on Thursday April 25, 2019 @03:23PM (#19751613)
Putting aside the many resource problems with Electron apps, can you achieve the level of user experience that the Electron folks do?

I see Electron devs being asked to match the slickness of an existing website with similar delivery time and productivity. You don't seem to be able to get close to that with native APIs, API frameworks, or higher-level tools without a lot of work. When you remove these UI and delivery requirements then almost all other frameworks seem to have a fighting chance.

Re:Flutter desktop shells by jacobolus on Thursday April 25, 2019 @08:21PM (#19753777)
My experience is that every Electron app I’ve ever tried has a terrible “user experience” compared to average competently made native Mac apps. Their core UI widgets are non-standard for the platform and are full of bugs and inconsistencies. Latency is through the roof on all sorts of common interactions. They don’t integrate well with standard expected OS features/services. They burn massive amounts of system resources.

From my perspective as a user, Electron apps are for companies who don’t really care much about quality and are too cheap and lazy to write native apps. YMMV.

Re:Flutter desktop shells by userbinator on Thursday April 25, 2019 @10:31PM (#19754365)
Electron is basically "write a web app, package it with a browser, and call it a desktop app."

Ironically, Microsoft was one of the early adopters of the idea of "web technologies for desktop apps":

https://en.wikipedia.org/wiki/HTML_Application

Re:Flutter desktop shells by semireg on Thursday April 25, 2019 @10:57PM (#19754472)
I’m a company of one and I care about quality. I’ve shipped native apps for Mac, iOS and Android.

About a year ago I began work on Label LIVE, an Electron app to interface with thermal label printers. It’s not perfect but it fills a niche. It wouldn’t exist if it wasn’t for Electron. Check out the video or download and give it a try. http://label.live

Re:Flutter desktop shells by pfranz on Thursday April 25, 2019 @04:48PM (#19752369)
My argument is that the UI requirements are almost always nonsense. I hate launching a new app and trying to figure out a new interaction model or fighting a themes/fonts that fight my needs (font sizes, contrasting colors, etc). Basic stuff is often broken and there's a long tail, if ever, for them to get fixed. They're also the best candidates to break during an OS or other library update.

The whole reason OSes give you reusable components is so its easy to implement the conventions users are familiar with. Those are the things that are supposed to be fast and easy.

This likely violates the delivery timelines, but Maya, Nuke, and Houdini are all professional, heavily customized apps that were written in their own UI toolkits but were ported years ago to Qt and are cross platform.

Re:Flutter desktop shells by pjmlp on Friday April 26, 2019 @03:06AM (#19755397)
Easily with XAML/QML.
Re:Flutter desktop shells by networkimprov on Thursday April 25, 2019 @01:20PM (#19750330)
And there's the "localhost web app", where the app relies on whatever browser is installed.

Jupyter Notebook does this.

https://jupyter.org/

Re:Flutter desktop shells by edwinyzh on Thursday April 25, 2019 @01:02PM (#19750151)
FreePascal with Lazarus, the true cross-platform GUI framework is similar to Delphi's VCL or .Net's WinForms, it's been in active development for over a decade, and you compile your program into native machine code to a lot of platforms.

https://www.lazarus-ide.org/

Re:Flutter desktop shells by StavrosK on Thursday April 25, 2019 @04:49PM (#19752386)
Yeah but then you have to write every library you'll need, since the ecosystem is tiny.
Re:Flutter desktop shells by edwinyzh on Saturday April 27, 2019 @04:37AM (#19764544)
Of course the ecosystem is smaller than big names such as Python, but saying that you have to write every lib is exaggerated and simple not true.
Re:Flutter desktop shells by tapoxi on Thursday April 25, 2019 @01:57PM (#19750780)
Why is Electron so popular, but PWAs have seemingly failed to take off? Everyone was beating the PWA drum for a while, but I've almost never seen it implemented.

What's the reason, lack of discoverability? I'd rather run one Chrome instance than a dozen apps that use varying versions of Electron.

Re:Flutter desktop shells by skybrian on Thursday April 25, 2019 @02:10PM (#19750922)
My guess is that teaching users a different way to install a desktop app limits adoption.

The dependency on Chrome is a turnoff for people who don't already use Chrome. An Electron app just depends on the operating system (apparently), so the install is much like other desktop apps.

Re:Flutter desktop shells by devwastaken on Thursday April 25, 2019 @02:58PM (#19751403)
What matters to developers is not the same as what matters to users. Users: Does it run and do the things I want and It's obvious how to access it?

PWA's are a sandboxed environment, where devs do not have control of browser version, cannot modify chromium, and cannot bundle necessary binary code. Even Spotify bundles in faster JSON parsers, and probably a number of other things.

Re:Flutter desktop shells by kelnos on Thursday April 25, 2019 @04:31PM (#19752228)
I've given up on Electron-based apps and just use the corresponding webapp in a tab in Firefox (and if they don't offer one, I usually just do without the app). I got here because I got tired of running several extra browsers that ate up my RAM and killed performance.

An average user might not be able to connect the dots this way and realize what's going on with their machine. They'll just complain "my laptop is slow all the time and I don't know why". As developers, I feel like we have a responsibility to take better care of our users in this manner. Using a solution that will consume a GB or more of unshareable memory for something that doesn't need it (which is mostly everything) is a poor choice that puts the developer's needs (write-once-run-anywhere; faster, cheaper development time; fewer developers needed) over the user's.

So I fundamentally disagree that users only care that the app does the things they want, and nothing more.

Re:Flutter desktop shells by The_rationalist on Thursday April 25, 2019 @02:21PM (#19751049)
Re:Flutter desktop shells by judge2020 on Thursday April 25, 2019 @04:08PM (#19752022)
> Carlo locates Google Chrome installed locally.

Is this part of what Microsoft is doing with Chrome being pre-installed (via Edge)? I can't find a source, but I heard that using the existing chrome on the machine would reduce disk size for applications and possibly even allow them to share memory.

Re:Flutter desktop shells by thosakwe on Thursday April 25, 2019 @05:51PM (#19752836)
A lot of PWA features aren't implemented everywhere, and that depends entirely on browser vendors' decisions. i.e. a lot of API's are not supported in Mobile Safari, and in general, it takes a pretty significant amount of time for a Web feature to appear in all major browsers.
Re:Flutter desktop shells by Fnoord on Thursday April 25, 2019 @02:14PM (#19750967)
Because with Electron the "app builder" decides which extensions are ran. With a PWA, the user. Like 33% of all users use ad blockers, so its all about $$$. That (no incentive), and Electron was first...
Re:Flutter desktop shells by beojan on Thursday April 25, 2019 @12:11PM (#19749586)
You've completely ignored QML / Qt Quick here. That's the actual best option.

Though Qt Widgets in C++ isn't too bad if you use the designer instead of insisting on doing everything in code.

Re:Flutter desktop shells by weberc2 on Thursday April 25, 2019 @01:25PM (#19750396)
QML is in the category of "learning a new language", although last I tried it it was very much a work in progress. Can't speak to how good it is today.
Re:Flutter desktop shells by darpa_escapee on Thursday April 25, 2019 @01:56PM (#19750763)
Last time I played around with QML, it was basically Javascript.
Re:Flutter desktop shells by weberc2 on Thursday April 25, 2019 @03:24PM (#19751619)
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.
Re:Flutter desktop shells by switchbak on Thursday April 25, 2019 @04:11PM (#19752050)
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 by weberc2 on Thursday April 25, 2019 @06:56PM (#19753297)
Granted, it's not a general purpose programming language, but it has a comparable learning curve. Certainy many times steeper than YAML or JSON or other markup languages.
Re:Flutter desktop shells by rat9988 on Thursday April 25, 2019 @01:44PM (#19750617)
I heard that qml/qt quick had worse performance.
Re:Flutter desktop shells by beojan on Friday April 26, 2019 @02:04AM (#19755177)
Quite the opposite, since it's GPU accelerated.
Re:Flutter desktop shells by kickopotomus on Thursday April 25, 2019 @12:29PM (#19749765)
To add to this, if you like concept/portability/cost-effectiveness of Electron but don't want to mess with the Node/npm ecosystem, there are chromium embedded frameworks out there for Java and Python[0][1][2].

[0]: https://bitbucket.org/chromiumembedded/java-cef

[1]: https://github.com/cztomczak/cefpython

[2]: https://www.teamdev.com/jxbrowser

Re:Flutter desktop shells by LyndsySimon on Thursday April 25, 2019 @03:47PM (#19751820)
Thanks for this - I’d not heard of cefpython. It looks interesting, at the very least.
Re:Flutter desktop shells by kerberos84 on Thursday April 25, 2019 @12:31PM (#19749788)
Is java Swing/FX not cross-platfrom ?
Re:Flutter desktop shells by zerr on Thursday April 25, 2019 @03:30PM (#19751675)
It's with-platform :)
Re:Flutter desktop shells by JTenerife on Thursday April 25, 2019 @01:06PM (#19750185)
I've used PyQt some years ago and loved it. I can't remember any bigger issues at all. Super productive and fun.
Re:Flutter desktop shells by maga_2020 on Thursday April 25, 2019 @06:29PM (#19753085)
Another alternative, I think is D-language bindings to QT (or betterC which is a subset of D allowes to use D with C runtime library, while retaining D-s class system, templates and memory safety).

[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

[3] https://www.youtube.com/watch?v=IkwaV6k6BmM

Re:Flutter desktop shells by mises on Thursday April 25, 2019 @01:29PM (#19750450)
There are other options. Two I've used a little:

https://github.com/vurtun/nuklear

https://github.com/raysan5/raylib

Re:Flutter desktop shells by fmxexpress on Thursday April 25, 2019 @02:09PM (#19750911)
Embarcadero Delphi Community Edition lets you compile to Android, iOS, macOS, and Windows with it's FireMonkey framework using a single UI and single codebase. It's free for hobbyists. The paid version plus a third party component adds Linux desktop support as well.
Re:Flutter desktop shells by jasonhansel on Thursday April 25, 2019 @01:04PM (#19750166)
I really wish XUL had found uses beyond Mozilla -- IIRC it solved most of these issues.
Re:Flutter desktop shells by robin_reala on Thursday April 25, 2019 @03:36PM (#19751716)
You missed out webapps, which for a lot of systems are intrinsically better.
Re:Flutter desktop shells by rubber_duck on Thursday April 25, 2019 @10:38AM (#19748600)
I've tried dart back in the Angular 2 beta days with Angular Dart and after using it I have the exact opposite feeling about it.

It's a thing that solved a lot of very real problems that are still halfassed by NPM and Node ecosystem - package manager, build system, tooling around it - it was all a step above the quality of TypeScript/NPM/JS. Saner object semantics, good standard library, good tooling - it just got me to solving the problems I had. DOM wrappers it had were very nice, came with their own wrappers for Observable events (from standard library). They had proper async/await implementation working waay before TS.

Dart feels like a better TypeScript and for me the learning curve was really low.

One issue I had with it was using Dartium to debug the code - Chromium build that ran Dart VM naively to avoid transpiling to JS all the time - it was buggy as hell back then. Supposedly the dev compiler for JS is fast enough now that this isn't an issue - and in the case of Flutter you're running Dart natively so it's irrelevant.

I'm looking forward to doing a new project in Flutter this weekend - I've played with a hello world app when it was in beta and I was very impressed with the dev experience - hopefully it lives up to it in practice.

Re:Flutter desktop shells by stephenhuey on Thursday April 25, 2019 @11:16AM (#19749039)
I concur. I've never tried it with Angular, but I have written it for Flutter, and after a couple decades with JavaScript, I much prefer Dart (and it took no time to learn and I simply Google for the API as much or less than any other new language I learn these days). It was easy to start building a Flutter app with it immediately--not much of a learning curve to speak of. Whether or not I know it super well is beside the point--after a short time with it, I can use it productively and found it alongside the Flutter classes to be easier to get going with than Swift, Objective-C, Cordova, and even Rubymotion (Rubymotion is also pretty quick and friendly compared to the other options, but Dart/Flutter is a bit faster if you're a native mobile noob mainly because with Rubymotion you need to dig into the Apple APIs a bit, but with Flutter it's more abstracted).
Re:Flutter desktop shells by leppr on Thursday April 25, 2019 @01:23PM (#19750373)
> Dart feels like a better TypeScript

That's only if you use Typescript as a class-based OOP language. If you're more used to functional programming and prototypal inheritance, then Dart will bear no familiarity.

Due to its adherence to classical OOP, it feels way more like Java than Javascript.

As someone who never did any serious programing in those classical OOP languages, I struggled a lot to find the right abstractions to implement any kind of clean business logic. It was the first time I had to actually read up about "design patterns" and unironically consider writing factory factories.

It seems that due to Dart's rigidity and adherence to classical OOP, any library which needs to deviate from this paradigm has to hook into an additional build step (e.g. built_value for immutable types, has to use build_runner). That's an acceptable compromise for lib users, but adds a huge burden to actually writing those libraries, let alone incorporating those in your app's code.

Re:Flutter desktop shells by skybrian on Thursday April 25, 2019 @02:00PM (#19750822)
Yes, Dart is a fairly standard object-oriented language, but this exaggerates a bit. Dart has first-class functions (unlike Java) so you shouldn't need a factory-factory in the simple case. That's just a function that returns a function.

You might need other design patterns, though.

Re:Flutter desktop shells by SlowRobotAhead on Thursday April 25, 2019 @11:08AM (#19748954)
Ok, but to parent’s point... is it going to last? Is it yet another thing Google will abandon? Is it worth learning, because learning another language has a real cost imo. If Google walks at any point, does Flutter or Dart survive?

I’m with him, I want to like the idea, but I think the adoption has been slow and it doesn’t appear like it’s going to suddenly take off. I could be wrong, I just don’t see any successful indications yet.

Re:Flutter desktop shells by grayrest on Thursday April 25, 2019 @11:15AM (#19749021)
> is it going to last? Is it yet another thing Google will abandon?

It's apparently the primary language for Google Ads. As such, I expect it to be maintained as long as Google continues to sell ads and if they do move away from it you'll have plenty of warning.

Re:Flutter desktop shells by Reedx on Thursday April 25, 2019 @11:22AM (#19749093)
People keep saying that in Flutter threads, but it appears to be a small app for managing your ads? If it's just this, it wouldn't be hard to replace:

https://itunes.apple.com/us/app/google-ads/id1037457231?mt=8

https://play.google.com/store/apps/details?id=com.google.and...

Via https://flutter.dev/showcase

Re:Flutter desktop shells by skybrian on Thursday April 25, 2019 @11:36AM (#19749234)
Not just mobile. Dart (though not Flutter) is also used by the AdWords web app, which is quite enormous.

That said, Adwords used to be written in GWT. It's not impossible to migrate, but quite a big job.

Re:Flutter desktop shells by stephenr on Thursday April 25, 2019 @12:31PM (#19749785)
So, dart is safe until google moves onto the next thing it invents.

How’s GWT looking these days?

Re:Flutter desktop shells by Apocryphon on Thursday April 25, 2019 @12:37PM (#19749848)
It lasted for about eleven years which is not bad as far as frameworks go.
Re:Flutter desktop shells by SlowRobotAhead on Thursday April 25, 2019 @01:24PM (#19750384)
But this isn't a framework alone. It's a framework (flutter) and a language (dart). And at this point both are entirely dependent on each other, if I'm not mistaken.
Re:Flutter desktop shells by skybrian on Thursday April 25, 2019 @01:36PM (#19750536)
Looks like it occasionally gets an update, even though the GWT team moved on to j2cl.

https://gwt.googlesource.com/gwt/+log

Re:Flutter desktop shells by moocowtruck on Thursday April 25, 2019 @12:12PM (#19749597)
right but the money maker of adwords is not in dart at all, common lisp i think?
Re:Flutter desktop shells by skybrian on Thursday April 25, 2019 @01:49PM (#19750678)
I don't know what you mean? Google has many large ad customers who use the web UI to manage their campaigns.

Common Lisp was rarely used at Google when I was there, though it's a big company and you do see a little of everything, sometimes due to acquisitions. You might be thinking of ITA software, which is (was?) used for airline reservations.

Re:Flutter desktop shells by coldtea on Thursday April 25, 2019 @11:56AM (#19749444)
>It's apparently the primary language for Google Ads.

That's Dart, not Flutter.

And even so, Dart transpiles to JS for the Google Ads. They could switch to plain JS, or Typescript, or even move to a whole new implementation of Google Ads, and pull the plug.

They also used to use GWT, did that hold on?

Re:Flutter desktop shells by Apocryphon on Thursday April 25, 2019 @12:38PM (#19749854)
It did for nearly a dozen years.
Re:Flutter desktop shells by SlowRobotAhead on Thursday April 25, 2019 @06:04PM (#19752922)
Is that a good life for a programming language? It doesn't seem long compared to others.
Re:Flutter desktop shells by Apocryphon on Thursday April 25, 2019 @06:50PM (#19753254)
GWT lasted 11 years.
Re:Flutter desktop shells by rubber_duck on Thursday April 25, 2019 @11:15AM (#19749031)
I think it got enough adoption so far that it's not going away overnight and should be usable since people already published apps with it.

From my point of view learning Dart/Flutter isn't really a big investment so the downside of it getting abandoned soon is not as large as the payoff if it actually delivers - quality cross platform UI framework with great dev experience that I can use on my projects.

Re:Flutter desktop shells by pier25 on Thursday April 25, 2019 @11:34AM (#19749213)
AFAIK Flutter will be the primary SDK for writing apps in Fuchsia.

If this is true, and if the other rumors about Fuchsia replacing Android are also true, then I doubt Flutter and Dart are going anywhere.

Re:Flutter desktop shells by coldtea on Thursday April 25, 2019 @11:58AM (#19749462)
Except if Google gets bored with Fuchsia, like it has with tons of projects.

Heck, from what you say, it already got bored with Android -- if Fucshia is to replace it in say 2022, it means that Android just lasted around 15 years as a platform.

Re:Flutter desktop shells by japanoise on Thursday April 25, 2019 @12:39PM (#19749863)
15 years - so only four years less than MS-DOS ('81 - 2000) by which point it was considered hairy and terrible?

I'm no big fan of Google, but 15 years is plenty long enough. And really, Android is definitely struggling and showing its age by this point.

Re:Flutter desktop shells by Benjammer on Thursday April 25, 2019 @08:28PM (#19753810)
>Android is definitely struggling and showing its age by this point

I have the opposite viewpoint on this. I've worked on mobile the last 5 years or so, and dedicated native Android the last 2.5 years. The last year or two have been dramatic revolutions in the Android developer experience, from my perspective. Things like ConstraintLayout and full Kotlin support with ktx have opened up a new world for me compared to the state of the art several years ago.

Then you look at companies like Peloton using large form-factor Android devices in their core products, and Samsung DEx using Android as a seamless mobile<->desktop computer.

To me it seems like Android is just hitting it's stride. Who knows though, it's Google.

Re:Flutter desktop shells by bulldoa on Thursday April 25, 2019 @01:29PM (#19750449)
Out of curiosity, why is android struggling? What aspect of it needs improvement?
Re:Flutter desktop shells by cwyers on Thursday April 25, 2019 @02:33PM (#19751155)
There is no sense in which MS-DOS died in 2000.
Re:Flutter desktop shells by japanoise on Thursday April 25, 2019 @05:21PM (#19752626)
Wikipedia lists the last release of MS-DOS as version 8.0 in 2000, linking to the page for Windows ME.

This is what the comments above were alluding to, a "final release" before the project is abandoned. Installations still continue, in the same way there's probably places still doing the books on a C64, but it's no longer supported.

Re:Flutter desktop shells by coldtea on Thursday April 25, 2019 @02:38PM (#19751214)
I guess the parent means when (NT-Kernel based) Windows XP replaced Windows ME, which was the last version to run on top of MS-DOS (iirc).
Re:Flutter desktop shells by pier25 on Thursday April 25, 2019 @12:53PM (#19750039)
Android has plenty of issues and in the past 10-15 years Google has learned a lot from it and from Chrome OS.

I think it makes sense that it would go back to the drawing board and try to make something better from scratch.

Time will tell.

Re:Flutter desktop shells by pjmlp on Friday April 26, 2019 @03:08AM (#19755404)
Not at all, Fuchsia has evolved for a pluggable UI via Scenic.
Re:Flutter desktop shells by nradov on Thursday April 25, 2019 @11:40AM (#19749270)
In general it's just really disappointing that in 2019 the development frameworks we have available are still objectively worse in terms of developer productivity, reliability, and documentation than what we had with Microsoft Visual Basic or Borland Delphi back in 1996. I totally understand that these modern frameworks are superior when it comes to cross-platform compatibility and easy application distribution, but everything else seems like a step backwards, or at best sideways.
Re:Flutter desktop shells by osullivj on Thursday April 25, 2019 @11:43AM (#19749310)
Xerox Alto [1] had GUI, Smalltalk 72 dev env and TCP/IP networking in 1973. How much real progress has there been in software technology since then?

[1] https://en.wikipedia.org/wiki/Xerox_Alto

Re:Flutter desktop shells by coldtea on Thursday April 25, 2019 @11:53AM (#19749415)
Considering I can do extraordinarily more complicated tasks today, and a whole more of them, a lot.

But we also missed a lot of good stuff that we used to have.

Re:Flutter desktop shells by wtetzner on Friday April 26, 2019 @01:30PM (#19759876)
Is that an improvement in software, or just a result of hardware getting faster?
Re:Flutter desktop shells by coldtea on Friday April 26, 2019 @05:54PM (#19762106)
Very much an improvement in software too.

Compare a 1980 compiler with the optimizations GCC and LLVM make.

Or v8 with the best interpreter in 1990.

Or video codecs (almost non existent then). Or cryptography code (immensely improved). Or the capabilities of InDesign compared to a 1990 DTP. Or Photoshop compared to crude editors in the 80s. Or modern GCs versus crude 80s and 90s GCs. Or a modern DAW compared to 1990s midi apps...

Re:Flutter desktop shells by resoluteteeth on Thursday April 25, 2019 @12:58PM (#19750103)
If you want what you had with Visual Basic in 1996, you're in luck: you can just use C# with winforms, which is like a much better version of VB6.

Unfortunately, in 2019 cross-platform compatibility for native apps has only gotten harder (good luck supporting windows, mac, linux, android, and ios), which is why people tend to default to making web apps (or hybrid solutions using frameworks like React Native) rather than native apps, and this has perhaps also created a vicious circle by reducing interest in what cross-platform options there are (QT and javaFX).

Re:Flutter desktop shells by WoodenChair on Thursday April 25, 2019 @08:41PM (#19753874)
> which is why people tend to default to making web apps (or hybrid solutions using frameworks like React Native) rather than native apps

Not sure why people keep making the claim that native is dying. More and more people are doing their computing on their smartphones and the vast majority of the top 100 apps on both iOS and Android are built in Objective-C/Swift/Java/Kotlin. It seems to me like the main people pushing the whole web app/PWA renaissance are web developers who resent the fact that the web is dying.

Re:Flutter desktop shells by edwinyzh on Thursday April 25, 2019 @01:07PM (#19750197)
Check the Lazarus IDE (https://www.lazarus-ide.org/), it's very similar to Delphi with an integrated code editor, visual GUI designer and debugger - you can debug on the target platform including Linux, Windows, Mac, Raspberry Pi, and so on.
Re:Flutter desktop shells by winter_blue on Thursday April 25, 2019 @12:04PM (#19749520)
I learned Visual Basic 6 from a cousin when I was 8 years old. It was such a joy to use, and made me fall in love with programming. It was so intuitive to use as an 8 year-old. And while Dijkstra might disapprove, the Basic language of VB6 was really simple and easy to grasp as a kid.

The coolest part was distribution. Under the File menu, you had an option to build a .exe file. I would build it and put the .exe file on 1.44 MB floppy disk, and share my little VB6 programs with friends. Such wonderful memories!

Re:Flutter desktop shells by badsectoracula on Thursday April 25, 2019 @12:28PM (#19749748)
Dijkstra had issues with the older BASICs where the only way to control flow was with GOTOs and people flinging them all over the place. Visual Basic 6 (and QBasic before it) has Algol-like structures like subs, functions, while/repeat loops, etc so it would satisfy the issues Dijkstra had with older BASICs (if he'd dislike it for other reasons is another matter though).

Most people just repeat Dijkstra's headlines without having even read his text, let alone understanding it.

Re:Flutter desktop shells by specialist on Thursday April 25, 2019 @12:32PM (#19749799)
I know we're talking UI frameworks, but...

I think we lost something important with the shift from workgroup to client/server (especially ODBC).

I banged out a lot of dBase II, FoxBASE, MS Access (in-house) apps, back in the day. I've not felt as productive since. I miss it dearly.

Re:Flutter desktop shells by legulere on Thursday April 25, 2019 @03:41PM (#19751752)
Software based on that still exists and it’s a hell to maintain.
Re:Flutter desktop shells by Yetanfou on Thursday April 25, 2019 @04:48PM (#19752371)
To which I can reply 'come back in 20 years and tell me about your experience maintaining something based on npm and friends'. At least those old crufty systems had the good grace of not having a best-before date measured in weeks. They might lack many other graces but for maintainability there is something to be said for a modicum of temporal stability when it comes to development environments.
Re:Flutter desktop shells by TheOtherDave on Thursday April 25, 2019 @08:58PM (#19753962)
+1, would agree with again
Re:Flutter desktop shells by scroot on Thursday April 25, 2019 @04:12PM (#19752065)
One of the things that we sacrificed was what today we would call "end-user programmability" but which should really just be called "using a personal computer." Hypercard was a UI builder, a way for regular people to program beyond the strict limits of the software given to them, and a hypermedia platform whose "applications" could be easily distributed. To do most of the things that Hypercard could do on a personal computing system of the early 90s on a system today requires someone to learn a full fledged programming language
Re:Flutter desktop shells by mtkd on Thursday April 25, 2019 @05:25PM (#19752665)
Everyone of these posts I Ctrl-F the first Delphi comment

Can you imagine trying to explain to a developer in 1995 what you need to use to produce an app feature equiv in 2019

Re:Flutter desktop shells by danite on Thursday April 25, 2019 @11:11AM (#19748982)
To me Dart is pretty disappointing. Modern languages like Swift and Rust have shown the power of incorporating functional features like sum types and pattern matching. Dart just feels like the same sort of OO language we've been getting since Java became popular.

Edit: Also the continued existence of null in new programming languages is a baffling choice to me.

Re:Flutter desktop shells by markdog12 on Thursday April 25, 2019 @11:29AM (#19749157)
I don't blame you for being underwhelmed. The original goal was an easy to learn language. But since Dart 2.0 was completed, they are working on adding many other language features, including NNBD (Non-null by default).

https://github.com/dart-lang/language/issues

Re:Flutter desktop shells by 0x8BADF00D on Thursday April 25, 2019 @12:20PM (#19749667)
It’s just hard to be productive in Dart. The Flutter IDE and simulators were so resource intensive, they literally locked up my laptop the last time I tried using them.

Dart is objectively a terrible language to be productive in for app development. The abstractions provided by the language are clunky to use for window elements on a device screen. Don’t get me started on Material Design, either.

Swift, Objective-C/C++, or even Java is way easier to start building apps with, in comparison. The tooling is mediocre for Dart as well.

Re:Flutter desktop shells by filleduchaos on Thursday April 25, 2019 @05:51PM (#19752837)
I'm not sure what you mean by Flutter IDE and simulators, as the SDK has neither.
Re:Flutter desktop shells by munificent on Thursday April 25, 2019 @12:53PM (#19750040)
Hi, I work on Dart.

> functional features like sum types and pattern matching

"Functional features" means different things to different people. Dart (like most modern languages) has a lot of the core functional features: first-class functions, closures, lambdas, higher-order functions. Our built-in collection libraries are heavily oriented around functional-style transformations. You don't need an external library to map() and filter() your lists to your heart's content.

At the type system level, we also have function types, generic functions, and even first-class generic functions, which is a really unusual, powerful feature.

Sum types are a slightly different beast. Sum types are basically a functional language's answer to subtyping and runtime polymorphism. But object-oriented languages already have full subtyping and polymorphism using classes. There's a sort of zen koan here where algebraic datatypes are a poor man's subclasses and subclasses are a poor man's algebraic datatypes.

The way most multi-paradigm languages like Scala and Kotlin handle this is that sum types are just syntactic sugar for defining a little class hierarchy. Likewise, pattern-matching becomes syntax sugar for instanceof checks and field access. I like that sugar and hope we can add something similar to Dart, but I don't find it's omission to be a profound oversight. It makes some kinds of code nicer, but doesn't significantly affect the expressiveness or capability of the language.

> Dart just feels like the same sort of OO language we've been getting since Java became popular.

Yeah. The original designers of the language designed something very conservative. I think they wanted to make a VM with certain features (single dispatch, static class structure, no static initialization, etc.), and designed the safest language they could come up with to let them do that.

There is a lot of benefit to familiarity. I like classes and C-family syntax, and we see very clearly that Dart is really easy for people to learn and become productive in. We've done user studies where participants have been able to write correct Dart code without knowing what language they were using. It's hard to underestimate the value of that.

But there is also value in providing the modern tools people want in order to write clean, beautiful, correct, maintainable code. Dart has some catching up to do there. We're making a lot of progress. With Dart 2.0, we replaced the old unsound optional type system with a real, modern, expressive, sound static type system. It was a ton of work to do that while dealing with millions of lines of existing code.

We didn't get all the type system features we wanted, but we have a foundation we can build on now. The optional type system had some nice properties, but was effectively a dead end. When your types are optional, you can't hang any language semantics off them. That takes lots of features off the table: implicit conversions, extension methods, etc.

> Also the continued existence of null in new programming languages is a baffling choice to me.

I have always believed [0] that not having non-nullable types was a mistake in Dart 1.0. We are fixing it now:

https://github.com/dart-lang/language/blob/master/working/01...

There's a lot of work to do, but I'm really excited with the design. Unlike many other languages, we have something that becomes fully sound with respect to null errors. This means that once a program is fully migrated, a compiler will be able to take advantage of non-nullable types for performance optimizations. It will be quite a while before we get to the point where we can do this, but it's cool that that's on the table.

[0]: http://journal.stuffwithstuff.com/2011/10/29/a-proposal-for-...

Re:Flutter desktop shells by mixedCase on Thursday April 25, 2019 @01:33PM (#19750494)
> It makes some kinds of code nicer, but doesn't significantly affect the expressiveness or capability of the language.

Sum types and exhaustive pattern matching aren't about expressiveness, they're tools for aiding code comprehension by increasing the locality of code that has no business being distributed into completely different classes, and decreasing the cost of making changes by heavily reducing the amount of test code that needs to be written to make sure a closed set of options is handled appropiately; in OOP languages you can get this by using interfaces but to make use of it you'd have to use huge classes with methods pertaining to every usage of this closed set.

I would never willingly pick up another language that doesn't provide me with them after experiencing the productivity gains. I really like the direction Dart is moving towards and the steps taken demonstrate there's a team behind it that cares about correctness and productivity over being just a familiar Java-like, but this is the one hard blocker for me.

Re:Flutter desktop shells by munificent on Thursday April 25, 2019 @01:49PM (#19750680)
> 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 together. ML-style languages optimize for the former, and object-oriented languages optimize for the latter.

In practice, for the kinds of code Dart is designed for, the latter is a better fit most of the time. There's a reason OO and UI have been married together for decades.

Ideally, a language provides both styles so you can choose the one that fits your problem best. You see that now with languages like Scala. I hope we get there with Dart too.

I don't think it's fair to say that subclassing and method dispatch is objectively wrong just because it's a bad fit for some kinds of code. (Though, naturally, if it's a bad fit for the kind of code you need to write, then an OO language might be an objectively bad choice for you.) Class-based method dispatch is annoying for some things (God knows I've written enough Visitor pattern implementations over object-oriented AST class hierarchies), but it's really beautiful for others.

Being able to define a new widget class that bundles its rendering and interaction behavior together and can seamlessly extend a UI framework is something so natural that we take it for granted, but is very difficult to express in a language like SML. In fact, in order to do it, you'll probably end up doing a "design pattern" that reimplements something like v-tables at the application level.

[0]: http://journal.stuffwithstuff.com/2010/10/01/solving-the-exp...

Re:Flutter desktop shells by mixedCase on Thursday April 25, 2019 @02:04PM (#19750858)
Not sure if I gave off the wrong impression, but I am not a proponent of having only sum types and discarding hierarchies; as you well mentioned each is well-suited to specific usecases.

I do however disagree on subclassing being the best fit for UI code. "The Elm architecture" as well as the model presented by React functional components with hooks offer sets of tradeoffs that I at least have found are better for most of the development I find myself doing when writing (and particularly when maintaining) regular business frontends.

Re:Flutter desktop shells by xkapastel on Thursday April 25, 2019 @03:53PM (#19751864)
> 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, which absolutely no one rejects the value of. The sum/product analogy to arithmetic is compelling to me: they are the building blocks of complex types and deserve recognition. I think that "zen koan" you mentioned earlier is being very generous to subclassing. You want ADTs most of the time!

Re:Flutter desktop shells by munificent on Thursday April 25, 2019 @06:29PM (#19753083)
> People repeat this a lot, that OO goes with UI, but I don't think it's actually true

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 by malkia on Thursday April 25, 2019 @10:27PM (#19754346)
I wanna hear more open discussion about immediate & retained mode approach.

For one imgui gains traction again, especially among game developers, simply as it gives a lot for the ease of compile, understanding, compactness of code, etc. You can really build complex tools out of it.

But there is one nasty elephnant - the state, and imgui's approach is to hide it somehow - it used be behind your __LINE__ (or __COUNTER__, stack.line in some langs), or maybe part of your label points to your data, and if you've had the bad luck of having same labeled names, then there is yet another workaround, something special hidden in there.

All in all, it seems like it's missing a language feature, and we are suddenly grasping on all kinds of tweaks to achieve that.

That, .. and layout.. Layout is damn hard in immediate language. It works by magic, and then your app might crash, and lock. No I'm not kiddin...

Then again I'm but a simple user of UI toolkits, never fully written one.

Re:Flutter desktop shells by xkapastel on Thursday April 25, 2019 @08:17PM (#19753758)
First, I just want to say that I use Dart pretty regularly now and enjoy the language. I don't want to come across as overly negative; Dart is a solid language that's made web programming a lot more fun for me. So thank you, and everyone else on the Dart team for the hard work!

I just want to address these lines:

> Thousands of successful applications and a billions of lines of UI code have been written in object oriented languages.

> 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.

I agree that there's a huge amount of code out there using subclassing and not sum types. I'm not disputing the utility of subclassing; I just think the analogy to arithmetic is compelling, in that a closed sum type is a more primitive notion than open ended subclassing. It's easier to describe what a sum type is than what a subclass is; sum types have a smaller impact on a type system than subclassing. Pretty much any metric you can think of, sum types are just simpler, and more widely applicable. Any time you are describing a data structure, an ADT is immediately useful; subtyping may or may not be useful and is always more complicated. It's very difficult for me to understand how anyone could possibly say subtyping is on the same level as a basic operation like addition. Subclassing may or may not be nice but sum types are a primitive in a way that subclassing simply cannot be.

I don't know how to break it down more than this: we already have multiplication of types, and everyone accepts this as a primitive. Well, you can also do addition of types! Multiplication, addition, a neat little pair, just like algebra class[0]. Subclassing is way more complicated than this. That's it, that's a bullet proof argument as far as I'm concerned.

I suppose I do have an uncharitable opinion of mainstream programming languages, because I do think they've been getting this wrong for decades. It's nothing personal, it's just that industry has other concerns besides how clean their languages are. My browser being written in C++ is not an argument in favor of subclassing, though. You can build anything out of toothpicks if you're paid enough.

[0]: https://typedefs.com/introduction/

Re:Flutter desktop shells by munificent on Thursday April 25, 2019 @08:34PM (#19753834)
> I just think the analogy to arithmetic is compelling, in that a closed sum type is a more primitive notion than open ending subclassing.

I agree, sum types have a real beautiful elegance. But I often wonder if that's some sort of "appeal to mathematical aesthetics" fallacy. When I see, for example, painters deciding what brushes to use, I don't see them choosing brushes whose diameter follows the Fibonacci sequence or something.

Simplicity is a virtue because it lowers the cognitive load of a language. I don't know if mapping something to arithmetic tells us something actually profound about the productivity of a language feature, even if it gives me a little shiver of delight when I think about it.

> Any time you are describing a data structure, an ADT is immediately useful

For what it's worth, I often run into problems where I think I can map something to a nice set of ADTs but then it ends up still having ugly corners. As elegant as the language feels, when I use them in practice my code is still awkward sometimes.

> It's very difficult for me to understand how anyone could possibly say subtyping is on the same level as basic operation like addition, one of them is clearly a more basic idea.

Subtyping is set theory, and sets are obviously more fundamental than arithmetic! :D

> we already have multiplication of types, and everyone accepts this as a primitive.

Well, actually, lots of languages don't have tuples and records/structs aren't simple product types.

> I suppose I do have an uncharitable opinion of mainstream programming languages

I wasn't talking about languages I was talking about people. There are languages out there with all of the features you describe. Yet millions of people are choosing other languages. You must have an uncharitable view of those people if you presume that all of them are making a choice that goes against their own self-interest to be happy productive programmers.

Re:Flutter desktop shells by xkapastel on Thursday April 25, 2019 @08:39PM (#19753865)
> Subtyping is set theory, and sets are obviously more fundamental than arithmetic! :D

In case this wasn't clear, the "arithmetic" in question is being performed on sets (or types). For example, for sum types, the number of inhabitants of the type is the sum of the inhabitants of the components. All three of addition, multiplication and subtyping are operations on sets (types). So this was a strange thing to say.

> Simplicity is a virtue because it lowers the cognitive load of a language. I don't know if mapping something to arithmetic tells us something actually profound about the productivity of a language feature, even if it gives me a little shiver of delight when I think about it.

My real point is this: if you are deciding to build a language, as far as I'm concerned, it is very strange to add multiplication (why don't structs count as multiplication? I would say they do), then not add addition and instead add something much more complicated than addition. It just doesn't make any sense. It's not about the "productivity" (how do we measure this?) of the feature, it's about it not making any sense to do this! You add multiplication, you add addition, that's really all there is to it. I don't know, I guess I'm just repeating myself now and you won't find it convincing, but to me it's like trying to defend Roman numerals after being shown the Arabic system.

> You must have an uncharitable view of those people if you presume that all of them are making a choice that goes against their own self-interest to be happy productive programmers.

I don't think so at all. It's not really a fair choice; people choose languages in order to build things, and it's easier to build things in languages that other people are using. The full range of options is not obvious to every programmer (does the average webdev even know about ML?), and most of the time there are more important concerns than whether your language has a nice theory behind it.

Re:Flutter desktop shells by kitsunesoba on Thursday April 25, 2019 @01:07PM (#19750209)
Indeed, Flutter would be much more compelling if I could use it with Rust or Swift instead. Dart really doesn’t interest me.
Re:Flutter desktop shells by IshKebab on Thursday April 25, 2019 @04:58PM (#19752462)
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 copy of an object (a map of maps) in Dart, and one of the suggestions on Stackoverflow is to serialise it to JSON and then deserialise it. Eek. In C++ you just do `auto a = b;`. In Rust `let a = b.clone();`. How do they leave out such basic functionality?

https://stackoverflow.com/a/26616081/265521

Re:Flutter desktop shells by munificent on Thursday April 25, 2019 @06:42PM (#19753185)
> In C++ you just do `auto a = b;`.

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 by scalatronn on Thursday May 02, 2019 @07:04AM (#19806588)
As someone who uses dart everyday - it's quite nice language. All I'm missing is case / data classes, non-nullable types and pattern matching, but they're changing the language and all of those will eventually come. For now, I will use built_value and built_collections ;)
Re:Flutter desktop shells by IshKebab on Sunday April 28, 2019 @05:17AM (#19770152)
> your idea of a deep copy and that author of that type's idea may not be the same

Definitely true that they may have done something weird, but I think the idea of a deep copy is pretty easy to define: It should not be possible to modify the original object using only the deep copy. (Note that this doesn't preclude copy-on-write, etc.)

I think it is quite weird that so few languages (even GC'd ones) provide a proper solution for this. It's clearly a thing people want to do.

Re:Flutter desktop shells by pjmlp on Friday April 26, 2019 @03:12AM (#19755417)
Surely not faster than Delphi, oh well.
Re:Flutter desktop shells by Kiro on Thursday April 25, 2019 @11:57AM (#19749446)
What's wrong with null?
Re:Flutter desktop shells by coldtea on Thursday April 25, 2019 @12:01PM (#19749487)
Re:Flutter desktop shells by Kiro on Friday April 26, 2019 @08:49AM (#19756879)
Thanks. Stupid question but consider the following:

  entity = Entity.fetch(id)
  if (!entity) doSomething()
Entity.fetch returns null if it doesn't find anything. How would this work without null?
Re:Flutter desktop shells by ptx on Friday April 26, 2019 @02:10PM (#19760320)
You would still have null, but only when asked for and checked explicitly.

In Kotlin, for example, you mark something with a question mark to say that it can be null, which forces you to check for null before using it:

  val entityOrPossiblyNull: Entity? = Entity.fetch(id)

  if (entityOrPossiblyNull == null) {
      doSomething()
  }
  else {
      // The compiler knows that the variable is not null in this branch,
      // so this assignment is OK.
      val entityForSure: Entity = entityOrPossiblyNull

      doSomethingWithEntity(entityForSure)
  }
Re:Flutter desktop shells by wtetzner on Friday April 26, 2019 @01:44PM (#19760033)
The real problem isn't null itself, it's that in most languages that have it, null inhabits all types (or at least all reference types).

Different languages solve this problem in different ways. Many languages get rid of null entirely, and use option types in its place. Other languages, like Kotlin, fix it in the type system, by differentiating between e.g. String and nullable String (spelled String? in Kotlin) .

Re:Flutter desktop shells by coldtea on Friday April 26, 2019 @05:51PM (#19762080)
There are several ways. A popular one is an Optional type. Here's how Java does it: https://www.baeldung.com/java-optional
Re:Flutter desktop shells by losvedir on Thursday April 25, 2019 @12:45PM (#19749930)
I'll chime in as well that learning Dart is totally trivial. I don't like it all that much, since it really feels like your average Java-based language, but I learned it in a day or two while working on a Flutter app. Flutter is a great framework, and Dart gets the job done.

I'm not sure I'd learn Dart apart from Flutter, but if you just treat it as part of learning the framework (think learning ruby along with rails, or Vue's random HTML-esque DSL, which people do), the overall learning curve is not high.

Re:Flutter desktop shells by nova22033 on Thursday April 25, 2019 @10:37AM (#19748588)
yet-another Proprietary Google Technology

Dart is open source: https://github.com/dart-lang

It took me two minutes to find that using googles real proprietary technology..their search.

Re:Flutter desktop shells by tadzik_ on Thursday April 25, 2019 @10:45AM (#19748678)
Sure it is, but I can see why OP looks down on it – just like their web rendering engine, it may be open source, but it's Google holding all the cards and ultimately making all the decisions. It may be opensource now while it's useful for them, but it may end up just like Android over the years: more and more closed bit by bit.
Re:Flutter desktop shells by jonny_eh on Thursday April 25, 2019 @10:54AM (#19748784)
Is Google any worse than some "benevolent dictator for life" like other open-source languages?
Re:Flutter desktop shells by sametmax on Thursday April 25, 2019 @11:04AM (#19748903)
Yes. They drop projects all the time, have numerous conflicts of interest, and it's close to impossible to talk with them
Re:Flutter desktop shells by mda on Thursday April 25, 2019 @08:19PM (#19753766)
Except they don't drop many more projects all the time, Funny that people here argues it should drop Dart. I am glad they are sticking to it.
Re:Flutter desktop shells by asutekku on Thursday April 25, 2019 @11:00AM (#19748860)
Google has abandoned so many projects people (developers) don’t have that much of a faith in them anymore.
Re:Flutter desktop shells by ngrilly on Thursday April 25, 2019 @11:33AM (#19749200)
A lot of open sources are abandoned in general. Google has a good track record regarding the maintenance of their open source projects. Google has abandoned some proprietary products (Google Reader, Google +, etc.), but it says nothing about their open source strategy.
Re:Flutter desktop shells by asutekku on Thursday April 25, 2019 @01:15PM (#19750282)
For a public view it doesn’t really matter if it is proprietary project or not. They have tarnished their own reputation even at the development field with their actions.
Re:Flutter desktop shells by neves on Thursday April 25, 2019 @11:34AM (#19749214)
Sure Google is worse. A BDFL usually started it as a personal project, has deep interest in making the software flourish in the most places possible. Google interest is their bottom line, and it will base their technical decisions.
Re:Flutter desktop shells by simonh on Thursday April 25, 2019 @11:04AM (#19748905)
Benevolent dictators eventually die, or retire while corporate entities can exist for a very long time[1].

[1] https://en.wikipedia.org/wiki/Kong%C5%8D_Gumi

Re:Flutter desktop shells by yellowapple on Thursday April 25, 2019 @04:19PM (#19752141)
In the sense that the thing worse than "benevolent dictator for life" is "non-benevolent dictator for life".
Re:Flutter desktop shells by nova22033 on Thursday April 25, 2019 @11:33AM (#19749198)
Have people stopped developing Android apps?
Re:Flutter desktop shells by lima on Thursday April 25, 2019 @10:44AM (#19748664)
The litmus test is "will it survive if Google pulls the plug on it?", and I suspect the answer is "No".

But this is true of so many widely used open source projects.

Re:Flutter desktop shells by AnIdiotOnTheNet on Thursday April 25, 2019 @12:47PM (#19749958)
Sure, technically. The same way Chromium is technically open source. Funny how everything in the web browser world ends up how Google wants it regardless.
Re:Flutter desktop shells by nova22033 on Thursday April 25, 2019 @02:50PM (#19751319)
What's stopping you from forking and making changes you want?

Literally nothing

Re:Flutter desktop shells by saagarjha on Thursday April 25, 2019 @08:33PM (#19753827)
Nothing. The issue is that your changes don’t actually do much when the web moves on without them.
Re:Flutter desktop shells by zeusk on Thursday April 25, 2019 @06:01PM (#19752901)
until they come up with Angular-esque Dart 2.0 that is not backwards compatible and you're left maintaining their mess.

Forks are nice for small patches or development teams with a plan, no one outside Google cares enough about Dart fwik.

Re:Flutter desktop shells by jasonvorhe on Thursday April 25, 2019 @10:43AM (#19748660)
This is HN. Everything Google does is evil. Don't forget that.
Re:Flutter desktop shells by sbilstein on Thursday April 25, 2019 @10:38AM (#19748609)
If you are handy with Java, Typescript or Javascript, Dart is a breeze to learn. I didn't invest any time learning Dart to get productive with it while using flutter.
Re:Flutter desktop shells by egeozcan on Thursday April 25, 2019 @10:42AM (#19748649)
I was just about to write more or less the same comment before I decided to refresh the page.

I just started coding as if I was working with a version of Typescript.

I only Google from time to time for the standard library docs.

Re:Flutter desktop shells by Barrin92 on Thursday April 25, 2019 @01:57PM (#19750774)
Same here. it feels like a very generic algol family language, and if you're familiar with any of them it's almost trivial to pick up to the point where you can just sort of write it and figure things out as you go.

That was in fact the most pleasant things about Flutter for me, the language was a non-barrier.

Re:Flutter desktop shells by beckler on Thursday April 25, 2019 @10:58AM (#19748838)
for me there were only some syntactic sugar things I had to learn.
Re:Flutter desktop shells by StreamBright on Thursday April 25, 2019 @11:09AM (#19748960)
Yes but there is also the question why don't I learn React, Rust or Clojure instead of Dart. Am I going to be better of knowing Dart?
Re:Flutter desktop shells by expliced on Thursday April 25, 2019 @11:35AM (#19749226)
Dart is based on js and flutter is based on react. Going from js+react to dart+flutter will not be that difficult. Learn both.
Re:Flutter desktop shells by est31 on Thursday April 25, 2019 @10:53AM (#19748772)
So what's your alternative? Java Swing? Proprietary Sun (now Oracle) technology. Qt? Proprietary Trolltech tech. Electron? You're back on square one of using Google technology. And winforms, WPF, application kit, etc are all far more proprietary than Flutter.
Re:Flutter desktop shells by jcelerier on Thursday April 25, 2019 @04:17PM (#19752130)
> Qt? Proprietary Trolltech tech.

... is this a comment from 1997 ? Qt is licensed under both GPLv3 and LGPLv3 - and Trolltech as a company hasn't existed for more than a decade...

Re:Flutter desktop shells by est31 on Thursday April 25, 2019 @05:13PM (#19752562)
My comment was in reply to someone claiming that Dart was "yet-another Proprietary Google Technology". If Dart is proprietary then Qt is, too. Most likely by proprietary they didn't mean license but being controlled by a company, which both are. Dart is open source btw. as well. In fact, you could say that Dart is more open source because in Qt, proprietary ISV developers can't use the open source model if they want to not avoid having to give dynamic linking support and other LGPL obligations.

And trolltech is very alive and publicly traded in fact. It has just been renamed to Qt company: https://en.wikipedia.org/wiki/The_Qt_Company

Re:Flutter desktop shells by alexhutcheson on Thursday April 25, 2019 @04:39PM (#19752288)
Dart and Flutter are both BSD licensed, so presumably the discussion of "proprietary" is at least somewhat orthogonal to whether it has an open source license.
Re:Flutter desktop shells by yellowapple on Thursday April 25, 2019 @04:27PM (#19752193)
Tk is a pretty solid option nowadays, and it's wonderfully cross platform. Thanks to TTk, begone are the olden days when Tk apps stuck out like sore thumbs (the look and feel ain't an exact match even today, but nowadays the differences are more subtle). It also works with a remarkable number of languages. The only reason why I've reached for Qt instead lately is because the last couple projects I've done required an embedded browser window (i.e. because they're wrapping some web-based application) and Tk lacks modern options on that front (though I'd love to fix that at some point).

GTK+ and wxWidgets are other viable and popular choices for cross-platform desktop GUIs.

Re:Flutter desktop shells by s_y_n_t_a_x on Thursday April 25, 2019 @10:59AM (#19748850)
ReactXP (https://microsoft.github.io/reactxp/) uses TypeScript and targets mobile and desktop platforms using native controls, not emulated controls.

While Flutter doesn't work yet for desktop or web, ReactXP already works for these environments, and is used in the new Skype for Web.

Windows support is done and targets W10, Xbox, and Windows Mixed Reality. MacOS support is experimental, but mostly working. Linux currently needs an Electron wrapper.

Re:Flutter desktop shells by skinnyasianboi on Thursday April 25, 2019 @10:58AM (#19748836)
Kotlin native/multiplatform projects is the answer
Re:Flutter desktop shells by mr_tristan on Thursday April 25, 2019 @11:24AM (#19749114)
It's _very_ early, though, as well.

There's not much of an ecosystem for multiplatform yet for desktop projects at all. For macOS you have a way of "making a framework you can use" and that's about it.

There is a lot of promise, though, in the mobile space: https://touchlab.co/touchlab-square-kotlin-multiplatform-col...

My sense is that as the mobile multiplatform space gets ironed out, the desktop space will benefit.

Though generally speaking, Kotlin/Native has a _much_ lower level of "institutional" risk, since the Kotlin approach doesn't subvert the control Apple or Microsoft have over their platforms. Flutter, on the other hand, seems to abstract it away.

Re:Flutter desktop shells by expliced on Thursday April 25, 2019 @11:09AM (#19748961)
You still need some gui library/framework. What crossplatform options do you have?
Re:Flutter desktop shells by Bahamut on Thursday April 25, 2019 @11:01AM (#19748874)
Kotlin is by JetBrains.
Re:Flutter desktop shells by rhodysurf on Thursday April 25, 2019 @01:54PM (#19750749)
Its not though.. the only IDE is CLion which does not have a free version. Thats a showstopper for a lot of people.

Its also pretty slow compared with other native solutions.

Re:Flutter desktop shells by ptx on Friday April 26, 2019 @02:22PM (#19760435)
It actually works really well in IntelliJ Community Edition. There is a template for creating a new Kotlin/Native project, the auto-completion works and there is even unit testing support! Things have come a long way since the early days of compiling your own cinterop stubs and figuring out APIs from the generated wrappers. :)

If you want a debugger you need CLion, though. And the compiler is really, really slow – but they seem to be working on benchmarking things recently, so presumably it will be improved.

Re:Flutter desktop shells by scalatronn on Thursday May 02, 2019 @07:05AM (#19806591)
I'm tired of long compilation and failing compiler ;)
Re:Flutter desktop shells by brylie on Thursday April 25, 2019 @11:04AM (#19748898)
What are some of the strengths you enjoy about Kotlin?
Re:Flutter desktop shells by supergilbert on Thursday April 25, 2019 @11:01AM (#19748872)
Exactly. Kotlin for all platforms is the best option for the future.
Re:Flutter desktop shells by edwinyzh on Thursday April 25, 2019 @01:09PM (#19750228)
No mention of Lazarus?

Check the IDE: (https://www.lazarus-ide.org/) and the cross-platform apps built with it: http://wiki.freepascal.org/Lazarus_Application_Gallery

Re:Flutter desktop shells by krageon on Thursday April 25, 2019 @10:56AM (#19748818)
The done thing in Java now is JavaFX, and the last time I bothered to work with it (more than a year ago) I remember really liking it. Of course, to me any kind of web tech is a complete non-starter so I am comparing this to using Tcl and WxWidgets.
Re:Flutter desktop shells by lmm on Thursday April 25, 2019 @11:01AM (#19748876)
Funnily enough Tklets worked on the web before even Java or Flash.
Re:Flutter desktop shells by axaxs on Thursday April 25, 2019 @10:35AM (#19748564)
You could say the same about Objective C, and to a lesser extent Swift. While I respect your opinion, and somewhat agree on it being a weird choice to use Dart, I think there is value in learning it iff it becomes the ubiquitous way to write apps for mobile.
Re:Flutter desktop shells by pjmlp on Thursday April 25, 2019 @12:25PM (#19749708)
Objective-C and Swift help sell Apple's hardware.

Besides Ad Words, there is very little being sold by Dart.

Re:Flutter desktop shells by axaxs on Thursday April 25, 2019 @12:26PM (#19749723)
How so? Do you think apple sales would drop if they switched all development to using a more mainstream language?
Re:Flutter desktop shells by pjmlp on Thursday April 25, 2019 @01:34PM (#19750508)
Naturally, who would port their apps without a monetary value behind it?

Plus how much money would it cost to replace all the existing software stack?

Re:Flutter desktop shells by IshKebab on Thursday April 25, 2019 @05:01PM (#19752474)
Besides the thing that provides nearly all of Google's income...
Re:Flutter desktop shells by rhodysurf on Thursday April 25, 2019 @10:42AM (#19748644)
Is it really hard to learn a new language tho? Its not even a hard one, its like a if you mashed java and javascript together. Its pretty simple to pick up.
Re:Flutter desktop shells by phkahler on Thursday April 25, 2019 @12:47PM (#19749957)
>> I'm tired I just want to build stuff that solves problems.

I can relate to this. While that's always been part of my motivation, there were other things in play too, like wanting to do something "better" than before. Or using new methods. Or applying X to Y just because. Now, as I get older, I don't want to deal with overly complicated shit, excessive dependencies, or unnecessary bling.

As an example in the GUI space I keep wondering why GTK 4 is getting a scene graph. I've done GFX programming for years and scene graphs are almost never the right answer. Why does a GUI toolkit even need one? No GUI should be that complex. No GUI toolkit should provide one for applications - that's not their job. Don't get me wrong, GTK is my preferred toolkit (in spite of gnome), I just think people keep extending things for the wrong reason. If it works and isn't broke, don't change anything. If the world changed and wants multi-touch, fine, add that. But don't go around doing your science experiments in projects that lots of other people use as infrastructure or building blocks.

Change is constant. Real progress is slow.

Re:Flutter desktop shells by jcelerier on Thursday April 25, 2019 @04:16PM (#19752112)
> I've done GFX programming for years and scene graphs are almost never the right answer.

Interesting, why would you say that ? I saw a bunch of projects go from "more-or-less smooth at 1080p" to "buttery 120fps smooth at 4k" by migrating to UI toolkits with a scenegraph architecture.

Re:Flutter desktop shells by coldtea on Thursday April 25, 2019 @11:52AM (#19749400)
>I really want to like Flutter, but I someone really don't want to spend the time to learn Dart.

If you have the time to spend to build an app, learning Dart to do it will be the less of your concerns.

Re:Flutter desktop shells by edwnj99 on Thursday April 25, 2019 @11:01AM (#19748875)
I would've preferred dart to be more opinionated like golang but its not, you can literally write in almost any style and one advantage of that is if you have experience with any modern language, you should be able to write dart with ease.
Re:Flutter desktop shells by mraleph on Thursday April 25, 2019 @02:12PM (#19750944)
Dart was actually really opinionated right from the start. Type annotations that has no bearing on execution; reified generics and dynamic typing at the same time; mirrors and noSuchMethod... even having semicolon - as opposed to not having it. These are all strong opinions about language design. They might not align with what is considered "modern" these days, but they are all opinions nevertheless.
Re:Flutter desktop shells by dodyg on Thursday April 25, 2019 @12:12PM (#19749590)
This type of "why Dart" moans surface every time anything related to Flutter is announced. It's weird. Stop it. It's useless.
Re:Flutter desktop shells by skalkin on Thursday April 25, 2019 @02:48PM (#19751299)
I was productive in Dart after few hours, it really fells a lot more solid and thought-out compared to JS or TS. Everything just works immediately and as expected, and the language is super simple yet expressive.
Re:Flutter desktop shells by logrott on Thursday April 25, 2019 @11:02AM (#19748879)
Not a good attitude to have. If you try a Hello World in Flutter you'll see it's amazing. Don't knock on it until you try it.
Re:Flutter desktop shells by cbhl on Thursday April 25, 2019 @01:54PM (#19750748)
One of the things I love about React and React Native is that it's possible to use them from "plain old JavaScript" (React.createElement and friends). And I work at le Goog; my org has mandated Polymer 2+TypeScript for all new desktop web code.

Sure, maybe in production you want to use JSX and/or TypeScript, but learning a new language and a new framework together is overwhelming, period. Pedagogically, it makes it hard to conceptually separate what is a language feature and what is a framework feature. (To this day, I still have trouble separating what parts are Ruby and what parts are Rails.)

Re:Flutter desktop shells by mda on Thursday April 25, 2019 @12:03PM (#19749515)
This is a weird comment, Dart is open source and evolves as well, like Swift from Apple, Kotlin from Jetbrains, Typescript from Microsoft etc. What is the difference? Or you don't like any of these?
Re:Flutter desktop shells by jeffhuys on Thursday April 25, 2019 @11:52AM (#19749392)
I would say get used to it. I don't mean that in a degrading way or something, but we're developers. Until the day you retire you will need to keep up with technologies.
Re:Flutter desktop shells by burtonator on Thursday April 25, 2019 @11:45AM (#19749325)
I think Typescript is going to obliterate Dart... it's really amazing.

I love working with it more than any other languages I've worked with.

Python, Java, Go, Javascript, Lisp...

I think there's some combination between it being typesafe, amazingly expressive, dynamic and also productive because you're on the web platform.

Generics might be a bit much for some Javascript people because it's like a whole language in and of itself but it's worth it IMO.

Re:Flutter desktop shells by Dig1t on Thursday April 25, 2019 @03:20PM (#19751576)
I completely agree. I use Flutter a lot, and even after getting used to Dart, I really hate it. It's not a fun language, and I just can't understand why they chose to use it.
Re:Flutter desktop shells by avinium on Friday April 26, 2019 @03:32AM (#19755480)
As someone in the process of picking up Flutter/Dart, the upside of Flutter significantly outweighs the downside of learning Dart.

Flutter is the best-designed framework I've encountered (whether mobile, front-end, back-end or machine learning).

The only downside is Dart, and while it's annoying, it's also very minor.

Re:Flutter desktop shells by christocracy on Thursday April 25, 2019 @12:56PM (#19750088)
Dart isn’t difficult to get productive with in a couple of days if you have experience with Java or Typescript.
Re:Flutter desktop shells by vijaybritto on Thursday April 25, 2019 @10:45AM (#19748683)
You dont have to learn it for the sake of learning it. You can learn and use when there is the need!
Re:Flutter desktop shells by nilsocket on Thursday April 25, 2019 @11:01AM (#19748877)
Almost every big open source project is going to be unsustainable, if it isn't supported by a company.

Few exceptions do exist, where several companies support out of there need and importance.

Re:Flutter desktop shells by spaceheretostay on Thursday April 25, 2019 @11:12AM (#19748992)
I'm personally excited about Flutter largely because it seems the preferred development environment for Fuchsia. People will complain that Google kills projects too soon and too often, but I feel like Google has an MO and when you figure it out you can guess which products will live and die.

I think Fuchsia and Flutter are Google's primary likely plans for the future of their consumer platforms. I don't really know why, it's just a feeling.

A lot of it comes from Google planning 10+ years out a lot of the time. Reader was a mistake to kill, but you could see how Google management thought it would not be a widely useful product in the long-term future (though let's repeat, they were wrong).

I think Flutter+Fuchsia has that 10+ year plan to it. I'm on board with Dart because it seems likely to be a major ease on development along with a likely promising future.

Re:Flutter desktop shells by pjmlp on Friday April 26, 2019 @03:14AM (#19755425)
Sorry to disapoint you, Flutter is now one option in Fuchsia among others.
Re:Flutter desktop shells by Dirlewanger on Thursday April 25, 2019 @04:44PM (#19752345)
I'm convinced it's going the Google Way™ (i.e. will be abandoned) in 5 years tops. This company has repeatedly shown it can't commit to products that are slow burns and not entirely obvious where revenue may come from. It's part of the reason why I see Go as a fad too.
Re:Flutter desktop shells by mattlondon on Thursday April 25, 2019 @11:47AM (#19749348)
Same here - its a real shame they picked a niche language for this rather than the now universal Typescript like everything else.

As such, I'll pass since this feels like a dead-end just like polymer was. It felt like polymer had the same hype cycle as flutter - was going to make development so much easier/faster/less error prone etc. It is now a semi-abandoned legacy hulk of a project that people hate working with (anecdote I know, but that has been my experience) because its totally different and alien to how people are used to working, for no/little obvious benefit apart from "this is from google! its got to be good!"

I wish Google would just accept defeat and support existing common tools rather than suffering from "not-invented-here" syndrome and create something totally different and non-compatible, rather than contributing to the existing industry de facto standards to make them better. There may still be a few "google-scale problems", but UI frameworks and HTML libraries are not them.

Re:Flutter desktop shells by sroussey on Thursday April 25, 2019 @12:48PM (#19749982)
You compile ahead-of-time (AOT) with TypeScript? Where can I get details on this?
Re:Flutter desktop shells by marton78 on Friday April 26, 2019 @02:55AM (#19755351)
Re:Flutter desktop shells by winter_blue on Thursday April 25, 2019 @11:47AM (#19749349)
This is exactly how I feel. The lack of freedom to choose your own language is appalling. I don't want to be locked into a single language. If they targeted the JVM platform instead, would have the choice of Clojure, Scala, Kotlin, JRuby, etc. Also, targeting the JVM makes a lot of sense of Android, since ART complies JVM bytecode down to super-efficient machine code (at installation). I was really disappointed by Google's decision to push those wanting to use Flutter to learn Dart. Fortunately, the Flutter Windows and Linux libraries provide C and C++ wrappers[1]; hopefully these become preeminent, and result in other language bindings for Flutter. I've been tired enough with the web being JavaScript-dominated for a long time that the rise of options like TypeScript, ReasonML, Elm, etc. (in industry) felt like a breath of fresh air to me.

[1] https://github.com/flutter/flutter/wiki/Desktop-shells#c-wra...

Re:Flutter desktop shells by raquo on Thursday April 25, 2019 @04:18PM (#19752132)
WASM would be a much more suitable platform for Flutter since it's more portable (works on the web) and better matches Flutter internals (C++ can be compiled to LLVM and through that to WASM).

Not to mention that Google might be a bit sensitive to anything JVM / Oracle right now, given the lawsuit they lost.

Re:Flutter desktop shells by wstrange on Thursday April 25, 2019 @01:29PM (#19750443)
The JVM doesn´t run in a browser or on iOS. Both of these are targets for Flutter.