4 ms·
I was working on a simple Rust CLI program to parse JSON from the Github API, but I got turned off by some of the unfriendliness of the available http libs. O
by Evidlo 7y ago
I was working on a simple Rust CLI program to parse JSON from the Github API, but I got turned off by some of the unfriendliness of the available http libs. One http library pulled in dozens of other crates and turned my 10 line program into a 50MB binary [0], while another had an unpleasant api [1].
[0] https://docs.rs/reqwest/0.9.18/reqwest/ https://docs.rs/reqwest/0.9.18/reqwest/
[1] https://docs.rs/hyper/0.12.29/hyper/client/index.html https://docs.rs/hyper/0.12.29/hyper/client/index.html
Maybe I have too much desire for instant gratification, but it sucked the fun out of the project.
- iBelieve 7y agoYes, unfortunately reqwest pulls in lots of dependencies, but I think you should be able to get a binary under 10MB if you compile in release mode using the --release flag.
- 0815test 7y ago"Crates" are just compilation units. Do you feel "turned off" if a C/C++ library includes "dozens" of source code files, some of which might come from outside projects? (A sibling comment mentioned --release already, which is obviously something that one should be familiar with when discussing Rust's performance.)