News for hackers. Stuff that matters.
Re:To learn a new language, read its standard library by leshow on Sunday October 24, 2021 @09:39PM (#28983663)
> In rust the standard library uses quite a bit of unsafe code, and even nightly only features and standard-library-only features that you don't usually need in real code

I have found the Rust std lib to be a great resource. Much of the unsafe is necessary because there is literally no other way to build up abstractions like Box or certain data structures without it. Obviously once those are written though, you want to build on top of them where possible and not use unsafe.

It's probably important to delineate between a good example of application code vs library code also. The std lib is not going to help much with application code.

Re:To learn a new language, read its standard library by thayne on Sunday October 24, 2021 @10:16PM (#28983860)
Exactly. The rust standard library can be very informative (and the same is true of other standard libraries as well), but it isn't necessarily going to be the same as what you would do in application code, because in application code you have the benefit of the standard library.
Re:To learn a new language, read its standard library by msdrigg on Sunday October 24, 2021 @11:06PM (#28984124)
Do you know of any examples of good quality application code in rust?
Re:To learn a new language, read its standard library by cute_boi on Monday October 25, 2021 @12:42AM (#28984552)
There are many like firecracker vm, polkadot, linkered proxy, tokio, hyper etc. And these are the one I know and I think there are too many good quality application code in Rust.
Re:To learn a new language, read its standard library by msdrigg on Monday October 25, 2021 @10:57AM (#28988541)
I wouldnt have thought of tokio as application code bc its a library, but I guess it kinda is because it also provides a runtime.

Thanks for the list