
A Go Custom Flutter Engine Embedder for Desktop - nilsocket
https://github.com/Drakirus/go-flutter-desktop-embedder
======
jonathanstrange
One suggestion for improvement: Like so many other web pages for fancy new
frameworks and libraries, the github page does not really explain what Flutter
is and what problems the Go library can solve.

Can I make a cross-platform GUI with it (a) in the current state, (b) maybe
later? If so, what features does it support? How does it compare to Qt,
Lazarus, Sciter, Elektron, etc? Does it have internal drag & drop? External
drag & drop? Standard file and folder dialogs? Are widgets native or not (I
suppose not, but it should be clear from a glance at the page)? Which widgets
are supported? Does it have rich text support? Does it have OS-level clipboard
support? Does it have transitions or not? Is it themeable? Is it fast? How
large are executables built with it? Is it intended for ease of use or
somewhat complicated? Do I need to write in other languages (HTML, markup,
Javascript) to get things done or can everything be written directly in Go?

All of this is absolutely essential information. Nobody can reasonably decide
whether to use this GUI toolkit or not without getting answers to all of the
above question. So please, please explain in one sentence what Flutter is and
make a section with keyword features.

[Please don't take this wrong, I'm not a naysayer. This is meant as a
constructive criticism, not just of this page but of many similar ones. It
sure looks like an interesting project.]

~~~
ausjke
Very constructive indeed. For cross-platform GUI I have investigated
flutter(among others, flutter at the moment is really just mobile only, so
does Kivy)

It appears to produce a commercial quality cross-platform GUI, with not-so-bad
looking, your only choice is Qt, be it Pyside2 or Qt/C++. For me I decide to
use Pyside2.

~~~
Const-me
Depends on the complexity of the GUI you need and on other factors.

QT is OK if your GUI is very complex and you're targeting a desktop OS.

For simple GUI QT is just too big.

For GUIs without a desktop OS (mobile, embedded), QT is not a good fit either,
not enough mobile support, and their embedded license can be prohibitively
expensive.

I have positive experience building moderately complex commercial quality GUIs
on top of this:
[https://github.com/memononen/nanovg](https://github.com/memononen/nanovg)

~~~
ausjke
Actually QT GUI is pretty popular in embedded space(if you're not using
Android that is)

in my case I want to build a file manager and after some research I ended up
with Pyside2

------
giancarlostoro
TIL: You can somehow collapse things in GitHub README files. Seriously why do
I feel like a Markdown n00b all of a sudden. For those who don't know what I
mean, click on any of the OS' listed under the 'How to install' section. I
wish more README files on GitHub would sorta do this to some extent, some
README's are just so bloated with too much noise, let's say it's nice for a
FAQ section.

Anyway, back on topic: this is interesting, has anyone used GLFW for Go? What
if I don't have a C or C++ compiler, how does Go handle C / C++ dependencies?
Do you need everything required to build those too? I usually try to stick to
things Go can compile in native Go as much as possible so I'm not familiar
with this.

~~~
christophilus
It's done via embedded HTML, which GitHub flavored markdown supports. I didn't
know about the HTML details element, though. Pretty handy!

    
    
        <details>
          <summary>Click to expand</summary>
          <div>Hidden until expanded, no JS or CSS required!</div>
        </details>

~~~
Hixie
If it makes you feel better, I _invented_ `<details>` and didn't realize you
could do that in markdown...

------
divan
I wish Flutter itself has been written in Go.

Actually, I've written an article a few days ago fantasising on how it could
look like – "Thought Experiment: Flutter in Go"

[https://divan.github.io/posts/flutter_go/](https://divan.github.io/posts/flutter_go/)

~~~
rhodysurf
Looks cool but it ignores what Dart brings over everything else: Hot reload.

~~~
pjmlp
Ah that feature I was using during the 90s for GUI development, but apparently
was invented by Dart.

~~~
coldtea
Anything mainstream with actual jobs attached, or some bizarro language that
nobody used except for some research OS or something?

~~~
pjmlp
Common Lisp and Smalltalk had actual jobs attached during the 90's, and there
are still people getting paid to use those systems on enterprise settings.

LispWorks, Allegro, Cincom, GemTalk are still in business.

~~~
coldtea
Yeah, I thought so.

~~~
pjmlp
Ah so for you Common Lisp and Smalltalk are bizarre languages, good to know.

Please don't be shy and let us know about all those amazing Flutter/Dart
applications in production that outnumber any of those vendors, both in
customer base and business value.

Other than Ad Words that is.

I start with a couple,

\- Google's own ITA (CL)

\- Siscog traffic management solutions used across European train networks
(CL)

\- JP Morgan financial risk management (Smalltalk)

~~~
coldtea
> _Ah so for you Common Lisp and Smalltalk are bizarre languages, good to
> know._

I like both of them, and they're historically important languages, but are not
mainstream, and weren't mainstream even on their heyday.

I expected you to mean some post-Pascal Wirth-derived language though, or some
other such project.

> _Please don 't be shy and let us know about all those amazing Flutter/Dart
> applications in production that outnumber any of those vendors, both in
> customer base and business value._

Well, Flutter 1.0 was just announced on Dec 2018 (so like a month ago) and the
others had a 4+ decade headstart.

Still, some historical CL/Smalltalk apps aside (few enough to be enumerated in
"success stories" style posts), in 2-3 years there will be more Flutter/Dart
apps than CL and Smalltalk apps combined.

Heck, there are more Go apps in production "that outnumber any of those
vendors, both in customer base and business value", and that went 1.0 less
than 7 years ago.

If a language can enumerate it's success stories, it has already lost the
popularity game. I've read the same "success stories" (and more) in Lisp
forums and Smalltalk advocacy posts.

In fact, Dart before Flutter, was in the same boat "yeah, we use it in
Google's ad management, and company X uses it for Y". But I have no doubt it
will explode in popularity with Flutter.

------
christophilus
Interesting. I think we really need a good cross-platform GUI development
story. I wonder if Flutter will turn out to be it.

Does anyone know how Flutter fares when it comes to accessibility?

~~~
tobiaswk
I have made a couple of applications with Flutter. Mainly for Android and iOS.
I really think Flutter is great. It's my favourite framework currently. It
feels like a modern Android SDK and frankly how the Android SDK should feel
like. My "biggest" project currently is an alternative to the official
NissanConnect EV app for controlling Nissan electric vehicles. You can find it
here if you're interested;
[https://play.google.com/store/apps/details?id=dk.kjeldsen.ca...](https://play.google.com/store/apps/details?id=dk.kjeldsen.carwingsflutter)
It's also open source;
[https://gitlab.com/tobiaswkjeldsen/carwingsflutter](https://gitlab.com/tobiaswkjeldsen/carwingsflutter)

I think the Flutter team takes accessibility quite seriously;
[https://flutter.io/docs/development/accessibility-and-
locali...](https://flutter.io/docs/development/accessibility-and-
localization/accessibility)

~~~
danieldisu
Are Toast and Dialogs using the native variants?

EditTexts feel different, but as a user I don't see much difference..

Great job! and props to you for making it open source

------
javajosh
I am confused. The readme says, "Disclaimer: Despite being very similar in the
end goal, This project doesn't compete with this awesome one[1]."

But it _is_ competing, isn't it?

[1] [https://github.com/google/flutter-desktop-
embedding](https://github.com/google/flutter-desktop-embedding)

~~~
pknopf
I think the author is just saying that he doesn't care about the other
project. He is probably having fun. Let him do his thang.

~~~
javajosh
Hey that's cool, and I appreciate him acknowledging the other project. I would
suggest being a little more direct with this and say, "Yes this project has
the same goals as X, but I'm having fun and it scratches an itch I have, so
I'm gonna keep going!"

------
piokoch
Any idea why Flutter uses Dart language which is rather obscure. Wouldn't Java
or JavaScript be the better choice in terms of adoption?

~~~
hajile
Flutter sits half-way between those two. It's more structured than JS with
static types (and without all the JS oddities). It's also lighter syntax than
Java with type inferencing and real first-class functions (and not everything
has to be an object). The syntax is _very_ familiar, so picking up the
language is easy (Swift is syntactically quite similar).

Dart doesn't have the library issues like JS or the bloat like Java. In
addition, Dart is an ECMA spec (like JS), so there are no copyright issues
like with Java (other companies can even get committee members if they really
wanted to invest in the language).

Dart was designed to prevent all the dynamic coding techniques that make JS
slow (you can write very fast JS, but not in a normal style). Dart should be
able to perform about as well as Java (it could beat Java on some benchmarks a
few years ago).

[https://www.nikolaybotev.com/blog/dart-vs-java-the-
deltablue...](https://www.nikolaybotev.com/blog/dart-vs-java-the-deltablue-
benchmark/)

When you consider Java is multi-threading while the Dart implementations
generally are not, performance is quite similar in the benchmark game too

[https://benchmarksgame-
team.pages.debian.net/benchmarksgame/...](https://benchmarksgame-
team.pages.debian.net/benchmarksgame/faster/dart-java.html)

Off-topic, but for the pidigit test, Java just unloads all the work to a C
lib. How is that a Java test? Any language will be "fast" if they are actually
just leveraging highly-optimized C libs.

~~~
orbifold
Re: Java / C usage: Generally I think this is a valid approach. Most languages
use a C/C++ runtime for core data structures and abstractions. Go and Rust are
notable exceptions. Ideally as a developer you are able to extend this core
functionality in a seamless way. Python, Lua, JavaScript (the v8
implementation at least) and Java (JNI) are good examples where this is easily
possible.

~~~
hajile
I agree completely for day-to-day use, but the benchmark game is specifically
to test implementations. If you're offloading to C, then you're testing the C
implementation and the FFI implementation instead of the language
implementation. If you want to test those, then come up with a specific test
for that.

~~~
igouy
> … testing the C implementation and the FFI implementation instead of the
> language implementation…

No, not "instead-of" but "as-well-as".

------
anjanb
what does a "Custom Flutter Engine Embedder for desktop" mean ? I understand
what Flutter does. I understand what an Engine and Desktop is. But I can't
easily understand quite get the "". Is it a cross platform GUI toolkit/library
using Flutter for golang as @christophilus is hinting ?

~~~
dana321
TL;DR - converts a mobile app written with flutter.io to desktop, including
binary packaging.

From what i understand, it allows you to package your flutter application
(android/ios framework using dart) as a standalone binary on
windows/mac/linux.

------
sickcodebruh
What is everyone's take on the future of Flutter for Desktop? It's exciting to
think that it could be a viable alternative to Electron or Qt but the fact
that this is enabled entirely by third-party projects concerns me. Is Flutter
for Desktop something that has a future? Will apps built with these tools be
maintainable a year from now? At what point would you say it's safe to invest
time building and deploying projects built with it?

~~~
andrewgiang
Google is already experimenting with using flutter for desktop
[https://github.com/google/flutter-desktop-
embedding](https://github.com/google/flutter-desktop-embedding)

~~~
pjmlp
They also took care to stress multiple times last year, even during Q&A, that
only iOS and Android are their main focus.

------
pwm
Apologies for the semi-off topic question and it’s not directed towards your
project specifically, but why do Go projects always emphasise that they are Go
projects? I never see announcements like “Foo, a C# library to do Bar”. That
fact that it’s C# (or anythig else) will become apparent to anyone who cares
to look at the source. With Go projects it’s always emphasized that they are
written in it. Am I the only one who noticed this trend?

~~~
abtinf
A few reasons off the top of my head...

Go has very simple dependency management. A library written in Go generally
needs very little environment management and will often integrate easily with
a Go codebase. This is further enhanced with Go’s implicit inheritance model.

Go compiles to a static linked binary. A library written in Go usually can be
static linked as well with no system dependencies.

Go has excellent cross platform support. Unless a library makes system calls
(and sometimes even then), it will also be cross platform.

Go has a clean, simple, style. The lack of features like generics, operator
overloading, and constructors means you can look at the code and instantly
understand what it does. There is no spooky action at a distance because a
variable declaration turns out to be a complex function call. This makes it
much easier to understand the overall system impact of using libraries written
in Go.

Applications and libraries written in Go build very quickly. My experience
with other languages is that trying a substantial new package is a go-make-a-
sandwich level of inconvenience. Go libraries usually are ready to use as soon
as git clone finishes.

~~~
pjmlp
> Go compiles to a static linked binary.

By default. Go has supported dynamic linking for a while now.

------
arendtio
Didn't manage to get it running. Binaries crashed. Building from source was
successful but the result crashed during runtime too.

