3 ms·
Diesel.rs does give very scary looking errors but I found they are mostly due to the entire record structure being there as a (part of) type signature - after s
by ay 8y ago
Diesel.rs does give very scary looking errors but I found they are mostly due to the entire record structure being there as a (part of) type signature - after some time I started to get a “feeling” for what is wrong.
Also, over time, as I gained experience with the language, I found myself taking repeating code fragments and creating higher-order macros - both for Diesel.rs stuff. That reduces the repetitive code and errors. Macros in Rust are a great way to reduce a complexity where the functions can’t.
Source: during the past 1.5 years period in a couple of 2-3 month spurts I rewrote a C#/ASP.Net homegrown NMS dealing with provisioning and operation of a large-ish (about 15K people) event network consisting ~500 devices, all in all probably about 50KLoC of Rust code doing FTP/TFTP/SNMP and ssh/telnet interactions and this year the frontend.
Now (over the new year holidays) I am using the learnings from that to build a stateless-at-server ASP.Net-like framework using Iron, Diesel.rs, rust-Mustache and iron-sessionstorage on the server side and HyperHTML on the client side. I hope to open source it (the framework) at some point, when I get it to Rails-like ease of use.
Some additional impressions: I feel I am about half as productive with Rust initially compared to C# for smaller changes, but the final result is much more solid, requiring practically zero debugging. And as I build the abstractions later it becomes easier and easier.
Also it is a joy to get a consistent and easily traceable memory footprint compared to mono and about 10x the performance (in debug build) compared to the mono version. And the benchmarks show I have about 5x-7x more if I run it in release mode. So - a very happy Rust user here.