Comparison with python actually helps to put Rust in a positive light. Compared to the Python 2/3 debacle, Rust managed to introduce a major new version with lots of new language features (edition) while making it: a) entirely opt-in, b) easy to update to with automated tooling, and c) compatible with previous versions.
Compare this to Python 3, which cannot load Python 2 libraries, cannot be converted automatically, and is now effectively required with the sunsetting of Python 2 in January of this year. Python has a lot of strengths, and I think 3 is way better than 2, but the transition was very painful.
Meanwhile, I have a crate I wrote a while back for 2015 nightly, and it took me less than an hour to get it up and running for 2018 stable. But I didn’t have to! Everyone using 2018 (nightly) could still use the crate even if I hadn’t converted it.
Small packages means more packages, and more packages compounds the dependency graph which:
- makes dependency resolution harder
- means more points of failure
- makes auditing difficult
- makes install time longer
- leads to harder maintenance and upgrade
This also causes heterogeneity in the mass of your dependencies:
- it splits the resources for documentation, testing, tutorial, etc
- it ensures very weak integration between various building blocks, forcing everyone to rebuild glue code again and again
- it makes discovering the proper solution to your problem harder as you must chose a combination of dependencies instead of one
- it makes contributing to the project harder, especially to junior profiles, and increases the price of on-boarding
- eventually, it leads to a culture that pushes the "libs versus frameworks" so far you never get a decent framework for anything. This is why there is no JS equivalent to RoR or Django.
There is, of course, a balance to reach. You don't want a lib that does everything.
Doesn't this happen because of package manager duplication? I think npm lets packages have their own copies of their dependencies. Since we have a lots of small, widely used packages, they get duplicated at numerous points in the dependency graph. The number of files and installation size explodes.
A big part is the development toolchain, which would be installed at a system level for most languages.
I started a vue project last night, npm install --production installs 4 packages. With dev dependencies, I get 2300 packages. Eslint, babel, webpack, etc bring in lots of luggage
BTW, I think 19000 is wrong, on a fresh node_modules I get:
$ npm install gatsby
...
+ [email protected]
added 1773 packages from 733 contributors
and audited 23706 packages in 52.317s
$ du -sh node_modules
245M node_modules
Not sure where the "audited" number comes from, but its not the number of install packages. I get 2737 directories containing a package.json, 1477 of which are uniq.
"Luckily, most of them are using the same version of lodash, which just needs one lodash to install inside node_modules. This is often not the case with real-world production projects. Sometimes, different packages require different versions of other packages."
Npm lets you install several versions of the same package. This has the advantage of saving the dev the testing of their lib with a wide range of dependencies versions: it almost always works. Unfortunately, that means most devs just choose one version and call it a day. They build libs like one would build a project: as you were alone in the world.
Because of the small stdlib, you need dependancies, sure.
But why this idea that each dependency must be very small, forcing you to install a hundreds childs, which, themselves, will install a hundred until the pyramid of files start to turn node_modules into a stress test?
One idea that probably got encoded in the culture is that this code would also have to ship to the client. By having small deps, nobody had to wait around for more advanced tree-shaking (and its idiosyncrasies) to enter the picture.
The problem is not small packages or huge dependency trees. It's the fact widely used packages have to be installed at all. This is compounded by the package manager which allows packages to have independent copies of their dependencies.
We should have a de facto standard library that gets distributed along with the language's reference implementation. Widely-used packages that have a stable and well-designed interfaces should be distributed by default. If something isn't being used anymore, it can be dropped from the standard library while still being available from the repositories.
The problem is not small packages. The problem is there are many of these small libraries trying to solve the same problem (extending the small standard library more). And when there are no clear winners your dependency tree will be full of packages trying to do the same.
Which is weird. I would have expected have the leftpad scandal that the community would have found a balance.
To me, culture is a feature, and despite using JS a lot since it has a monopoly on the browser, the community culture never clicked with me.
I often feel like they are reinventing the wheel, not learning from other techs solving the same problems, under and over-engineering, regularly guilty of the XKCD 927 syndrom.
Few projects taste integrated, working together, clean. The stacks looked like hacked together. Agreement on best practices and conventions are timidly showing up. It also seems popular tools are just starting to stabilize and the breaking modifications rhythm to slow down. At least more than anywhere else I worked.
There is no way I can be objective saying this, but anyone with the same feeling?
1) JavaScript is a first language for many, many new developers, especially the ones not coming from a formal computer science program. This is because it's multi-paradigm, extremely hireable, runs on everything, runs on the web specifically, and other reasons. If you're only going to learn one language, it's a very good and versatile choice. So its community has a lot of inexperienced members.
2) Because it's such a focal point of the industry, it gets a lot of attention from major players as well and has been evolving rapidly in terms of core features. These features usually get tested out first in the form of packages.
3) Being a dynamic language it's very easy to extend and hack. The prototype system even allows you to modify the behavior of its core primitives.
4) The more experienced devs who use it are often dissatisfied with the qualities of the base language, and so take advantage of its flexibility to try and extend it into what they think a good language is (see TypeScript, Ramda, RxJS, etc).
The response to the leftpad scandal was for NPM to disallow packages being unpublished once they've been out for 72 hours, which really should've always been the case.
Separating the IO from the rest of the program is always a good practice, that we keep rediscovering.
E.G:
- UI in React are trying to be just rendering functions with one input and one output. Even more so with hooks.
- in python, there is a new trend of providing "Sans I/O" (https://sans-io.readthedocs.io/), and async/await are not just keywords, but a generic protocol created to delegate I/O to something from outside your code.
It's interesting to see that on very old systems, even the hardware was organized that way.
The book Propaganda is good, but you can feel the naive vision of capitalism, corporation and power in general. The author seems to genuinely believe the invisible hand will balance things out, that people won't abuse their power and that ethics were a stronger motivator than money in the system.
This is a false dichotomy and assumes there are only two choices:
- not handling the pandemic
- tracking the population
You can get information about people assembling in other ways:
- helicopters
- intel gathering
- cops and army patrolling dressed as civilian
- create groups of citizen in town responsible to patrolling
And probably many I don't know about.
Then you add to that: keeping to communicate with the public, testing a lot, providing masks, etc.
The fact you are using this argument shows how much powerful the culture about "the end justify the mean" and "trusts the authority to deal with this" is.
I remember the first time I saw Jack Bauer on TV decapitating a terrorist in 24 to get an information. I though, "wow, they are really creating a new normal here".
That's what it is about: creating a new normal. And pretending there is no other choice, while nobody is trying to provide any.
There's no pretending there is no other choice, this already is a proposal for that "other choice". Contact tracing certainly isn't new, it's a required step in tackling many infectious diseases and will happen whether or not it is assisted by digital means. The technical alternatives to the tiny part proposed here are coarse and many of them more invasive in terms of privacy. This proposal is specifically designed to prevent tracking populations, it also limits the number of necessary off switches to the two OS vendors. What exactly is the part of the "new normal" you are worried about here? I hope it's not people walking around with tracking beacons in their pocket, they already do that without giving it a single thought.
It’s not about “people assembling” at all. It’s about individual prolonged contacts, possibly accidental (mass transit), with an infected person, allowing much more targeted (as opposed to current blunt tools like shelter at home orders) suppression of the disease.
> Public safety is not a human right, while privacy is.
Seriously? “Everyone has the right to life, liberty and security of person” is literally Article 3 of The Universal Declaration of Human Rights - and 1&2 are “this applies to everyone; yes, we mean it”. Privacy is all the way down in Article 12.
I’ll take my life, health and freedom, for which targeted suppression of this disease is essential, over my privacy any time, thank you very much.
Some complains it's moving too fast.
Some that's it's an old language that's stuck in the past.
The balance between stability and keeping up with modernity is hard to reach, and people will never be happy.