Is well know the problem of try to do a cross-platform GUIs. But in the other end, the necessity to do that have increased with the arrival of mobile and the emergence of OSX as a viable target for commercial apps.
Is kind of ironic that is easier to port a full 3d-game but a “simple” business app is a huge undertaking
The key, IMHO, is decouple some tasks (kind of separate “back-end” UI from “front-end” UI).
We can do “partial/almost” cross-platform UI, if we think that some stuff can actually cross cleanly:
-
Layout (the big one, IMHO) with something like https://yogalayout.com. This one was my main block before.
-
A well defined way to separate the back from the front UIs. The ELM architecture is a good contender (https://www.elm-tutorial.org/en/02-elm-arch/01-introduction.html) (called Update-Model-View, similar to react + redux but simpler and easier to call servers/async)
A big chunk of the logic is totally cross-platform and “only” need to adapt the render of controls. This way of working allow to work with pure objects for the model and the view without actually commit to exactly what is the view UI. Instead, is delegated to the “update” side. It can totally be just in-memory, testeable object.
- Dispatching, events and similar stuff, that is not visual. This need a bridge but I don’t think will be complicated.
Then finally, the rest can be fully native:
-
Controls
-
Drawing
-
Animations
-
Call to native libs
This mean that we build components instead of a class hierarchy and is possible to swap what is a “control”, like, from HTML to iOS Views without moving the rest of the logic.
The big question is what to use for coding this. I’m using .net but wish to have something more low-level. I know swift and it could work for other targets (Java, .NET, native) with elements.
Wish to have a coding partner to do this