Hacker News new | ask | show | jobs
by aikah 2829 days ago
> I wouldn't call manually exporting Java methods to the WebWidget "no effort whatsover", plus the performance hit of doing cross-language, inter-process calls, in a dynamic language while the platform languages are static.

Well like it or not JS is first class on both platforms as they both have a JS engine at the developer's disposal, Kotlin or C# aren't.

1 comments

I don't know about iOS, but on Android it surely isn't first class, the development experience is even worse than using the NDK.

If it was first class, there would be official Android APIs for JavaScript, debugging support on Android Studio, project templates on Android Studio.

Instead it is a web widget with its own little island of HTML 5/CSS 3, hardly first class.

The support is not much different than getting chromium and compiling it with the NDK.

The only mobile platforms where JavaScript is first class, alongside the other platform languages is on ChromeOS and UWP.

First class because there is no need to deploy your own JS engine on both these platforms, you can argue all you want, both have a webview/js engine API that are part of their respective SDK.
That is not what first class means.

A language is first class when the complete SDK stack tooling has support for it.

IDE, debugger, docs, project templates, profiler, OS APIs.

> That is not what first class means.

That's not what first class means to you. You can't just make up the definition you want just because it's convenient for your. First class means it runs on the platform without any form of external or third party runtime.

The point is that you want JavaScript to be seen as first class no matter what, because it fits the React Native story, even though it requires manually written FFI for the platform APIs.

Hey, by your definition even web pages are first class on mobile devices, as they don't require any form of external or third party runtime, maybe we can even call them native apps!

If JavaScript doesn't require any form of external or third party runtime, then why does React Native bundle JavaScriptCore?!?

https://github.com/react-community/jsc-android-buildscripts