facebookarchive / prepack

A JavaScript bundle optimizer.
http://prepack.io
Other
14.22k stars 425 forks source link

Is prepack dead? #2639

Open sandipp opened 4 years ago

sandipp commented 4 years ago

I don't see any active development going on here. Is this dead-ended project? Can it be ever be useful for production use?

s0kil commented 4 years ago

@sandipp https://github.com/facebook/prepack#status

sandipp commented 4 years ago

@s0kil thanks for pointing but it's not very elaborative and doesn't tells any specific timeline.

cztomsik commented 4 years ago

Could anybody do short write-up of what's missing and what were the biggest challenges, where would you continue if you had time, etc? I was playing with the idea of doing something similar in rust and I think this would help a lot - not just me but also other people interested in the project.

Don't want to be rude but maybe @hermanventer @NTillmann @trueadm could drop a word here? :-)

hermanventer commented 4 years ago

The short story is that no one currently at Facebook seems to have a scenario in mind where they believe that Prepack can be of use. As such, the project is unlikely to get revived and there seems to be agreement that we should archive it.

The biggest challenge with Prepack is that you need the whole program along with an accurate model of the environment it will run in. Even then, you can only really run it on global code (or code that is known to only depend on state that is set up by the global code and never modified later). This is a very specialized scenario and setting it up properly takes a considerable investment. So far, I am not aware of anyone currently pursuing such a scenario.

Another big challenge is that Prepack is built on top of Babel and requires source code to be lowered by Babel into EcmaScript 5. As JavaScript engines improve in their support for later editions of JavaScript, this limitation will become a performance problem. Updating Prepack to the latest JavaScript edition will be a lot of work. Likewise dropping the Babel dependency will be challenging.

If I had to do it all over, I would stick to my original plan and use Flow as the basis for Prepack.

Right now, however, I'm fully engaged working on a verifier for Rust (see https://github.com/facebookexperimental/MIRAI). If anyone has a scenario for doing Prepack style optimizations based on the heap analysis of MIRAI, please feel free to reach out directly to me (hermanv@fb.com) and we can set up a VC to chat about it.

VictorQueiroz commented 2 years ago

It seems Prepack can only live in a time where ECMAScript really receives what it needed from the beginning: A more descriptive syntax together with static types. But don't we all?