⚔️

Searching for a cross platform framework

My journey on trying to find a cross platform application development framework.

This is still a WIP and I’ll be updating each one as I discover and play with new stuff.

Why Cross platform?

There are majorly 2 mobile platforms and 3 desktop platforms. Browsers are acting as a cool layer between this, within the realms of which applications are consistently rendered and usability is not spoilt. This is awesome, because now you don’t need 5X the development effort to deliver a software experience But only one. Which means velocity can be much faster. But the problem with this, is that “websites” are not really perceived as serious applicaitons. And there is very little control over the user experience. Native apps are a better way to deliver applications.

Requirement

  • build apps across all 5 platforms with max code overlap across. (ideally)
  • Small build size
  • Snappy performance
  • If only desktop apps only
    • 95% code overlap

  • If only mobile apps
    • 95% code overlap.

    • uptodate API support

Options.

There are broadly a few ways this is being done.

  • Use a browser to render the application (electron, Deskgap, nwjs, et al.)
  • Provide SDKs that compile to native code (Qt, flutter, et al)

Browser based solutions

Electron

Electron supports all major desktop platforms. And simple HTML, CSS and JS stack works perfectly fine without any issue.

Electron is unanimously disliked by everyone for being such a memory hog, which seems unescapable when you’re shipping an entire browser with the application. Also, this kinda bloats up the app bundle as well. A hello world production app takes up about 50 MB which is insane. station’s story is a cautionary tale to anyone who tries to go down this path.

examples: slack, discord, VS code, more stuff here

NWjs

creates a node runtime in the browser to render the website. which means, on first install it has to be bundled with everything that comes with it as well. This could get pretty heavy overtime.

node_modules image

One nice(?) thing about NWjs is that it still supports windows xp.

NeutralinoJS

Neutralinojs takes slightly a different(smarter?) approach by using the system’s default browser instead of bundling a whole chromium browser with it. Neutralino clearly has its benefits over the other two in both build size and memory footprint. It still supports only desktop applications

similar

examples: here

React Native

As far as I’ve seen React Native feels like a mix of so many things. its a sublet from a “web”-framework that has been changed fairly to interact with native components written in JAVA, objective C and C# using so called bridges. This mildly reminds me of the chimera, a freak of nature not really sure why.

examples: Coinbase, shopify, flipkart and others

Personal notes:

  • the hot reload is nice

Qt

Qt is a cross platform proprietory framework that is being used by a lot of applications. they provide a free version with an LGpl license and link the app dynamically instead of statically. Which, might satisfying for most application. Also, it requires you to write in c++ and does not exactly support android. The widgets can get old. and new native features might be a bit late to come by.

Personal notes:

  • Having to use a proprietary IDE for development is annoying

example apps: telegram, skype

Flutter

Flutter is a multiplatform application development framework which uses dart as a main language. It’s relatively new, being published in 2019. It supports android, ios, macOS, linux, windows and web. And runs in near native performance. It does not use native components directly, like React native instead choosing to paint all the widgets using the Skia 2d rendering engine, which means the widgets aren’t exactly native but native-like.

examples: Zomato, Zerodha and others

Kotlin

Kotlin Multiplatform is a framework build on top of kotlin to build apps for multiple platforms including, web, tvOS, macOS, android, ios. Kotlin skews more towards business logic and is heavy in that angle. It works by having custom modules for seperate platforms and one unifying part. Since Kotlin, has complete backward compatibility with Java and runs in the JVM, it is able to support multiple platforms.

personal notes:

  • having tried to develop android apps, the whole setup is huge and heavy. Android studio + adb just sucks up a lot of memory.
  • There is no hot reload. Meaning the feedback loop is incredibly slow.
  • Kotlin is pretty easy to pick up.

Resources I found useful