11 ms·
A Go Custom Flutter Engine Embedder for Desktop
- giancarlostoro 8y agoTIL: 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.
- detaro 8y agoYou can use HTML in markdown, which is what was done here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de...
- tilpner 8y agoThis also works for comments: https://github.com/dear-github/dear-github/issues/166#issuecomment-252282315 https://github.com/dear-github/dear-github/issues/166#issuec...
- christophilus 8y agoIt'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>
- masklinn 8y agoIt also works in issue/PR descriptions and comments. As far as I'm concerned that's where it's most convenient as it lets you e.g. post big screenshots or graphical rendering of profiles (flamegraphs) without taking up screenfuls of space and bothering everybody.
- Hixie 8y agoIf it makes you feel better, I _invented_ `<details>` and didn't realize you could do that in markdown...
- laumars 8y agoThe markdown in there looks like some horrible HTML / markdown hybrid. Yeah collapsing elements are cool if you’re viewing in a web browser but the point of markdown is that it’s supposed to look good in a plain text editor / terminal as it does when rendered and the raw version of that markdown file definitely isn’t. Ultimately though I’m not going to complain that an open source developer has documented their free code in a way that differs from my own personal preferences. But before jumping on the bandwagon it’s worth thinking about whether you want your README to be readable as plain text as well.
- christophilus 8y agoInteresting. 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?
- kodablah 8y agoAren't there plenty of non-native-gui desktop options already? I think what we really need are cross platform gui options using native widgets (and we shouldn't pretend the impedance mismatch is too large because we've seen successful yet either license encumbered or language-unfriendly options before).
- weberc2 8y agoPretty sure this has been attempted many times, and it never seems to work out well. One problem on Linux is that the native toolkits (Qt and GTK) are just garbage. Of course, creating a new toolkit is a huge, thankless endeavor and it requires quite a lot of experience with low level graphics programming, text rendering, accessibility, etc. I think the web GUI stack is the only viable solution, but it can't be electron because of the redundant bulk--it will have to be something like ChromeOS: every program's GUI runs in its own "tab" (except tabs are laid out like windows); however, instead of pulling HTML/CSS/JS from remote servers, the servers would run as local daemons (it wouldn't really matter where the servers ran, to be honest; network transparency and all that).
- pknopf 8y ago> One problem on Linux is that the native toolkits (Qt and GTK) are just garbage. I don't know how you get that. GTK needs more work, but Qt is spot on.
- weberc2 8y ago> I don't know how you get that. This is my opinion as a former Qt developer who dabbled in GTK in my spare time. Qt is all written in 90's C++ with all of the garbage that entails--awful memory management, CMake as a build system, no widely used package manager, shitty tools, etc. It's actually _worse_ than 90's C++ because it depends on a convoluted soup of preprocessor macros and a metaobject compiler in order to bolt onto C++ things like a dynamic type system and reflection. This means there's only one IDE that really understands it, and it was really buggy when I last used it (~2014). The one nice thing about Qt is QML, which is only nice to the extent that it removes or papers over the aforemetioned list of shitty Qt characteristics. And GTK is strictly worse than Qt. For all its issues, web development is nowhere near this bad--it's cheaper and easier for an organization to ship a bastardized browser alongside their web app than to build a Qt app.
- piokoch 8y agoAny idea why Flutter uses Dart language which is rather obscure. Wouldn't Java or JavaScript be the better choice in terms of adoption?
- thefounder 8y agoYou need to know Dart/Flutter's history to understand. For once Dart exists because JavaScript sucks(or at least it sucked more when Dart was released)
- m_sahaf 8y agoThey published an article elaborating why they went with Dart: https://hackernoon.com/why-flutter-uses-dart-dd635a054ebf https://hackernoon.com/why-flutter-uses-dart-dd635a054ebf
- mekkkkkk 8y agoI might be wrong, but I think Flutter was conceived during a time when Google was pushing hard for Dart. They even pushed for including native Dart support in browsers. Google probably still considers Dart highly relevant, especially since the upcoming Fuchsia OS seems to rely on Dart (and Flutter) for its apps.
- pjmlp 8y agoFuchsia devs appear to be now experimenting with alternative UIs, given the introduction of Scenic and an experimental Rust UI framework.
- hajile 8y agoFlutter 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-benchmark/ https://www.nikolaybotev.com/blog/dart-vs-java-the-deltablue... 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/faster/dart-java.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... 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.
- javajosh 8y agoI 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
- fiatjaf 8y agoI have the same impression.
- pknopf 8y agoI 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 8y agoHey 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!"
- anjanb 8y agowhat 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 8y agoTL;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.
- jonathanstrange 8y agoOne 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.]
- noninc 8y agoThis is a very good point, I think. I would say for every product that is in a well defined category (like GUI toolkit) there is a default set of FAQ that an intro for it should answer. Maybe it would be a good idea to create an issue with a template of those FAQ, so other projects can use them as well.
- ausjke 8y agoVery 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.
- ausjke 8y agoAnother way to do true cross-platform Desktop GUI will be leveraging browser on MacOS/Linux/Win, you put your core logic in GO which runs as a local http-server on your Desktop that talks to your OS underneath, and use browser/html/css/javascript to do the UI. You only need ship the GO binary, users install it and then starting to use your program via a browser.
- pwm 8y agoApologies 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?
- GonzaloQuero 8y agoI think it's the best way to do it, to be honest. If I'm searching for a library in my preferred language to do X, wouldn't it be better if the website is really explicit about what it does and in which language?
- nizmow 8y agoPerhaps it's simply that there's still a little insecurity around writing an application in Go, and authors feel the need to justify it. I think it's unwarranted, though.
- deweller 8y agoGo is popular among open source developers, so announcing up front that the project is written in Go will attract more eyeballs and potential contributors. If I'm going to contribute to an open source project in my free time, I'm more likely to contribute to a project if it is written in a language I enjoy working with.
- Herbert2 8y agoFor me, an emphasis on Go indicates that I won't have problems with cross compilation and that I'll have a static binary to run. I'm more inclined to give a tool a try when I don't have to deal with language sandboxes.
- phkahler 8y agoFor me it raises the question of weather it works with programs written in anything other than GO. My first thoughts were - hey I'm learning Rust and Flutter looks neat, will this allow me to use Flutter as a GUI for my rust apps? They say it's written in GO, so that must be relevant right? And it probably means it's meant for apps written in GO right? It's an interesting line. I like the notion of apps I use being written in one of the more modern languages (GO or Rust) but it's not a core feature to a user. This means I can appreciate the language being mentioned but in a much less prominent way. If language isn't critical to a user or developer (of other things) IMO it shouldn't be so prominently mentioned.
- sickcodebruh 8y agoWhat 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 8y agoGoogle is already experimenting with using flutter for desktop https://github.com/google/flutter-desktop-embedding https://github.com/google/flutter-desktop-embedding
- pjmlp 8y agoThey also took care to stress multiple times last year, even during Q&A, that only iOS and Android are their main focus.
- sickcodebruh 8y agoExperimenting is the key word there. From the caveats section of their readme: "This is not an officially supported Google product." It's promising if they decide to officially support but it's dubious until then.
- beavis2 8y agoI've tried them all. - I don't want to return to C++ - I dislike javascript for large projects because even the best tooling is lacking, and the exploding dependency count. - I love C#, but WPF renders worse than Electron (and Windows only). - WinForms - mothballed. - VB6/Delphi are EOL. - UWP - Very lacking, will probably be abandoned. - Java - I have no experience. It will be a case of Flutter sucking less than the current options. Dart is actually a nice language, especially considering the runtime size - there's no framework overhead/bloat. I imagine it to be Electron, but with a decent set of widgets and without the overhead. Edit - to answer the main question: Personally, I wouldn't develop anything more than a throw-away or personal project right now, but it's worth keeping an eye on it. It would be nice to have a cross-device framework.
- divan 8y agoI 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/
- danieldisu 8y agoI wish it was written in Kotlin! tbh I don't really care in what language is written, but I would really like to create Apps with Kotlin using Flutter instead of having to learn another language that it's (in my opinion) a bit inferior than the one I'm currently using. I can see myself using flutter as a thin UI layer and just forget about the mess that Android UI layer is...
- rhodysurf 8y agoKotlin is awesome and Dart is not as awesome but when you are like me and write C++, Java, and Fortran at work all day Dart still feels better than those. Plus you never have to mess around with the Android UI layer...
- danieldisu 8y agoYeah, I prefer Dart + Flutter vs anything + Android UI layer... But the library ecosystem of the JVM and Android specifics is just too big, it will take time for Dart and Flutter to have even a small part. And also people with knowledge of the language and the ecosystem, it may be a bit risky to use Flutter right now.
- solarkraft 8y agoI wish it was written language-agnostically, with bindings for everything, like libui.
- rhodysurf 8y agoLooks cool but it ignores what Dart brings over everything else: Hot reload.
- arendtio 8y agoDidn't manage to get it running. Binaries crashed. Building from source was successful but the result crashed during runtime too.