Hi everybody. This is a bit of a long first post. I hope you like it and I hope I don't come off as too ranty, but I'm having a bit of a hard time which lead me to this investigation.
I'm a newcomer to the Rust community. So far I have largely written toy programs, but an opportunity came up at work to potentially write something in Rust. This is my first foray into building a real application in Rust, and also the first time I've really looked into third-party libraries (everything I've done thus far has been with the standard library). Apologies in advance if this is a bit of a rant, but I'm just venting my frustrations.
For context, I have mostly been working in Golang on a day-to-day basis. While I think that Rust is a very promising language, where it really seems to be lacking is in the standard library department, at least if you're used to the incredibly feature-rich one that Golang provides. I'm trying to translate an existing Golang application because we think Rust is a better fit overall, but the lack of a comprehensive standard library is not helping me here.
I know this is a holy war. I've read all about it. I don't think that my opinions will change Rust, and I just want to say my peace here before I get on with it, but my first challenge is to parse an ASN.1 DER data structure, and I cannot relate to you what a night and day experience this is coming from Golang.
In Golang this is all built into the standard library in the
encoding/asn1 package. In general I was really surprised to discover that Rust has no encoding support in the standard library whatsoever and this kind of blew my mind. No hex! No Base64! Apparently people use third-party libraries for this?!
Okay, sorry for that digression, back to Rust.
I went to the Rust Crates site to try to find a third-party ASN.1 DER library. I was somewhat surprised, and a little bit horrified at what I found.
There are just so many, and no real guidance, especially as a newcomer, as to what to use. Here are a few of them I found:
20 different libraries! Which one should I use? Trying to google for this it seemed like people just gave random answers with no justification, and everyone had a different favorite library. Which ASN.1 library defines me as a person? Well, I'd like a "simple" library, but I'm also "picky", so which do I
I couldn't find any good guidance for this online, so here I am trying to write
up my findings for you.
A quick sidebar: this is way too many libraries, especially for someone coming from a language where this is just built into the standard library and works! I get that Rust wants to have a small standard library, but if there's going to be a third-party library ecosystem to support this kind of thing, it'd be
tremendously helpful if the people working on these twenty different competing ASN.1 DER libraries could maybe get together and combine their efforts and collectively work on a single great ASN.1 library, please!
Also at this point anyone thinking of making yet another ASN.1 library for Rust should probably not do that and contribute to one of the existing ones, please! This is already confusing enough.