Rust beginner notes & questions

I’m on mobile so this will be somewhat brief :slight_smile:

Rust stdlib is intentionally kept thin - this is a frequent point of debate and contention. This is generally mitigated by the ease of integrating external crates and the type system allowing implementing traits for foreign types. From a user’s perspective, they add a dependency on num and off they go. I don’t see the "total failure" in this regard?

The same can be said for the itertools crate that you mention.

It’s naturally the case that most uses of futures are for IO. But the trait itself is pretty generic - there’s nothing IO about it.

I agree that a read_to_string doesn’t belong there at the conceptual level. I suspect it’s just a convenience for users given how frequent this is.

But this trait is for reading bytes, which is the atom of data, from somewhere. It’s a low level interface. It’s not intended to be generic over some T. You can build that streaming aspect on top, which is essentially what crates like Tokio do.

Lots of things deref to a slice. You mentioned a "list" which I take to be a Vec - that derefs to a slice and so you can use that function on it.

I don’t think you can split mods across files but you can split impl blocks across files for some type. You can also use some of the include macros to have the compiler “copy/paste” content of another file, which can help with codegen.

Suppose One and Zero were in std, and itertools as well. And Read didn’t have the String method. What’s your take on Rust then? :slight_smile: Your comments are a bit all over the place (topic wise) and I can’t quite tell what is preventing you from being productive in Rust.

5 Likes