Hacker News new | ask | show | jobs
by vbezhenar 3325 days ago
Rewriting React Native with Kotlin would make a lot of sense. Kotlin compiles to Java bytecode, so you don't need to deal with JavaScript engines, serialization/deserialization, etc. Kotlin will compile to machine code, so it'll be supported with iOS with the same advantages. Kotlin performance is better than JavaScript. Kotlin has async constructions, etc. Kotlin could be compiled to JavaScript for web apps, so code reuse will work.

The only thing that Kotlin misses is XML Tags inside the language, but they could be modeled with DSL API.

That said, I don't think that Facebook would rewrite react native. It's an impossible task and they don't really need it. But I hope that some big player will replicate react native with Kotlin.

1 comments

> Kotlin compiles to Java bytecode, so you don't need to deal with JavaScript engines, serialization/deserialization, etc.

I don't think the GP meant replacing JS with Kotlin, rather they're referring to implementing React Native modules in Kotlin instead of Java, keeping the JS part untouched. (As you may know, React Native modules/components require native implementations before they can be used in JS).

I hope that clears things up a bit!