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

.NET has a _huge_ platform library and you know what? It’s a pleasure. So many things are just the standard way of doing things. When things are done weirdly, you can usually get a majority in favour of standardising it.

Yes, there’s always a couple of people who really push the boat out…

 help



Yeah, IMO the small standard library in Rust is a big mistake, one of the few the language has made. When push comes to shove the stdlib is the only thing you can count on always being there. It's incredibly valuable to have more tools in the stdlib even if they aren't the best versions out there (for example, even if I normally use requests in Python urllib2 has saved my bacon before), and it doesn't hurt anything to have them there.

I don't think the situation is that comparable to python, since in python the library has to be present at runtime. And with the dysfunctional python packaging there's potentially a lot of grey hairs saved by not requiring anything beyond the stdlib.

With Rust, it's an issue at compile-time only. You can then copy the binary around without having to worry about which crates were needed to build it.

Of course, there is the question of trust and discoverability. Maybe Rust would be served by a larger stdlib, or some other mechanism of saying this is a collection of high-quality well maintained libraries, prefer these if applicable. Perhaps the thing the blog post author hints at would be a solution without having to bundle everything into the stdlib, we'll see.

But I'd be somewhat vary of shoveling a lot of stuff into stdlib, it's very hard to get rid of deprecated functionality. E.g. how many command-line argument parsers are there in the python stdlib? 3?


On the other hand, a worse implementation in the stdlib can make it harder for the community to crystalize the best third-party option since the stdlib solution doesn't have to "compete in the arena".

Go has some of these.

Maybe a good middle-ground is something like Rust's regex crate where the best third-party solution gets blessed into a first-party package, but it is still versioned separately from the language.


Non-system programmers like to trivialize choices of system programmers yet again. .NET is a GC platform running on a virtual machine. Bytecode compatibility and absolute performance are not that big of a deal on such platforms. You cannot / shouldn't run .NET on deeply embedded systems and bare metal where You want to strip as much standard library as possible and want as little magic in standard library as possible. In a language with big hosted system assumption this causes to runtime to be split and forces developers to define big API boundaries.

The use case of languages like Rust and C++ is that you can use the same compiler to write both bare-metal unhosted code (non-std for bootloaders, microcontrollers and kernels) and hosted code (uses std structures). As a system programmer that crosses the edge between two environments, I would like to share as much code as possible. Having a big standard library with hosted system assumption is a huge issue. In those cases you want the language works 99% the same and can use the same structs / libraries. Sometimes you also want to write non-std code on hosted environments for things like linkers.

Rust isn't even at the level of maturity of C yet in this regard. Rust's std / core is too big for really memory limited microcontrollers (<64 K space) and requires nasty hacks with weak ABI symbols to make things sane.

Having a huge baggage of std both causes issues like this for the users and also increases maintenance burden of the maintainers. Rust really wants to break its APIs as little as possible and small standard library is a great way to achieve that. C++ suffered a lot from this and it hampered its adoption for C codebases.


Some of these non-system programmers are ex-system programmers, coding since the mid-80's that foundly remember the days when C and C++ compilers had rich frameworks that would compete in features with what .NET and Java later came to be.

Unfortunelly too many modern system programmers never lived in that era, and are completly off on how nice the whole development experience could be like.


I think those two things are orthogonal. I'm not against somebody bundling up nice Rust libraries and providing a pre-install package or providing nice GUIs around (like Borland used to do and Qt still kind of does). Or an OS providing a nice set of libraries.

However, the standard library of a systems language has a special relationship with the compiler. This is the case for C and C++ where the compiler and the standard library also has a special relationship with the platform like GNU or musl with Linux, or MSVC and Windows. It makes changing APIs or modernizing infrastructure almost impossible without creating an entire new OS and porting all compilers and standard libraries to it. Moreover the newer C++ standards actually force you to define such a relationship (with std::initializer_list and threading stuff). It is basically impossible to make an OS-agnostic C++ compiler that doesn't leak its and platform's internals to the user.

Luckily Rust mostly abstracts around the platform-compiler boundary and its standard library so the platform dependencies are implementation details. Unlike C and C++, one can write Rust without caring about how the underlying OS does ABI. However, Rust compiler and Rust std has a special relationship. `Box` can only be defined as part of Rust standard library that's compiled together with the Rust compiler itself. Its special relationship is kind of a blocker for -Zbuild-std and std-aware Cargo which prevents size-optimizing std for embedded systems. Without that magic (i.e. compiling the compiler itself, or worse bootstrapping it) you cannot independently create a `Box`.

I want this kind of library to contain as little as possible since it is convenient to define these kinds of relationships and rely on magic. Modern C++ has too much such magic. Rust is mostly on a correct path with std, core, alloc etc. separations. These kinds of boundaries make it possible to share as much code as possible with many libraries without finding hacky ways around std (which you have to do with C++).

This doesn't mean that I wouldn't appreciate more actual functional libraries maintained by Rust Foundation-funded people and be part of the project or even easily installed. However those libraries should be effortlessly exchangeable. I think current Cargo ecosystem achieves this mostly. However I would appreciate a more curated Cargo repository that contains only a limited set of really well maintained packages (similar to Maven's repos in Java world).


Why didn't those artifacts/relics survive into the modern era?

There's also something about the early 00s that made software developers go crazy in Java land that they decided to over engineer software for no real benefit and come up with overly complex architectures that don't really address the core issues but rather imagined issues that turn out to not be that important in practice.


They did survive, Qt, VCL, FireMonkey, POCO, but the dark energy of the Electron force it too mighty.

Also in the 2010's we had the rise of scripting languages, thus we have a whole generation that never used compiled languages and are now re-discovering systems programming via Rust, Zig and co.

A history lesson, before OOP, there was Yourdon Structured Method, and plenty of C enterprise architects jumped into it.

The GoF book used Smalltalk and C++, predating Java by a couple of years.

The Booch Method used C++, and predates Java for a decade.

Ah and there was that whole operating system written in an OOP C dialect, including its drivers, NeXTSTEP, which also survives to this day, with more consumer deployments than the Year of Desktop Linux.




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

Search: