Comments (9)
Hi, thanks for asking! tl;dr is no. Let me elaborate.
Hermes optimizes for its primary metrics of startup time, size, and memory utilization. These aren't specific to React Native, but they were informed by it. In a long-running server environment, key metrics are different. Startup time an app size are only of minor importance. Servers are not nearly as memory constrained as mobile phones.
Hermes makes different trade-offs than other VMs in order to optimize for its core metrics. In particular, Hermes has no JIT (just in timer compiler), because JITs are mainly useful for improving the performance of longer running, CPU intensive programs. A JIT also consumes more memory than an interpreter. In a server environment, where you're trying to optimize for CPU and QPS over a longer time period, a JIT is likely to help improve your metrics.
Given all this, we don't believe Hermes is likely to be competitive as an engine for node, and so we don't have any plans to propose anything like this.
from hermes.
Hermes optimizes for its primary metrics of startup time, size, and memory utilization. These aren't specific to React Native, but they were informed by it. In a long-running server environment, key metrics are different. Startup time an app size are only of minor importance. Servers are not nearly as memory constrained as mobile phones.
Thanks, this helps to clarify the main target metrics of Hermes.
Just take into account that Node.js is not server-specific
It is even I guess more widely and heavily used for tools like ESLint, Babel, Webpack, Packer, and so much more, than for server-side application (for which competition with PHP, Java, .NET, python, ruby, ... makes it still a little player)
(mainly CLI but not only)
I'm not sure how much time has the JIT to optimize the code during such quick and intensive JS executions. We are not in a context where the engine has a lot of free time between user interactions.
It is also used to build:
- standalone / client apps, like with NW.js or Electron.
- embedded apps, in other devices than mobiles, like with Espruino or low.js
from hermes.
It would be a pretty cool project for the community to implement. A similar approach to node-chakracore would probably work well. We (the Hermes team) would be happy to answer questions, review PRs, etc, but as @mhorowitz said, there are no plans to take it on as a project ourselves.
from hermes.
It's SO TEMPTING to tackle this.
from hermes.
Would be interesting for running CLIs, since they have the same startup speed requirements as React Native.
Especially if we could distribute a binary with Static Hermes.
from hermes.
Yes, it would be a lot of fun. But someone needs to implement it. It is a significant chunk of work that doesn't require much knowledge of Hermes internals, but requires a lot of expertise in Node APIs, filesystem APIs, module resolution, etc.
I should note that Static Hermes would make writing something like this significantly easier, because almost all of it would be in JS.
from hermes.
Running React Native code requires the native RN infrastructure, and I'm not aware of anybody having made this work in a Node environment. That is already a barrier to running CI for React Native code in node, so I think nobody is doing it today.
If someone in the community has a need for this, there's no reason they shouldn't be able to build it. I don't think it should require changes to Hermes, but we would consider PRs to Hermes if it was useful. It's just not something we plan to do.
from hermes.
Hermes optimizes for its primary metrics of startup time, size, and memory utilization. These aren't specific to React Native, but they were informed by it. In a long-running server environment, key metrics are different. Startup time an app size are only of minor importance. Servers are not nearly as memory constrained as mobile phones.
@mhorowitz AWS Lambda (serverless), and similar on Azure and Google Cloud has the same optimization needs as React Native. It is a short lived process that needs very low memory footprint. Amazon even created a special VM manager, FireCracker, to quickly create a destroy the whole environment, optimized for lowest possible CPU and memory usage, as every extra megabyte used, and extra 100ms is the money lost in capacity utilization of such cloud applications.
from hermes.
However, it would still be useful for people who want to run CI in node using hermes without needing an android simulator or device.
from hermes.
Related Issues (20)
- libc.so (SIGABRT, SIGSEGV) HOT 4
- Performance regression traversing large arrays compared to other engines HOT 4
- Hermes 0.7.2 : Max heap size was exceeded HOT 4
- hermes eslint: No sourceCode in context HOT 6
- Bug: recursion: "Maximum call stack size exceeded" HOT 2
- Wrong `DCMAKE_TOOLCHAIN_FILE` in docs HOT 3
- Intl.NumberFormat can't always display the number's sign HOT 1
- 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
- It would be good for Static Hermes if it could use pure JavaScript code(that has no type annotations) with automatic type guessing like "var" code in Dart, or ":=" in Go. HOT 7
- 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 2
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.