Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Look...

What if Arc and Rc weren't in the standard library, and you had to import them via a crate, and multiple different (incompatible) implementations existed such that you couldn't use them at the same time?

Would that be ok?

How about Option and Result?

What if you could only use crates that used the same error library that you wanted to use?

What about boxing and custom allocators? Can you imagine if different crates could opt into different allocators and you couldn't safely drop an object without passing it back to the crate it came from because 'who knows' what might happen if you try to deallocate it using your allocator?

Should we not ship a default allocator and make that an optional thing too?

...

That isn't a language I want to use.

I'll take 'it comes with a default allocator' and that's good enough for me. If one day I get a stable 'you can pick, seamlessly at the top level, which allocator to use for your entire program', that's awesome!

...but it does not in any way mean, that I want a rust with no default allocator.

The default allocator is great. It works perfectly for most things most people need, and it 'just works', out of the box, the first time you use rust.

Async should work out of the box. It doesn't. That sucks.



> How about Option and Result?

This is somewhat of the case with many different Result/Error crates doing their own thing. So being in standard lib isn't a guarantee it won't fracture.

> What if Arc and Rc weren't in the standard library, and you had to import them via a crate, and multiple different (incompatible) implementations existed such that you couldn't use them at the same time?

First that's not currently what is happening in Rust. Second, I'd probably use the most popular and active one. Same as in JavaScript or Python.

I think my criteria for what is in the standard lib is following: How often does the domain change? And should it come out of the box?

E.g. are we inventing new ways to parse JSON? Yes ? Out of the standard lib you go. Is ARC/RC being reinvented? No? Go to standard lib.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: