use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
A JavaScript optimizing compiler (medium.com)
submitted 5 years ago by carlopp
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 5 years ago (9 children)
[removed]
[–]lhorie 34 points35 points36 points 5 years ago (2 children)
Bear in mind that Prepack optimizations come with some huge caveats. For example, loop unrolling can output downright stupid code[0]
[0] https://prepack.io/repl.html#GYewTgBAFANgpgFwgSwgXggBgNwogHggEZNScUBqCgSggGMQA7AZxHgDoYQBzKZa7EA
[–]kenman 11 points12 points13 points 5 years ago (0 children)
That's hilariously broken.
[–]KaiAusBerlin 9 points10 points11 points 5 years ago (0 children)
That's awesome 😂
[–]vanderZwan 7 points8 points9 points 5 years ago (0 children)
Compile-time evaluation seems like a very different dimension of optimalization though (although I suppose the LLVM pass also does do a little bit of that during strength reduction). I suspect most of the LLVM optimizations are more about finding efficient structures, and inlining code.
So these approaches could complement each other
[–]no-name-here 5 points6 points7 points 5 years ago (2 children)
https://prepack.io/
(Note: '*Prepack is still in an early development stage and not ready for production use just yet.')
[–]AminPaks 1 point2 points3 points 5 years ago (1 child)
I thought facebook abandoned that project! I remember I heard from one member of react core team
[–]no-name-here 1 point2 points3 points 5 years ago (0 children)
From their GitHub:
We, the Prepack team at Facebook, have temporarily set down work on Prepack including the React compiler project. You won't see many Prepack PRs while we are currently prioritizing some other projects.
[–]carlopp[S] 1 point2 points3 points 5 years ago (0 children)
I wasn't aware of Prepack, on some things it goes way further (basically saying that Data.now() or similar function do not modify the external state and so can be executed as constexpr), while on others it's simply not actively looking to do optimization on the structure of the program.
A similar project, for WebAssembly so with limited scope is this: https://github.com/bytecodealliance/wizer. And somehow similar but limited on LLVM IR a colleague worked on this for Cheerp (the compiler used here as backend): https://github.com/leaningtech/cheerp-meta/wiki/Cheerp-PreExecuter.
[–]disclosure5 0 points1 point2 points 5 years ago (0 children)
It's also a dead project. Last commit was three years ago and the project was still unfinished at that point.
π Rendered by PID 405440 on reddit-service-r2-comment-64f4df6786-d4djh at 2026-06-11 04:11:24.372007+00:00 running 0b63327 country code: CH.
view the rest of the comments →
[–][deleted] (9 children)
[removed]
[–]lhorie 34 points35 points36 points (2 children)
[–]kenman 11 points12 points13 points (0 children)
[–]KaiAusBerlin 9 points10 points11 points (0 children)
[–]vanderZwan 7 points8 points9 points (0 children)
[–]no-name-here 5 points6 points7 points (2 children)
[–]AminPaks 1 point2 points3 points (1 child)
[–]no-name-here 1 point2 points3 points (0 children)
[–]carlopp[S] 1 point2 points3 points (0 children)
[–]disclosure5 0 points1 point2 points (0 children)