5 ms·
I like this the common core direction much better for cross platform, but even what you suggest is too low level imo. Consider networking, your suggestion is to
by K0nserv 5y ago
I like this the common core direction much better for cross platform, but even what you suggest is too low level imo. Consider networking, your suggestion is to target only libc capabilities and build SSL+HTTP support from scratch. This is a ridiculous approach when there are excellent higher level APIs available on the platform. It's actively harmful because it bloats the resulting binary, increases the attack surface(out of date statically compiled SSL libraries for example), and integrates poorly with the host OS.
A good common core solution would be built with Rust and integrate directly with each platform's highest level C libraries i.e. CFNetworking on iOS, fetch via WASM on the web, and w/e Android provides. Further, I think the best cross platform apps would be built by embracing this approach and keeping the UI native. Sadly, most investment in cross platform is going in the direction of Flutter, i.e. throw away the entire native UI Kit in favour of poor imitations in Vulkan, Metal, et.al.
- zorr 5y agoI totally agree with you about SSL. That's what I meant with abstracting I/O on top of platform-primitives. Similar to how the Reqwest crate in Rust-land uses fetch on WASM and something else for other platforms. For the developer the API to define requests remains the same. Flutter/Dart also does something similar in its http packages. I would like to see the same thing but decoupled from the UI framework. edit: Rust Cargo and Kotlin multi-platform Gradle tooling are heading in the right direction. Both have support for defining a common interface with platform-specific implementations and good support for building against various target platforms.
- Comevius 5y agoI don't know where Rust or Kotlin are heading, but C/WASM and Dart are already there today. I use Zig for the C/WASM part, it does cross compilation out of box. It's also a C compiler. It has built-in libc for Windows, macOS and Linux, and built-in wasi-libc. https://ziglang.org/ https://ziglang.org/
- JamesSwift 5y agoFlutter is not likely to be successful due to the amount of work required to maintain the UI compatibility, but if you are going to do shared UI then Flutter is the only one approaching it in a reasonable way IMO. Throw out the UI and _actually_ standardize on a unified system. But yeah I don't think it will succeed in the long run.
- Comevius 5y agoFlutter is already the most popular cross-platform framework. React Native has more jobs at the moment, it has been around longer and JavaScript is popular. However the reason Flutter is successful is because in a multi-platform world it let's you beat your competitors on cost, time to market and performance. Dart is basically TypeScript or JavaScript with Flow, and with the exact same event loop concurrency model.
- JamesSwift 5y agoTo say Flutter is the most popular cross-platform is naive. React Native is the most popular "mainstream" (aka HN) cross platform by a mile. Xamarin is huge especially within .net shops. Flutter is comparatively less mature and less adopted than either.
- deleted 5y ago[deleted]