3 ms·
Well, with WASM everywhere I think that it might realize some of its potential as tooling improves. Don't you want to write your algorithms and data structures
by mrtksn 4y ago
Well, with WASM everywhere I think that it might realize some of its potential as tooling improves. Don't you want to write your algorithms and data structures in such a nice language? Slap the native UI, when in iOS its SwiftUI and when on the web its ReactJS or something and when its on Android its whatever Android uses but have your actual processing of the user inputs in Swift.
The traditional cross platform approach is to write it in JS and use the native UI framework API, which works but its not native anywhere and you have to write JS.
So instead of doing that, you can start with Apple platforms and port to the other platform where porting would mean just UI and device specific API implementation as the Swift can be portable. You wouldn't be trying to build native UI with Swift but you would use the Swift code as a service which handles everything except the UI where the UI implementation will communicate with your Swift code.
The advantages are:
1) Working with Swift, which is pleasant to work with.
2) Apple's all platforms are on the same architecture and as a result, running your code for mobile on your dev machine works at full speed. This means, even the cheapest Apple Silicon device provides great performance on your workflow. No more sluggish emulators.
3) Preserve the data structures across all platforms and these data structures are not JS data structures. You have integers for example :). Categories of bugs and work to make things fit vanish.