I mean, sure, that’s probably heavily influenced by the need for bundling for the frontend.

But it isn’t done blindly. Bundlers reduce the overall size of the code, either due to minification or tree-shaking (removing unused modules). It also removes the filesystem overhead of resolving and opening other modules.

Would bundling be useful in other interpreted languages?

I suppose you may count JVM’s compilation to bytecode as being very similar.

  • @[email protected]
    link
    fedilink
    111 year ago

    Lots of people consider it an advantage, that interpreted languages don’t require a separate compilation/bundling step. Most shell scripts or Python scripts, you can just grab the code for and run them.

    But yeah, for anything more complex, you need libraries and you likely want to distribute additional files, like documentation or web content files, or you may even want to just hand out the runtime to the user, so that you don’t run into breaking changes between Python versions, for example. For all of these, a bundling step in some form is necessary.

    You can also, for example, pre-compile Python, to try to mitigate its slow execution speed…