(no title)
tonygrue | 6 years ago
It took me a week of battling with the compiler to understand what I was doing, but afterwards it felt fairly natural.
My biggest hurdle was I went all in on async (the bikesheded, nightly feature). But a pet peeve of mine is that desktop apps were all async in the 90s and here we have webservers hoarding processes and threads, simply waiting on IO.
I quickly ran into the limits of Rust's async ecosystem. Hyper is an excellent library but there wasn't a webserver framework on top of it at the time. Now there is warp, so I intend to switch over to that from having rolled my own, but I hear some rumbling on reddit that it can lead to compiled size explosion, so gonna watch out for that.
For sql, I'm using mysql-async, but it seems like a single persons passion project. It's quite painful because even with the good libraries (serde) it feel broken to do so much hand writing of sql given the rich type information available in my structs. Everyone seems to use diesel but afaict it's incompatible with the async approach. This is my only real pain point right now.
The whole async ecosystem is still nightly and in flux all the time. Though, amazingly, it's worked quite well. It's clear the community has rallied behind it as most projects are on the bleeding edge. But hiccups happen such as mysql-async not yet supporting the new, nearly-stable version of futures.
Another pain point i've run into is there aren't great crypto libraries. Some very incomplete pure rust stuff. Some poorly documented wrappers of c stuff.
Finally, a third party web api I'm interfacing with doesn't have a rust library so I had to roll my own.
For other random needs I've been surprised by how often I find a great library. AWS libraries, for example, are surprisingly good.
My conclusion is that for web backends rust isn't plug-and-play yet (especially if you want to go all async). But it's pretty darn close.
And yeah, it's crazy fast. Like working in Modern C++ but with iron clad memory safety.
No comments yet.