Hacker News new | ask | show | jobs
by pjmlp 2830 days ago
JavaScript is also an impedance mismatch.
1 comments

> JavaScript is also an impedance mismatch.

Yet both Android and iOS allow embedding a Javascript engine in an native application with no effort whatsoever.

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.
> 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.

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.