How to try Static Hermes #1137
Replies: 12 comments 60 replies
-
I cloned the repo, switched to > hermes index.js
LLVM ERROR: Generating HBC bytecode disabled in Static Hermes You can execute static-hermes bin though using the command below. > shermes -typed -exec ./index.js
6 ms, 3.7330486176528693e+164 Code I tried to execute: function bench (lc, fc) {
var n, fact;
var res = 0;
while (--lc >= 0) {
n = fc;
fact = n;
while (--n > 1)
fact *= n;
res += fact;
}
return res;
}
let t1 = Date.now();
var res = bench(4e6, 100);
print(Date.now() - t1, "ms,", res);
|
Beta Was this translation helpful? Give feedback.
-
There are no binaries, and be warned: it is not ready to be tried out, since what works or doesn't is not documented, or it may even change or regress from commit to commit. With that said, if you insist on trying it, you need to build it. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am also very curious about static hermes. I tried to compile it and run it and was able to do some things. I noted down my steps here: https://medium.com/@gautam1168/compiling-typescript-to-native-code-0238d69ca582 I am not sure if sharing this is not appreciated since I am obviously not familiar with hermes and so might have done many things that could mislead someone. If that is the case you can delete my comment or I will if you tell me to. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I had not even expected that my post will be read by so many people including yourself. This email made my morning.
I will update my post tonight to note how to compile in release mode. And I was going to try debugging using visual studio. I will attempt to get the typescript code to show up in my native debugger. Thankyou for that pointer.
Yours sincerely,
Gaurav Gautam
…On Thu, 5 Oct 2023 at 23:15, Tzvetan Mikov ***@***.***> wrote:
We absolutely welcome posts like this and thank you for sharing it.
I would add just a few clarifications:
1. The instructions in your blog post compile Static Hermes in debug
mode, so it will be very slow.
2. The C output is a temporary feature to simplify our development (C
code is easier to understand than LLVM IR). You can use -g to annotate it
with #line directives, which actually enable you to partially debug the
original JS in a native debugger.
3. TypeScript support is experimental and incomplete (but we are
always improving it).
—
Reply to this email directly, view it on GitHub
<#1137 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBZ6O4CSECQVWXDZS4AHJJTX53W27AVCNFSM6AAAAAA5N3XTHCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TEMBRGUZTS>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I spent an evening creating a turn-key example of using shermes with typescript here: I tried my best to automate a bunch of concepts found in the other examples...
hello-world: https://github.com/thejustinwalsh/sh-raylib/blob/main/src/hello-world/hello-world.ts bunny-mark: https://github.com/thejustinwalsh/sh-raylib/blob/main/src/bunny-mark/bunny-mark.ts Not for the faint of heart, but lots of fun to hack on! I still don't understand a good strategy for managing the lifetimes of the heap allocations vs the JS objects that rely on them. I hope this helps anyone else who is interested in hacking on it. |
Beta Was this translation helpful? Give feedback.
-
I really want some |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
2700 commits ahead of main. Did you guys write any documentation 😅? |
Beta Was this translation helpful? Give feedback.
-
@gauravgautamapptile Nothing works. Everything logs Lastly I tried Has Static Hermes changed the way that I have to link my .o file? Also I am 100% certain that the It'd be nice if Meta wrote documentation for the project. |
Beta Was this translation helpful? Give feedback.
-
I was trying to run the static hermes from the static_h branch. Compiled the binary and starting using it and it worked exceptionally well. code:setTimeout(() => {
print("hello world!")
}, 250); Command: Error:
Is this expected? Sorry I am new to this and could not find any docs around same in the repo. |
Beta Was this translation helpful? Give feedback.
-
I couldn't decide if this is an appropriate place to request features for static hermes, so apologies if this isn't the right place. I ran into the error I'm not sure if you need any sample projects that use native JS classes, but while Zod itself is written in typescript, when its compiled to JS and uploaded to NPM, the library does use them. |
Beta Was this translation helpful? Give feedback.
-
How can I try static hermes with reactive-native on my mobile device? |
Beta Was this translation helpful? Give feedback.
-
Are there binaries distributed to try out Static Hermes or should you build it by yourself from the branch?
Beta Was this translation helpful? Give feedback.
All reactions