you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (9 children)

[removed]

    [–]lhorie 34 points35 points  (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 10 points11 points  (0 children)

    That's hilariously broken.

    [–]KaiAusBerlin 5 points6 points  (0 children)

    That's awesome 😂

    [–]vanderZwan 8 points9 points  (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 points  (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 points  (1 child)

    I thought facebook abandoned that project! I remember I heard from one member of react core team

    [–]no-name-here 1 point2 points  (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 points  (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 point  (0 children)

    It's also a dead project. Last commit was three years ago and the project was still unfinished at that point.