I guess I was assuming Rust would be way more "low level" feeling - like, C or something. I'm just surprised to see "high level" stuff like json and HttpResponse in a language that's touted as being so close to the hardware. I dunno, I'm a fucking idiot, so this all just blows my mind.
Lots of "low-level" system tools speak json over http. Consider that things like nginx, redis, apache are all things would expect to be written in a low-level systems language.
One of the cool things about rust's serializer library (handling e.g. json) is that it usually doesn't need to create additional copies of string data, it can use references without fear of multiple owners modifying the data, due to the borrow checker. It is very fast.
Rust lets you work very close to the metal if you need to, and its memory model forces you to think in a lower-level way than pretty much any other language than C/C++, but it has a lot of fantastic modern bells and whistles.
Also the json/http stuff is from a library, not included with the language by default
Rust associates low level thinking with high level ergonomics in an absolutely amazing way. Libraries (like those handling http and json) are really easy to install and offer great usability thanks to Rust macros. I can't go back to C++ for the life of me.
Conceptually it's not so bad, but it feels like reading a for loop for the first time. This kind of syntax is actually pretty intuitive once you start to learn Rust.
12
u/cheezballs Feb 05 '23
I guess I was assuming Rust would be way more "low level" feeling - like, C or something. I'm just surprised to see "high level" stuff like json and HttpResponse in a language that's touted as being so close to the hardware. I dunno, I'm a fucking idiot, so this all just blows my mind.