Hacker News new | past | comments | ask | show | jobs | submit login

Out of curiosity, can you share examples of popular libraries that were difficult to get working correctly?



One example - clap, which is by far the most commonly recommended cli args parsing library. Plain uses of the derive api are simple enough, but I found it a huge time suck to figure out how to do anything remotely different from the docs' examples. On my first 'real' Rust project, it took nearly half my time just figuring out how to deal with cli args. In retrospect I probably should have either used the Builder api (which is more explicit) or parsed the args manually.

But I've experienced similar things repeatedly. Complexity seems to be tolerated (even vaunted) by the Rust dev community at large. I don't rule out that this may have good reasons behind it (the nature of Rust's natural domain, etc).


That's fair, Clap is an 800 pound gorilla of library that is trying to be heavy-duty and production-grade. But if you're just learning Rust and want to crank out a CLI for fun or education then I'd say that Clap is overkill and a distraction from learning the language itself. There are dramatically simpler libraries out there for argument parsing, e.g. https://crates.io/crates/lexopt . Heck, if I was just starting out and writing a thing for fun I might just forego a library altogether and manually parse arguments from std::env::args.


That was but one example of what I face at every single turn with Rust though. Complexity (not conceptual difficulty) seems to be the general culturally accepted norm. I truly don't rule out that this reasonable given Rust's domain of use. But there is a general reluctance from Rust advocates to accept that it's complex, and that this complexity makes it hard to use.

I do find the intense advocacy thing singularly odd with Rust. It's not like developers have to be convinced a thing is easy for them to use it. I'm still learning Rust (for reasons). But I don't feel the need to submit to social pressure from Rust advocates to feign ease.


> Complexity (not conceptual difficulty) seems to be the general culturally accepted norm.

Can you give an example of what you mean by "complexity"? I think this could be an instance of people simply having different definitions.


In a way it's tricky to encapsulate, precisely because I do mean 'complexity' rather than 'conceptual difficulty', and complexity spreads through systems in thousands of small ways. Clap's one example - it's not only immensely hard to use (compared to what you find in other languages), but this is compounded by the fact that it's the library everyone recommends when asked online. This speaks to a cultural acceptance of complexity within the Rust community. I've found the same with nearly all of the commonly used libraries I've needed. As soon as I needed to do anything custom with serde it took me hours to figure out how. I gave up on all the general database libraries trying do some simple persistence to sqlite (though I did end up with rusqlite, which is genuinely simple). The utility traits smear complexity throughout just about everything an application programmer needs to do.

Without a lot of experience (not to mention vast amounts of memorisation), everything is just hard and slow to get done. And I do mean by comparison with other languages I've used, from Objective-C to Java, from Typescript to Elixir (and many others).

Again, this isn't necessarily a complaint about the complexity per se. It might be necessary (I don't feel I know enough to judge), given Rust's uses and constraints. But the community consistently and obviously denies the difficulty. I think I understand the sources of the denial. But that doesn't make it any less irritating!


Here's an example (of complexity or difficulty, or .. whatever your preferred defs/vocab) that arose for me today (but on any day I do any Rust programming or reading I could find a similar example).

This is an answer on the forums to a fairly beginnery-looking question: https://users.rust-lang.org/t/what-does-borrow-mean/81794/3

In what language ecosystem other than Rust would that answer arise as an answer to a beginner's question? Haskell, or a research language perhaps. I can't make head or tail of the Rust Playground example there. In fact if I look through most of recent questions on the Rust forum, there's probably 1 in 10 where I even grok the question, let alone the answer. I haven't experienced this elsewhere. Rust has a culture of complexity, and its community is in a state of denial about it (for I think a fairly obvious reason). Furious denunciations ensue even if anyone dare suggest such a thing!


Interesting. I find the clap derive stuff great and haven't had any trouble figuring out how to use it. Compared to anything I've done before in any other language, it's so much simpler and straightforward for me. Maybe it helps that I used structopt before clap incorporated it? I don't know. Different people can have very different experiences.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: