Comments (7)
We're designing Static Hermes typed code to be interoperable with existing untyped JS for use with existing libraries, to allow for gradual or partial conversion to typed code.
Inferring and enforcing static types onto untyped code which was not written with static types in mind would be difficult. We can't be sure of the intent of a programmer who thought they were writing untyped (potentially highly dynamic) JS. We do currently do some type inference in the optimization pipeline of the compiler, though - this allows us to emit special instructions when we know you're adding numbers, for instance. There's no runtime checks inserted, this is solely for optimization based on known types.
We do intend to allow some static type inference within typed JS (with certain fallbacks to any
type) to allow for easier migration to typed JS and easier authoring. While Static Hermes is still a work in progress, even today var x = [1, 2, 3]
will infer that the type of x
is number[]
in JS code compiled with -typed
.
from hermes.
We're designing Static Hermes typed code to be interoperable with existing untyped JS for use with existing libraries, to allow for gradual or partial conversion to typed code.
Inferring and enforcing static types onto untyped code which was not written with static types in mind would be difficult. We can't be sure of the intent of a programmer who thought they were writing untyped (potentially highly dynamic) JS. We do currently do some type inference in the optimization pipeline of the compiler, though - this allows us to emit special instructions when we know you're adding numbers, for instance. There's no runtime checks inserted, this is solely for optimization based on known types.
We do intend to allow some static type inference within typed JS (with certain fallbacks to
any
type) to allow for easier migration to typed JS and easier authoring. While Static Hermes is still a work in progress, even todayvar x = [1, 2, 3]
will infer that the type ofx
isnumber[]
in JS code compiled with-typed
.
Is it possible to migrate existing RN apps running on the Hermes Engine to a fully compiled native binary app, which requires no Virtual Machine like Hermes, without any code changes?
from hermes.
Is it possible to migrate existing RN apps running on the Hermes Engine to a fully compiled native binary app, which requires no Virtual Machine like Hermes, without any code changes?
Yes, that is already possible, but it is not beneficial. At the moment, untyped code in Static Hermes executes between 0% to 20% faster than Hermes. The resulting binary is very large, because native code is several times larger than the corresponding bytecode.
from hermes.
from hermes.
Yes. Although we are not recommending that, it is certainly possible.
from hermes.
from hermes.
Static Hermes is a JS compiler and engine. It is the equivalent of v8 (JSC, SpiderMonkey, etc). File APIs fall outside of the JS engine responsibility.
Node is not the same as v8, it is a completely separate project by different people (not even the same company) which uses v8 and implements various APIs on top of it. If there is a Node API implementation for Static Hermes, it will not originate from our team.
With that said, Static Hermes makes it very easy to access the existing system APIs (fopen, etc), so in many cases the Node API wouldn't even be necessary.
from hermes.
Related Issues (20)
- Bug: recursion: "Maximum call stack size exceeded" HOT 2
- Wrong `DCMAKE_TOOLCHAIN_FILE` in docs HOT 3
- Intl.NumberFormat with compact notation doesn't display formatting HOT 1
- Examples how to use the experimental C ABI? HOT 3
- babel-plugin-syntax-hermes-parser drops chunk names HOT 1
- static_h: Assertion `Val && "isa<> used on a null pointer"' failed with -typed on tsc.js HOT 2
- fatal: unable to access 'http://github.com/facebook/hermes.git/' HOT 2
- I hope Static Hermes supported Windows, Linux, and MacOS. HOT 2
- Local debug and release build throws a type error HOT 3
- I hope it was possible for Static Hermes to native AOT compile all the existing NPM modules. HOT 1
- Intl.DateTimeFormat does not support 'Europe/Kyiv' timezone HOT 2
- Using Intl with standalone Hermes app HOT 2
- Support for top level await HOT 1
- iphoneos framework very large size issue (build-apple-framework.sh) HOT 5
- [Debugger] Incorrect scope variable information for variable initialized in for-loop HOT 3
- Race Condition between HadesGC and HermesInternal.getEpilogues() Causes Segfault
- Assertion `IDom && "Reached the top of the tree!"' failed in ./hermes/lib/Optimizer/Scalar/Mem2Reg.cpp HOT 1
- prettier plugin: Infinite loop for malformed graphql relay query
- Closures caputure external variable errors HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hermes.