Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> But your react logic is still executing as JavaScript.

Yes, but this is no different than how native works. On iOS, The JS Bridge compiles to bytecode and talks to the Obj-C runtime for native needs like Cocoa, just as Swift does.

Sure you could get better performance by writing your apps directly in Obj-C, but I don't think many people want to go back to those days.



Sorry... what? The more I read this, the more asinine it sounds.

Some definitions:

- The Obj-C runtime is just a shared library that Swift links to on compilation (/usr/lib/libobjc.A.dylib). The performance to call into it is identical for Swift and Obj-C.

- "Sure you could get better performance by writing your apps directly in Obj-C..." Swift code is native code. Cost to access the runtime is identical.

- There is one "hop" to go from Swift to the Obj-C runtime.

- There are >2 "hops" to go through the JS Bridge. https://hackernoon.com/understanding-react-native-bridge-con...


> the more asinine it sounds.

HN is better without personal attacks and insults.


The comment was against the argument being made, not the user. Nothing personal about it.


That's an interesting take that I don't agree with.

It could be extended to pretty much anything: "I'm insulting your clothes, not you".

Calling something that a person says, or writes "asinine" is inflammatory. If I were to call your defense of it "naive, brain dead and utterly absurd" are you sure you wouldn't interpret that as a personal attack?


> Calling something that a person *says or writes* "asinine" is inflammatory

Yes, inflammatory. But personal, no.

> If I were to call your defense of it "naive, brain dead and utterly absurd" are you sure you wouldn't interpret that as a personal attack?

Correct, because it's not personal. That would be attacking the quality of the argument, not me, although it would certainly be inflammatory. I certainly wouldn't take it well — but for a totally different reason than you originally specified.

"Personal" and "inflammatory" are two different things.


I’m sorry what?? Native code gives you access to libdispatch and concurrency. RN is single threaded. There are a myriad of processes, shared memory, optimizations, and daemons that run on your phone that coordinate better with native binaries.

Web won’t beat native on mobile phones, I’m sorry this argument has been had every single year it’s just absurd we keep arguing about it.

RN is implemented due to developer productivity at the cost of user experience. Which is fine more power to you, but understand that it doesn’t imply better UX.

The barriers to creating apps is also getting smaller (SwiftUI & Jetpack Compose).

Source: Multiple years working on Core Apple systems at Apple and also multiple years at Google


> Web won’t beat native on mobile phones

Honestly, it won't beat anything anywhere, but people do keep on trying to make it work.


I don’t think many people left those days TBH. I personally saw how 2 large RN efforts have been rolled back to native at a big tech company. I don’t know whether RN is gaining traction or is stagnating - would love to see some stats.


You mean Facebook sized large? Not every company has the resources to hire a full on Android and iOS team. So they write React Native instead, which is good enough for most.


Objective-C actually gets compiled down to machine code at compilation down. When you download an app from the app store, there is no more Objective-C.

RN doesn't "compile" the Javascript to bytecode or machine code. Instead, the closest competition you could get from RN is a JIT. But AFAIK iOS doesn't allow a Javascript JIT to run, so the JavaScript running is not being JITed to Bytecode.

Even if you assume that iOS allows a JS JIT now, you still have a JavaScript->Native bridge to cross. This adds a performance hit that Objective-C does not have.


You have no idea. Swift is compiled into native code on build time




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: