5 ms·
I think there are a few things here that are kind of unique to the js/web platform. - JS doesn’t have a proper standard library and so you tend to have many mo
by samwillis 4y ago
I think there are a few things here that are kind of unique to the js/web platform.
- JS doesn’t have a proper standard library and so you tend to have many more dependancies in a project than with other languages.
- Because of that you then have a very large tree of dependancies, often with incompatible version requirements of the same package.
- Due to the nature of needing to “bundle” your code for distribution on a “slow” network, a lot of optimisations (tree shaking, code splitting, async module loading) are required to minimise your bundle size.
- You say “We only have a few module types”, that’s two more that every other language. And they are incomparable in subtle ways.
Those and some other issues are completely unique to the web platform, they are some difficult problems to solve.
However, I think the current generation of tooling has finally got there. Vite, with its esbuild and Rollup backend is bloody brilliant. If you use a framework with official Vite support it just works.
- Bellend 4y agoWhy doesn't Javascript have a standard library? As in, why has one never been made and shipped with the browser?
- unsafecast 4y agoOh, they ship stuff akin to one, but that's the web APIs, not a “standard” library. As in it's not really standard.
- krapp 4y agoJavascript has a standard library. What Javascript doesn't have is a robust kitchen-sink library akin to other more complex general purpose programming languages, because Javascript was designed to be used in the context of a browser to script webpages, and its actual standard library reflects that. Unsurprisingly, because we've apparently decided Javascript needs to replace all existing languages in all current and future forms of application and system development, its actual standard library is no longer sufficient for many peoples' requirements. But they would rather claim the language "has no standard library" in order to justify the insane complexity of the JS ecosystem than admit that perhaps it just isn't the right tool for every job.
- fuzzythinker 4y agoSecond "Vite (esbuild) just works". I would also recommend start using bun.sh on smaller projects/scripts so you have first hand knowledge of how ready to production it is. Jarred works in an insane mode, so I wouldn't be surprised if it turns get mass adaption before deno does.
- throwaway0asd 4y agoThere have been many attempts at standard libraries that are always extremely opinionated and often introduce performance penalties and an additional layer of defects. That has nothing to do with the tremendous number of dependencies that would exist anyways if you aren’t extremely aggressive about dependency management.