frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Ask HN: What should be included in a standard library?

5•vodou•14h ago
I know, I know... There are countless "it depends" baked into this question. But let’s try anyway.

After reading HN for years, I have encountered so many opinions regarding standard libraries in various programming languages, e.g., how they should be designed, what they should (and should not) include, etc.

The C standard library is very minimal, focusing mostly on low-level facilities. Everyone is expected to implement their own dynamic arrays or choose one implementation from a zillion available libraries. And, apparently, null-terminated strings are the work of the devil. C++ has a much more extensive standard library, built around generic programming techniques using containers, iterators, and algorithms applied in a composable way. It is rather elegant and powerful, but not very intuitive for beginners. It also has some notable omissions compared to more modern languages. Python comes with "batteries included" in the form of a very rich standard library. However, the PSF tends to "break user space" from time to time by deprecating older modules, such as “boring” technologies like CGI or modules with known security problems. (I am not comfortable enough to say anything about JS, Go, Rust, etc.)

So, what would a great standard library look like? What would make you happy? What have we learned about this after 50+ years of computing? Do you want everything from linked lists to red-black trees (and beyond)? Graphics and sound? (Even if no single API can please everyone.) XML? YAML? SIMD abstractions? Where do you even stop without causing anger? Where do you begin?

(No, I am not creating a new programming language. Enough is enough.)

Comments

rickcarlino•14h ago
I love this question.

HTTP server and related parsers (just a basic one), URL parsing and escaping, JSON, Socket handling, timers, interactive debugger, basic templating library, WebSocket client, SQLite.

I think Ruby got it right in this regard and Bun comes close as a second place.

bjourne•12h ago
Like Wikipedia tries to catalogue all useful knowledge in the world, a standard library should catalogue all useful modules in the world. The problem is that tools and community structures we have are not advanced enough to support that workflow yet. E.g., it's difficult to see how you could put PyTorch into Python's standard library and have all developers happy with that. But it would make a lot of "meta" issues easier, such as release management, consistent documentation, community relations, etc.
moomoo11•9h ago
Go has a nice std, and interfaces that make it easy to add on top instead of reinventing the wheel.

I think as long as a language offers the basics (like streams, etc) it’s not that bad to build on top of it.

mikewarot•8h ago
If you can possibly include the "magic" strings that Free Pascal has, you'll be light years ahead of just plain C strings. They're counted, reference counted, and copy on modify. You don't have to allocate/free them, and they can contain gigabytes of ASCII, Unicode, or Binary data.
bruce511•2h ago
I like to think of this as a analogy to biology. Consider this question in the context of say DNA. What DNA strands should be present in the "standard library".

In practice there's no right answer to this - I mean sad library for plants? Animals? Fungi? The question quickly becomes meaningless because without a lot more context there's no right answer.

In the scope of language - is this for embedded programs? Desktops? Phones? Is it for system components? Is it going to talk to hardware? Or networks? Is it headless or heavy UI? What OS is it running on? Is it for writing CRUD apps? Or games? Will it be used in space?

Every context brings different trade offs. Different boundaries, different resources, different everything.

Thus every answer to your question is both true for some places, and false in others.

Thus variety in context is what leads us to the current situation- lots of options.

Ask HN: What's Your Useful Local LLM Stack?

66•Olshansky•18h ago•39 comments

Ask HN: Is it time to fork HN into AI/LLM and "Everything else/other?"

454•bookofjoe•19h ago•347 comments

Ask HN: Is anyone using Super Grok Heavy for code?

10•rickcarlino•6h ago•4 comments

Ask HN: What is the best way to learn 3D modeling for 3D printing?

11•wand3r•10h ago•13 comments

Ask HN: How do you stay on top of AI tech?

9•kleiba•13h ago•15 comments

Open Source Multimodal Semantic Search

3•itstomo•7h ago•0 comments

Question: Has anyone used mcp in production?

6•fazkan•11h ago•0 comments

Ask HN: How did Soham Parekh get so many jobs?

319•jshchnz•1w ago•417 comments

Ask HN: What should be included in a standard library?

5•vodou•14h ago•5 comments

The IDE isn't going away

7•williamzeng0•16h ago•5 comments

Ask HN: Did Anyone Here Lose Interest in Coding After a While?

4•OulaX•16h ago•2 comments

Ask HN: What is your window management solution?

3•atommachinist•18h ago•9 comments

The German Works Council has blocked Amazon's performance reviews

29•jerrryyy•1d ago•10 comments

Ask HN: How much of OpenAI code is written by AI?

67•growbell_social•2d ago•62 comments

Is Firebase Console Down

5•techlover14159•1d ago•2 comments

Telnyx launches automatic noise suppression for AI Voice Agents

4•maevesentner•1d ago•1 comments

Ask HN: How to find mentors while working remote?

7•basketbla•1d ago•3 comments

Ask HN: How is my MacBook temp getting misread?

4•GWBullshit•1d ago•8 comments

Ask HN: How are you productively using Claude code?

22•nocobot•3d ago•19 comments

Ask HN: Is it true that early humans were more 'gatherers' than 'hunters'?

5•I_Nidhi•22h ago•8 comments

Cyberpunk and Politics: Neon Dystopias, Power, and Resistance

8•ricecat•1d ago•5 comments

Cloudflare DNS Down in UK/EU

14•suddengunter•1d ago•0 comments

Cloudflare's 1.1.1.1 DNS server seems to be down

30•WeaselsWin•1d ago•7 comments

Tell HN: Lobste.rs blocking the Brave browser

15•prmph•2d ago•15 comments

Dyan – A Visual REST API Builder You Can Self-Host

3•0018akhil•1d ago•0 comments

Tell HN: I Lost Joy of Programming

94•Eatcats•1w ago•130 comments

Ask HN: Are there any tools for tracking GPU prices over time?

4•jepeake•3d ago•6 comments