4 ms·
Indeed. Perhaps some examples of how Rust is? Would be interested why you think that.
by goolz 3y ago
Indeed. Perhaps some examples of how Rust is? Would be interested why you think that.
- zgk7iqea 3y agoBecause of the minimal standard library, the ecosystem is fractured into crates (similar to npm). Also, rust forces you to actually model the complexity of the real world. I think the best example for this are the various string types. There is one for Interop with C, one for Paths, one that is utf-8 etc. Your code explicitly states what to do with edge cases. Edge cases that existed anyway but are now visible. Don't get me wrong, I don't dislike Rust. It's an awesome language.
- vlovich123 3y agoCompared to C/C++, I’d say the Rust standard library is very feature full. Regarding crates, they are super easy to pull in compared with random C/C++ libraries, and the crates generally are fairly high quality.
- rastignack 3y agoI would say that having methods like ‘and_then_if_finally()’ or ‘then_unwrap_or_none_and_map()’ (I’m barely exaggerating) is less of a feature than say, json parsing and hashing / crypto, which are sorely missing. Tokio provides a bit more features, but is a damn huge runtime to depend on, and is creating fragmentation. I feel rust needs to be taken out of the hands of former c++ devs / language theorists and put straight under responsibility of library design experts (rip off go’s stdlib for gods sake!)
- cookieperson 3y agoGo and rust are not the same thing. Go is fine for what it is if you agree with it's opinions. But a lot of people are reaching for rust for different reasons then someone would reach for go. It makes sense that their std libs are different... Especially knowing the differences in the languages themself. You aren't forced to use the more obscure methods in std. You can almost always recreate them with simple code and suffer no real performance or readability hits. Former c++ devs are smart people. I work with some, and value their input specifically when designing libraries...
- vlovich123 3y agoJSON is handled well enough by serde which is extremely popular. Rust also has various string manipulation utilities and an insanely fast and high quality regexp implementation. Crypto isn’t a core competency for the standard library authors and this it’s better to offload that responsibility. Maybe once a library becomes de facto in the community (ring?) then it might make more sense. The other reason to prefer a smaller standard library is that it can often be difficult to strip away the unused bits from the resultant binary. Rust statically links which hopefully fixes most of this, but I suspect possibly not all. I agree they need to standardize an effect system and unify async so that there’s a way to plug in arbitrary runtimes.
- SAI_Peregrinus 3y agoCrypto MUST NOT become part of the Rust standard library, because Rust's compatibility guarantees would have to be broken when any underlying cryptographic primitive or protocol is broken (or worryingly weakened) and needs to be removed. While that could be done with the "unsoundness fix" escape hatch, it's better to minimize such changes. I'd like to see an "extension" library managed like the standard library (and shipped with Rust, included in the prelude, etc) but with SemVer, so that breaking changes could be made more easily.
- rastignack 3y ago> Crypto isn’t a core competency for the standard library authors and this it’s better to offload that responsibility. Ring is mostly C/Assembly. Good bye safety ! Offloading core security routines is such a bad design. > The other reason to prefer a smaller standard library is that it can often be difficult to strip away the unused bits from the resultant binary. It’s actually already handled quite well, and could also be behind feature flags. Really, a standard library with feature flags and editions would make rust ridiculously much more productive… such a waste.
- GreedCtrl 3y agoFor crypto, isn't assembly used to help prevent timing attacks? I don't know if that can be done in pure Rust.