Better Batteries

50 points by olex


Wilfred

This is the wrong question to ask. The right one is:

Which social architecture creates a high-quality standard library?

This is an extremely helpful framing, and I enjoyed the post.

I do think the availability of package managers have changed the dynamic. Python predates npm-style managers and Go has iterated on its packaging approach in recent years.

I like to think about how do we enable a single enthusiast in a domain to ship a reusable solution? Most small-medium OSS projects have a single maintainer.

Allowing our enthusiast to iterate on the API (stdlib breaking changes are hard) and easily release feels like the best option in a modern language toolchain.

aarroyoc

Yes! I've never been against languages with batteries included. In fact nowadays I prefer them. It's one of my biggest issues with Rust, but the problem also exists in Haskell. Funnily enough, in Node.js, which gave birth to npm, you can now do many stuff without external dependencies (last one I've seen are the sqlite functions).

But yes, in languages with batteries included sometimes they feel like an afterthought. It's not just Python. Java also used to have a big standard library, with many useful things including GUI programming which has been neglected a little bit.

ohrv

To flip this a bit, we can consider the cost of maintaining and breaking APIs in a big standard library: we remove costs from users and move them to the maintainers. We buy stable APIs that allow interoperation across the ecosystem.

Even with infinite money, having an std crate for crypto is probably only going to stifle innovation (==go), because almost nobody needs interoperability of crypto APIs.

Having a terrible hashmap will similarly cause fragmentation because a lot of people need to build APIs around it (==cpp), having good std allocator first class will force the users to support allocator interoperability (==zig).

Of course, there are a lot of grey areas (errors in Rust is a known example in both directions), but IMO a small std is only a problem in low trust society, so improving trust is much more important that increasing the size of the std.

mwcampbell

Rust is an interesting case. The 1.0 standard library APIs are brilliant. Collections and iterators are a work of art.

I agree about the collections and iterators. I think the things that ended up exclusive to std rather than core or alloc are more uneven. A few months ago, around the Ubuntu 26.04 LTS release that introduced uutils to an LTS distro, wasn't there some criticism of the Rust standard library's filesystem API?