Mikov introduces Joe Native, whose React Native app has fast startup but stutters during demanding work such as scrolling long lists and complex animations. Profiling and rewriting JavaScript cannot overcome the interpreter’s performance limits, while C++ extensions can be difficult to write and maintain. Static Hermes aims to compile selected, typed JavaScript ahead of time, leaving the rest of the app on Hermes bytecode.
Static Hermes: the Next Generation of Hermes
Speaker
Tzvetan Mikov, who helped create the Hermes JavaScript engine at Meta, presents Static Hermes at React Native EU 2023, hosted by Callstack.
JavaScript functions can receive values of many types, making efficient native compilation difficult. TypeScript and Flow annotations alone are unsound: Mikov’s example passes undefined from out-of-range array access into a function annotated to receive numbers. Static Hermes adds opt-in runtime checks that throw a range exception, ensuring values match declared types in compiled code; existing Hermes code can coexist with it.
Mikov demonstrates Static Hermes on the math-heavy nbody.js benchmark. Its initial native version ran in 550 milliseconds, matching Hermes, while a later version was 10 times faster; he said the team saw potential for 20 times the speed. He also shows compact ARM64 output and says other benchmarks achieved up to five times the speed, with further work underway.
Sound types also enable Static Hermes to call native platform functions with no conversions, allocations, or indirections. Mikov reports call overhead 15 to 80 times lower than JSI. He explains that native calls require explicitly marked unsafe sections, then demonstrates JavaScript bindings to SQLite and a call to C’s getenv function, without writing C++.
Mikov says Static Hermes is a work in progress and not yet suitable for general use; it can be difficult to use and some parts are broken. TypeScript support was contributed by Amazon, while the Hermes team had added Flow support. He invites feedback through Discussions on the Hermes GitHub repository and points viewers to benchmark and FFI examples.
Takeaways
- Use native compilation selectively for performance-critical JavaScript while leaving other code on Hermes bytecode.
- Type annotations do not guarantee runtime values; sound typing requires checks for cases such as out-of-range array access.
- In the demonstrated nbody.js benchmark, native compilation improved runtime by 10 times over Hermes.
- Zero-cost FFI can reduce native-call overhead substantially, but calls require deliberate use of unsafe code.
- Treat Static Hermes as experimental based on this presentation; Mikov described it as difficult to use and still incomplete.
Mentioned in this talk
Search inside this talk
What was claimed 6
- role atTzvetan Mikov is Hermes team member at
Meta
“I'm on the Hermes team at Meta.”
0:35inHermes: better performance with runtime bytecode translationYouTube Verified3 sources· Talk
- feature
Hermes Agent: Optional ahead-of-time compilation of JavaScript to native code
“it is optional ahead-of-time compilation of JavaScript to native code.”
YouTube Unverified1 source· Talk
- feature
Hermes Agent: Supports both TypeScript and Flow
“both TypeScript and Flow are supported.”
YouTube Unverified1 source· Talk
- feature
Hermes Agent: Enforces sound types at runtime in opt-in code
“at runtime, the types of values are guaranteed to match the type annotations”
YouTube Unverified1 source· Talk
- metric
Hermes Agent: N-body benchmark was 10 times faster than Hermes when compiled natively
“it is 10 times faster when compiled natively.”
YouTube Unverified1 source· Talk
- metric
Hermes Agent: Native function call overhead measured 15 to 80 times lower than JSI
“between 15 and 80 times—not percent—80 times lower than JSI”
YouTube Unverified1 source· Talk









