Live data from Hacker News

100 days with Rust: a series of brick walls

brandur.org

21–30 of 323 posts

Re: 100 days with Rust: a series of brick walls

#21
post #19

I was following along until this: > universally terrible documentation and lacking examples, unstable APIs, type annotation hell, and so much more. The docs in Rust are by far some of the best I've seen, without specifics it's really hard to understand what issues he hit.

They're completely different kind of docs that Python's. Python's are written by hand, with many examples and tips how to use the various tools. Rust's documentation very much feels generated, and the last time I checked methods were not grouped. So vast portions of a page are consumed by variants of methods (overloaded methods?) which work exactly the same except they take different argument type. Python documentati…

You mean like how Vec has a ton of examples?

https://doc.rust-lang.org/std/vec/struct.Vec.html

FWIW I'm not a huge fan of Python's docs because I can't quickly scan them to track down that one detail about a function I was using.

Rust's docs also let you collapse everything which makes browsing them much faster.

Re: 100 days with Rust: a series of brick walls

#22

I'm looking forward to the full article, because it's nice to know that I'm not alone here. I too started learning Rust with great optimism, and had the same experience: I expected that things would be difficult starting out, but assumed it would get easier as I acquired more knowledge, and then it didn't. Mostly this was for the same reasons as the author cites: Rust futures are incomprehensible, and there is rarely…

"2014-11-28T21:00:09+09:00".parse:: >() With chrono, I think that's all you need. If you want to name the timezone you can use chrono-tz: let tz: Tz = "Europe/London".parse().unwrap() let date = "2014-11-28T21:00:09Z".parse:: >().with_timezone(&UTC)

That is indeed what I found :)

But trying to find stuff like this with Rust's documentation-- when you're using a search engine instead of relying on having a human to interpret the question for you-- is usually tremendously frustrating. My experience has been that Rust developers lean heavily on autogenerated documentation, where each method of a struct/enum is heavily documented but there are few to no examples or "E2E scenario" explanations to get you started from scratch.

That's why the above scenario took me an hour: first I had to discover chrono, then a while to realize it wouldn't do what I needed and actually had to use chrono_tz, then a while longer to find where the documentation for time format strings live, etc. All the methods were documented just fine, but there was no high-level explanation leading to them.

Re: 100 days with Rust: a series of brick walls

#24

I was following along until this: > universally terrible documentation and lacking examples, unstable APIs, type annotation hell, and so much more. The docs in Rust are by far some of the best I've seen, without specifics it's really hard to understand what issues he hit.

I did find the documentation for promises and tokio to be pretty confusing. But I had only been learning Rust for a few days at that point, so I think I was probably just not ready for it.

I went on to just use the basic sockets instead and that was pretty easy.

Re: 100 days with Rust: a series of brick walls

#25
post #13

I'm looking forward to the full article, because it's nice to know that I'm not alone here. I too started learning Rust with great optimism, and had the same experience: I expected that things would be difficult starting out, but assumed it would get easier as I acquired more knowledge, and then it didn't. Mostly this was for the same reasons as the author cites: Rust futures are incomprehensible, and there is rarely…

I’m observing some similar muttering in the JavaScript community with Promises. Chain them incorrectly and you get an error with no actionable context. The most popular 3rd party promise framework in JavaScript collects extra cause and effect data when you run the code in development mode. It helps but it still isn’t always enough. I fundamentally don’t understand how people still think writing tools and libraries is…

Don't leave us hanging. What's the other piece of advice?

Re: 100 days with Rust: a series of brick walls

#26
I think what happened here, is the author wanted to do something with futures and the whole frustration is comming from not understanding that Rust Futures are just not ready yet. The whole language and ecosystem has plenty of stuff in the pipeline to make them better.

Re: 100 days with Rust: a series of brick walls

#27
post #20
post #19

Earlier quoted context omitted.

They're completely different kind of docs that Python's. Python's are written by hand, with many examples and tips how to use the various tools. Rust's documentation very much feels generated, and the last time I checked methods were not grouped. So vast portions of a page are consumed by variants of methods (overloaded methods?) which work exactly the same except they take different argument type. Python documentati…

Side-note: I personally vastly prefer Rust's documentation to Python's, but I imagine it's a matter of taste. So you'd suggest adding a manner of grouping methods in rustdoc?

Also, common use-cases.

Collections, strings, dates, asynchonous operations.

Re: 100 days with Rust: a series of brick walls

#28
post #6

This is a 100 sentences rant with 0 substances. Literally, there are no examples at all of any "brick wall". Why was this even posted here?

I think that pretty much sum up what the major problem of Rust is: "but I’m starting to feel seriously concerned by how glacially slow it is to get anything done."

Without commenting on the original article, this is my main complaint. Plus, I'm not a fan of the sigil heavy syntax, not that modern C++ is much better.

Re: 100 days with Rust: a series of brick walls

#29
post #24

I was following along until this: > universally terrible documentation and lacking examples, unstable APIs, type annotation hell, and so much more. The docs in Rust are by far some of the best I've seen, without specifics it's really hard to understand what issues he hit.

I did find the documentation for promises and tokio to be pretty confusing. But I had only been learning Rust for a few days at that point, so I think I was probably just not ready for it. I went on to just use the basic sockets instead and that was pretty easy.

Tokio and futures are still in their infancy. We'll get there at some point hopefully

Re: 100 days with Rust: a series of brick walls

#30

I've been learning Rust for a little while, and while I agree that it can be frustrating, it's nowhere near as bad as trying to learn Haskell. I regularly get a friend of mine to explain things to me, because the documentation and community for Haskell are 90% incomprehensible to anyone who doesn't have a comp-sci degree or a higher education in mathematics. Example: https://wiki.haskell.org/Lifting . It's not that I…

> Lifting is a concept which allows you to transform a function into a corresponding function within another (usually more general) setting.

What's there not to understand? :)

Post reply on HN