Live data from Hacker News

Hermes – A small JavaScript engine optimized for running React Native on Android

github.com

31–40 of 57 posts

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#31
post #29

There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (For the unawares, RN necessarily uses the system JSC on iOS per Apple requirements, but for Android RN bundles JSC into the APK.) I don't understand how Hermes will differ from JSC/V8 in terms of functionality and performance. What functionality can be left out of Her…

It's not an unreasonable task for a small team of skilled engineers who know V8 in depth, the kind that FB can and probably has recruited. If they're taking most of what V8 learned over the years into account, they'll know what to prioritize and what to not to.

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#32
post #13

One of the game-breaking things about the older JavaScriptCore engine on Android was that when I debug on Chrome, it has a totally different engine (V8) so, there were code that ran correctly when debugging but crashed on-device. Will Hermes be able to solve this debugging issue?

Hermes is using the same debugging protocol as Node. So yes, debugging in Chrome actually runs Hermes code on the device.

Correction: this is not documented yet, but it should already work. Documentation is coming soon.

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#33

I understand and accept the reality of path dependence. At the same time, when I see projects like his, V8, HHVM, etc. I can't help but wonder where we could be if all of that engineering effort had gone into more carefully-designed languages.

Even carefully designed languages have mistakes.

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#34
Worth noting that JSC on iOS for use in app-backend/business-logic code runs in interpreted mode [1].

Are Android versions of RN apps faster because Android's native V8 allows JIT, and Hermes also employs JIT?

[1]: https://stackoverflow.com/questions/45422462/what-does-jit-i...

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#35
post #29

There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (For the unawares, RN necessarily uses the system JSC on iOS per Apple requirements, but for Android RN bundles JSC into the APK.) I don't understand how Hermes will differ from JSC/V8 in terms of functionality and performance. What functionality can be left out of Her…

V8 and JSC are absolutely amazing pieces of technology. They'll run 60fps WebGL games or console emulators at incredible speeds. Huge props to the engineers that made that happen!

RN apps are rarely CPU bound though, so they don't necessarily benefit as much from those same optimizations.

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#36
post #29

There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (For the unawares, RN necessarily uses the system JSC on iOS per Apple requirements, but for Android RN bundles JSC into the APK.) I don't understand how Hermes will differ from JSC/V8 in terms of functionality and performance. What functionality can be left out of Her…

> What functionality can be left out of Hermes as compared to JSC/V8 in order to shrink its sie?

At the moment Hermes isn't compatible with ES6 (it's missing a lot of stuff). Perhaps, since part of the build step for RN anyway is transpiling, they don't need to provide all of ECMA's features. ES5 is more simple, less complex so I wonder if some performance can be had there.

But since they are building an engine strictly for making native apps using JS, there may be shortcuts or other stuff they can drop that JSC/V8 normally have to worry about but that's just speculation.

I'd love to see more info addressing your questions!

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#37
post #30

Earlier quoted context omitted.

This is what I always go back to. We have so many smart engineers working on ways to interpret JS to interact with native components and try to tighten that loop to make it faster. Why is there not a large movement to just make UI development in native languages better? Like, Swift UI looks great but it appears to be a huge exception to what everyone else wants to do. I'd love to see more work go towards making cross…

> Why is there not a large movement to just make UI development in native languages better What are these native languages you speak of?

> What are these native languages you speak of?

Really any of them. Swift UI is the only example I can think of where a group of folks are working on making UI easy and intuitive to create and manage inside of a native language.

Why is there not an effort to make something as intuitive in C++ or GO or Rust? C++ would probably be the hardest one, sure, and there are many UI frameworks for all of these languages but none of them are as simple or intuitive as Swift UI or how React / Vue works inside of JS.

I'd love to see some more experimentation in ways of building UI in native languages. Heck, even in managed languages like C# or Java they could use the same type of treatment.

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#39
post #29

There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (For the unawares, RN necessarily uses the system JSC on iOS per Apple requirements, but for Android RN bundles JSC into the APK.) I don't understand how Hermes will differ from JSC/V8 in terms of functionality and performance. What functionality can be left out of Her…

The same real world react app went from 40MB to 20MB.

They don't ship minified javascript to final app, but bytecode, which they say is 1/3 smaller (both minified). They have moved the parse and compile stages to ahead of time, making the VM smaller, and giving the bytecode benefit. The bytecode benefit also means a quicker time to live/first reponse from 4s to 2s in their example.

Link to the talk, from FB employee announcement made at React Conference today, 15 minutes length. Linked 2 mins in, because the audio is poor to start.

https://youtu.be/zEjqDWqeDdg?t=130

Re: Hermes – A small JavaScript engine optimized for running React Native on Android

#40
post #29

There's a gazillion engineering hours between JavaScriptCore and V8. It seems crazy to write a JS engine from scratch as opposed to forking JSC or V8. (For the unawares, RN necessarily uses the system JSC on iOS per Apple requirements, but for Android RN bundles JSC into the APK.) I don't understand how Hermes will differ from JSC/V8 in terms of functionality and performance. What functionality can be left out of Her…

V8 and JSC are absolutely amazing pieces of technology. They'll run 60fps WebGL games or console emulators at incredible speeds. Huge props to the engineers that made that happen! RN apps are rarely CPU bound though, so they don't necessarily benefit as much from those same optimizations.

All those laggy react apps aren't CPU bound? What else is making them laggy?
Post reply on HN