Hacker News new | ask | show | jobs
by apatheticonion 1128 days ago
I do have a naive view on native GUI development because I have little real experience in it - I very much appreciate your insight.

> “Abstracting” away the native GUI/UX seems to be a common pitfall for junior devs

I would like to know more about what you mean here; my description of a "virtual UI" that you bind to from the native toolkit is an abstraction to the UI - but it's not an abstraction like Flutter which tries to merge all native widgets into abstracted widgets. My concept still requires you to write multiple native entry points using the UI kits of the target platforms.

` (GTK entry || Cacao entry || Win entry) => Virtual UI => application logic `

The idea is that the virtual UI would be an in-memory representation of the UI (have virtual buttons, labels, etc). It would be the job of the entry to correctly represent/bind to that virtual UI with the relevant presentation tool kit. The output binary would be specialised to the platform/UI kit used in the source entry point.

It seems sensible on the surface to decouple the UI from the native presentation as it minimizes the requirements of the native side to constructing the UI and binding to the virtual UI - but I would love to hear your thoughts.

I have not tested this architecture outside of web development but I imagine adding new UI targets (like web assembly, QT, etc) would be easier as it wouldn't require any changes to the virtual UI or application logic and would be a matter of creating a new entry point representing the UI for the new target.

> then they learn why Qt exists

Does QT feel native on MacOS, Windows and Gnome?

> Yes it is [talked about]

Could be my personal echo chambers talking here - but multithreading is almost never spoken about and/or often intentionally disregarded in modern web/electron applications.

It sucks because so many applications are written using Electron or other similar web wrappers.

> there isn’t a particular reason this hasn’t been doable in C/C++ since forever - Rust isn’t some silver bullet

Not dismissing this, I was more impressed that Rust offers a thread safety guarantee through its ownership model making it interesting from a contributor scalability standpoint.

I was thinking that it might make it easier to have more engineers working on a high performance GUI project because it would be significantly harder to break.

As an example; I could imagine if a company assigned a team of TypeScript/JavaScript developers with different experience levels onto a GUI project written in something like Go, there would be a lot of thread safety issues and seniors would spend a lot of time combing PRs for thread safety issues.

Rust, while perhaps not as simple from a syntax/types/symbols standpoint, offers an interesting development modality for these sorts of projects. I would expect that it would result in a more hands off contributor experience.

> Electron is about as far removed from the philosophy of targeting platform native toolkits as one can get.

Sorry I wasn't describing Electron as targeting platform native decorations - just that it promises an OS agnostic UI framework (write once run anywhere) at the expense of a diminished native experience and poor performance.

My point was that it might be interesting to explore the idea that a multi-entry native toolkit application fulfils the same "write once run 'anywhere'" promise but without the downsides.