News for hackers. Stuff that matters.
Re:Porffor: A from-scratch ahead-of-time JS engine by bobvarioa on Tuesday July 30, 2024 @07:04PM (#41114985)
Contributor to Porffor here! I actually disagree, there's quite a lot that can be improved in JS during compile time. There's been a lot of work creating static type analysis tools for JS, that can do very very thorough analysis, an example that comes to mind is [TAJS](https://www.brics.dk/TAJS/) although its somewhat old.
Re:Porffor: A from-scratch ahead-of-time JS engine by attractivechaos on Tuesday July 30, 2024 @10:11PM (#41115890)
> there's quite a lot that can be improved in JS during compile time

I wonder how much performance gain you expect to achieve. For simple CPU-bounded tasks, C/Rust/etc is roughly three times as fast as v8 and Julia, which compiles full scripts and has good type analysis, is about twice as fast. There is not much room left. C/Rust/etc can be much faster with SIMD, multi-threading and fine control of memory layout but an AOT JS compiler might not gain much from these.

Re:Porffor: A from-scratch ahead-of-time JS engine by itsTyrion on Wednesday July 31, 2024 @04:44AM (#41117408)
Honestly, I’m fine with only some speed up compared to V8, it’s already pretty fast… My issue with desktop/mobile apps using web tech (JS) is mostly the install size and RAM hunger.
Re:Porffor: A from-scratch ahead-of-time JS engine by mst on Wednesday July 31, 2024 @08:25AM (#41118614)
[raises hand] I'd be fine with no speedup at all if I can get more reasonable RAM usage and an easily linkable .so out of the deal.
Re:Porffor: A from-scratch ahead-of-time JS engine by attractivechaos on Wednesday July 31, 2024 @05:10PM (#41123490)
The "node" binary on my laptop is 45MB in size. I guess the browser component may take more disk space than JS runtime. Similarly, I am not sure whether JS runtime or webpage rendering takes more RAM. If it is the latter, an AOT compiler won't help much.
Re:Porffor: A from-scratch ahead-of-time JS engine by jitl on Wednesday July 31, 2024 @11:32AM (#41120097)
In my mind, the big room for improvement is eliminating the cost to call from JS into other native languages. In node/V8 you pay a memcopy when you pass or return a string from C++ land. If an ahead of time compiler for JS can use escape analysis or other lifetime analysis for string or byte array data, you could make I/0 or at least writes from JavaScript to, for example, sqlite, about twice as fast.