5 ms·
To answer you seriously—I think a great contrast would be the simplicity of Go. The GC and type system are both the opposite of providing complexity to the user
by duaneb 10y ago
To answer you seriously—I think a great contrast would be the simplicity of Go. The GC and type system are both the opposite of providing complexity to the user; they provide the only way to get anything done, and it's easy to keep in your head.
For the record, I prefer rust.
- ffggvv 10y agoI would like to switch from go to rust. But rust's standard library isn't as mature as that of go. Do you think there are compatible crates to packages from go's standard library. I need * json/gzip/etc. * string manipulation * good unicode support (normalization, etc.) not much actually. And one important question: which one do you think is best for large projects? Both were built to deal with difficulties rising from large projects but took two opposite directions...
- clarkmoody 10y agoRust has a nice standard library, but much nice functionality comes from external crates. If you haven't yet, you should check out the Cargo tutorial[1], which is an intro to the package management and build system. I have used a JSON library, which worked well out of the box. I'm sure there are others up there for your other bullets. I will say that all strings in Rust are Unicode, so the support is there. Edit to your question about large projects: I think Rust's type system will prove to be a long-term benefit for large projects. The type system / borrow checker combination is the secret sauce of Rust. [1] http://doc.crates.io/index.html http://doc.crates.io/index.html
- steveklabnik 10y ago* https://crates.io/crates/serde_json [1] * https://crates.io/crates/flate2 * https://crates.io/crates/unicode-normalization "String manipulation" is a bit broad, but Rust's string types are already pretty rich. [1]: small caveat here: this crate works on stable, but is more convenient on nightly. (Think "right now it's "go generate" but eventually it will be easier than that). We're close to stabilizing the stuff that it needs to be convenient on stable, but the earliest that could land in stable is Dec 22. (I just did this math yesterday.)
- timClicks 10y agoThe Rust stdlib is indeed quite a bit slimmer, largely by design AFAICT. String manipulation and Unicode sopport are very much there. Serde (https://serde.rs/ https://serde.rs/) is probably what you're looking for for serialization tasks.
- pcwalton 10y ago> But rust's standard library isn't as mature as that of go. I'm not really sure that's true. Rust probably has a smaller standard library overall, but there are things that it has that Go doesn't: B-trees, native OS string encodings, functional tools, round(), etc. The bigger point is that the crates.io ecosystem readily has support for everything you're asking for, and it's much easier to pull in third-party dependencies in Rust.
- Gankro 10y agoI am fairly certain I successfully got binary trees deleted from the standard library. If you monsters added it back, so help me god... (BTrees, on the other hand, thrive)
- pcwalton 10y agoSorry about that. Corrected myself.
- deleted 10y ago[deleted]
- burntsushi 10y agoFWIW, in my opinion, the biggest thing that Rust has in `std` that Go doesn't is its iterator API. (I think you might have meant this by "functional tools," but just wanted to clarify.)
- kibwen 10y agoIf by JSON you need serialization, then I'd recommend Serde: https://crates.io/crates/serde https://crates.io/crates/serde (which works on stable Rust but has a nicer interface on nightly; this nicer interface should be available on stable by early next year at the latest) For Unicode support, here are crates for normalization https://crates.io/crates/unicode-normalization https://crates.io/crates/unicode-normalization and segmentation (working with grapheme clusters and so on) https://crates.io/crates/unicode-segmentation https://crates.io/crates/unicode-segmentation Re: "string manipulation" what do you need? Rust has a rich set of methods built in to its two native string types, (e.g. left-padding https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.pad https://doc.rust-lang.org/std/fmt/struct.Formatter.html#meth... :P ), and we're open to adding more if there's demand for them.