Live data from Hacker News

Gio UI – Cross-platform GUI for Go

gioui.org

181–190 of 224 posts

Re: Gio UI – Cross-platform GUI for Go

#181
post #55

Earlier quoted context omitted.

The one flutter website I have come across is an absolute piece of garbage. Completely destroys the ability to modify or even inspect the HTML source. See for yourself https://sunrisetv.ch/de/vod/1/details/vod/crid:~~2F~~2Fog.li...

You can export the flutter build as HTML, but the point with flutter is not to be a ”website”, it’s supposed to be seen as a ”web-app”. If you are going to create simple static homepage or interactive website, I don’t think Flutter is the right tool. Full fledged cross-platform applications is what Flutter is meant for.

I agree, who cares if a website supports accessibility, no one in the world is vision impaired and uses screen readers right? right?

Re: Gio UI – Cross-platform GUI for Go

#182
post #23

Earlier quoted context omitted.

They both owner-draw every widget themselves (not using platform native widgets). Gio is pure Go, Fyne is cgo. Gio is immediate-mode, Fyne is retained-mode. Flamewar starts here: I don't know why anyone would seriously choose an immediate mode GUI toolkit. When you receive an event, in immediate mode you have to recreate the whole world, then the toolkit has to then either rerender the world from scratch, or else dif…

One positive side of immediate mode is that the code becomes a lot more straight forward. You only see that loop function, so it's very nice if you need a POC, or if it's going to be ran on embedded.

Here's some pseudocode for argument's sake: http://paste.debian.net/1317369

I don't think the immediate-mode code is really more straightforward. Retained mode looks just as simple and only has that one same function with the same 5 basic SLoC, only

- (A) the ui library has to do less work at runtime, resulting in a more responsive app (as per parent comment);

- (B) i was forced to reorder the component instantiation. In immediate mode, the counter's label depends on the button's state, whereas in retained mode, the button update callback depends on the counter instead; and

- (C) immediate mode only needed one sprintf instead of two since the initialization and update logic is unified. You can combine them in retained mode with a helper function or closure (and in real-world apps you would); in this trivial case this increases the SLoC but in real-world cases it reduces it.

Re: Gio UI – Cross-platform GUI for Go

#183
post #35

Earlier quoted context omitted.

How do generics change this? Can a type bound on a generic work like a static interface implementation specification, and recover the cost of wrapping the struct?

You can declare generic structs and generic functions, and get monomorphized copies (not erased to "any") of each function for all concrete types used. You can't look them up by reflection. You can't declare generic methods, and still can't overload methods by type.

That'd be how C#'s generics work for struct Ts. Go uses GC shape sharing: https://deepsource.com/blog/go-1-18-generics-implementation

Re: Gio UI – Cross-platform GUI for Go

#184
post #2

A bit off-topic, but what's the best method to build cross-platform mobile & web apps nowadays ? I'm talking either business logic + UI , or just business logic ? like gomobile, rust, typescript, etc ? At some point i thought about using typescript for all business logic, as it seemed the most portable tech, but i realized there's no good way to have decent performance running javascript on iOS.

I would mention as an alternative QML, although I wouldn't claim it is the "best method". It's marketed as being mobile-capable, but I've heard problems about scrolling inertia and vsync delays.

I'm curious to know what others think about it.

Re: Gio UI – Cross-platform GUI for Go

#185

Earlier quoted context omitted.

I really think that the Lazarus Component Library took the right approach: https://en.wikipedia.org/wiki/Lazarus_Component_Library I wonder why the idea of widgetsets never really went anywhere: https://en.wikipedia.org/wiki/Widgetset You could take a program that says you need a button in the window and it would make one for you on Qt, GTK or whatever else was supported, on any platform that you were compiling for.…

Now there is a generation of software developers who grew up with web technology, and they aren’t old enough to recall the days of native apps - they don’t know any way other than HTML.

Lol. One of good cross platform example is Calibre [1], built with Python and Qt. And it’s the only one I carried with me from Windows XP/10 to macOS, through Linux. Another is Sublime Text.

[1]: https://calibre-ebook.com/

Re: Gio UI – Cross-platform GUI for Go

#186
post #71

Seemingly it's using a to render everything just like Flutter on Web, which is known to have problems with accessibility and feel non-native.

I’m curious if anyone has a variant of this idea where an invisible DOM lives alongside the canvas for accessibility reasons. It should work but I imagine it would also take a lot of work.

The canvas element allows children specifically for this purpose, iirc.

Edit: unless you're doing something like flutter where your goal is to escape the DOM/JS paradigm in your code entirely, the fallback DOM nodes don't tend to be implemented too often.

The biggest reason is that canvas is for things with interactive/consumptive patterns that don't work well without vision.

Cute animations, 3d explorers and configurators, that sort of thing.

For users who rely on screen readers, they are better served by a DOM and interactive patterns that are not strictly recreating the canvas.

As an example, canvas based animations might have a fallback equivalent to an alt attribute on an image. A 3d explorer or configurator might be represented in DOM as a multi step form with verbose descriptions- no need to recreate drag and drop, camera controls, or anything else.

So, if you're not automating it like flutter is (and even if you are) what you really need to do is effectively an entirely alternate UX for screen reading users... Trying to get your product team to budget that is difficult despite being a Good Thing to do.

Re: Gio UI – Cross-platform GUI for Go

#187
post #128

Earlier quoted context omitted.

Yes, as a longtime software developer people have been trying to solve this problem different ways my entire career. The closest we got was Java swing. And it works well enough for things like eclipse but for some reason, nobody wants to use it and they want to use things like Electron instead

Regarding the "for some reason": Java Swing (and JavaFX, and Windows Forms for that matter) all suffer from lack of integration with modern web browsers. It is near impossible to find a way to combine these model-view-controller based user interfaces with the DOM in a reasonable way. Horrible as it is, web browsers have managed to provide a common platform for user interface delivery. The browser wars have been fierc…

That’s because companies want you tethered to their servers. There are plenty good native apps that doesn’t require to have half GB to run them. Most SaaS coul be native if they want too, but hey, you have a 32GB laptop, right? And we want all your data anyway. Here is our Electron app!

Re: Gio UI – Cross-platform GUI for Go

#188

Not about Gio UI but related. I'm really enjoying the conversation around UI toolkits here. But I think we're all missing the elephant in the room and it's that we already had (have?) a superb toolkit and development model in the Visual Basic (later Windows Forms) era and nothing really manages to replicate that experience nowadays. Microsoft destroyed it when they tried to push WPF and later shenanigans, only to rea…

> I remember Mono tried to bring that to all platforms and everybody ignored/smashed them because "it's Microsoft".

> Microsoft destroyed it when they tried to[…] only to realize it was a mistake years later.

Answer is right there.

Re: Gio UI – Cross-platform GUI for Go

#189
post #46

Earlier quoted context omitted.

First comment on that Reddit thread: --- Hey folks! Kevin, product manager on Flutter and Dart here. The layoffs were decided AT LEAST a couple of layers above our team and affected a LOT of teams. (I think I can say that). Lots of good folks got bad news and lots of great projects lost people. Flutter and Dart were not affected any more or less that others. It was a tough day...tough week. It was crazy to be seeing…

Reddit post from Project Manager is pretty pointless. If Google decides to get rid of Flutter, they are not going to tell Kevin before hand, they are likely not even going to tell Kevin boss before hand. Stadia employees were swearing up and down that Stadia was full steam ahead despite layoffs until it wasn't. When it happened, it was clear from all Twitter posting that no one except really high up Google Executives…

The doom and gloom comes from much the same pontificating and rumormongering. Except somehow less official, and that's what you want us to go with?

Re: Gio UI – Cross-platform GUI for Go

#190
post #124

Earlier quoted context omitted.

Quit spreading lies about Flutter. It’s one of the most popular cross platform development environments, if not THE most popular, out there and that’s not going to change anytime soon.

So what if it’s popular? It’s a revenue driver and majority of development is still made by Googlers, as far as I know. If tomorrow Google drops all development, who’s going to pick it up? Or in your opinion GitHub stars would prevent them from dropping it?

People keep saying this about Go in every new Go version post and they keep getting disappointed. If you don't like Google languages, products or services then just quit using them and move on to something else.
Post reply on HN