I think a major issue with the rust ecosystem is that it's full of unexpected design decisions

145 points farcaller

Rust ecosystem is great at offering different options but often there's not enough data to pick one solution. Oftentimes you hir some strange issues way after you settled on a specific crate.

I guess most of this stems from rust deciding to have a very basic stdlib and relying on third-party crates; but most of those crates make me want to look back at python and go.

Rust allows you to write effective code but at the same time requires you to hold all the context in your head. I was extremely surprised to see various design decisions this week as I tried to ease myself into rust again with some hobby projects.

To be more specific, I find rustls confusing. When I tried to add der encoded EC private keys support I had to do it in four crates (plus literally every other consumer will break because that’s a breaking change to one of the pemfile enums). There’s no reason loading a very much standard key should be this complicated in a crypto library. It might take months until this change could be properly landed!

Another interesting design decision is that hyper http client can’t talk to remote hosts by IP address if it’s using by rustls. I guess I wanted to stay within grist ecosystem as long as possible but practically, when you find something like this, linking OpenSSL doesn’t seem bad at all. Those quirks might be reasonable in some context but it’s not reasonable to expect them! No other http library I’m aware of in other languages has this issue so the expectation is that rust would behave the same with one of its most popular http crates; and given there’s no http lib in the libstd the only measure left to pick the proper prate is popularity.

I found myself not doing exploratory programming but going through all the docs for a crate I planned to use to see if it would fit my case. Often that wasn’t enough as I’d stumble on some case that seems marginal for rust but is taken for granted in other ecosystems. It was sure an interesting puzzle to figure why warp, a simple http framework, wouldn’t terminate on ^C if I ever sent a request from Chrome. And as much as I see how it’s not the warp issue but it’s underlying libraries’ it still forces me to think about those cases and treat them proactively in my code instead of relying on reasonable default behavior.

Unfortunately I don’t have a good answer as to how to fix all of this. I do enjoy writing rust more because it’s some guilty pleasure, no other language forces me to solve these intricate puzzles to make basic stuff work. And with that I’m highly concerned about using rust for real production as the amount of documentation for my own code would be abysmal.