Re:Porffor: A from-scratch ahead-of-time JS engine
by canadahonk on Tuesday July 30, 2024 @07:03PM
(#41114977)
Good comparison and thanks! A few minor clarifications:
- Porffor isn't fully self-hosted yet but should be possible hopefully! It does partially compile itself for builtins (eg Array.prototype.filter, Math.sin, atob, ...) though.
- As of late, Porffor does now support basic async/promise/await! Not very well yet though.
Re:Porffor: A from-scratch ahead-of-time JS engine
by bobvarioa on Tuesday July 30, 2024 @07:00PM
(#41114961)
Contributor for Porffor here! I think this is a great comparison, but Porffor does technically support promises, albeit synchronously. It's a similar approach to Kiesel, https://kiesel.dev/.
Re:Porffor: A from-scratch ahead-of-time JS engine
by frutiger on Wednesday July 31, 2024 @12:06AM
(#41116337)
Not sure where you mean by synchronously but if you mean what I think you mean then that is not correct behaviour. This is important to ensure predicatibility.
Eg.
Promise.then(() => console.log(“a”));
console.log(“b”)
must log [“b”, “a”] and not [“a”, “b”].
Re:Porffor: A from-scratch ahead-of-time JS engine
by canadahonk on Wednesday July 31, 2024 @05:20AM
(#41117573)
This type of test does work as expected. The "sync" means that it does not feature a full event loop (yet) so cannot easily support async I/O or some more "advanced" use cases.
Re:Porffor: A from-scratch ahead-of-time JS engine
by spankalee on Wednesday July 31, 2024 @11:02AM
(#41119822)
There's a WASI async functions proposal I think? Are you looking at supporting that so you don't have to bring your own event loop?
Re:Porffor: A from-scratch ahead-of-time JS engine
by cowsandmilk on Wednesday July 31, 2024 @05:43AM
(#41117663)
JavaScript doesn’t make the guarantee you are claiming here
Re:Porffor: A from-scratch ahead-of-time JS engine
by fwip on Wednesday July 31, 2024 @10:00AM
(#41119239)
What do you mean? Does JavaScript allow the `then` of a promise to execute before the contents of the promise?
Re:Porffor: A from-scratch ahead-of-time JS engine
by jitl on Wednesday July 31, 2024 @11:36AM
(#41120126)
Yes, it does. Promise continuations always run in the micro task queue per the standard. I guess if someone mutates the promise prototype it’s not guaranteed, but the spec does guarantee this order
Re:Porffor: A from-scratch ahead-of-time JS engine
by wdb on Tuesday July 30, 2024 @06:58PM
(#41114951)
You make it sound bad to rely on LLVM.
Re:Porffor: A from-scratch ahead-of-time JS engine
by bangaladore on Tuesday July 30, 2024 @07:29PM
(#41115114)
Yeah... It is unclear to me how not using LLVM is a good thing. You'd inherit millions of man-hours of optimization work, code gen, and general thought process.
Is there a technical reason why?
Re:Porffor: A from-scratch ahead-of-time JS engine
by fabrice_d on Tuesday July 30, 2024 @08:09PM
(#41115318)
In this case, being self contained will help implementing things like `eval()` and `Function()` since Porffor can self-host. That would be much harder with a LLVM based solution.
Re:Porffor: A from-scratch ahead-of-time JS engine
by jonathanyc on Tuesday July 30, 2024 @04:59PM
(#41114086)
Just wanted to say I really appreciated the high-quality comparison. How something compares to existing work is my #1 question whenever I read an announcement like this.
Re:Porffor: A from-scratch ahead-of-time JS engine
by syrusakbary on Tuesday July 30, 2024 @06:57PM
(#41114945)
Thanks!
Re:Porffor: A from-scratch ahead-of-time JS engine
by tmikov on Wednesday July 31, 2024 @12:22AM
(#41116392)
For the record, Static Hermes fully supports compiling JS to WASM. We get it basically for free, because it is an existing LLVM backend. See https://x.com/tmikov/status/1706138872412074204 for example.
Admittedly, it is not our focus, we are focusing mainly on React Native, where WASM doesn't make sense.
The most important feature of Static Hermes is our type checker, which guarantees runtime soundness.
Porffor is very interesting, I have been watching it for some time and I am rooting for it.
Re:Porffor: A from-scratch ahead-of-time JS engine
by syrusakbary on Wednesday July 31, 2024 @01:00PM
(#41120947)
Thanks for the correction Tzvetan! Keep up the great work in Static Hermes
I've spent a bit of time trying to review each, so hopefully this analysis will be useful for some readers. What are the main commonalities and differences between Static Hermes and Porffor?
In general, I'm excited to see if this project can gain some traction so we can speed-up Javascript engines one the Edge! Context: I'm Syrus, from Wasmer [3][1] https://github.com/facebook/hermes/discussions/1137
[2] https://github.com/tc39/test262
[3] https://wasmer.io