3 ms·
>[...] the standard library is about as complete as you can get (and probably better than the classical scripting languages — all of Ruby/Python/Perl missed a g
by Spiritus 10y ago
>[...] the standard library is about as complete as you can get (and probably better than the classical scripting languages — all of Ruby/Python/Perl missed a good API for some things like HTTP, which led to the rise of separate packages like Faraday/Requests/etc)
What? Rust basically has no standard library. At least Python doesn't require pulling in third-party libraries to do globbing, create a zip/tar, create a tempfile or send/serve http. Hell, it doesn't even do command-line arguments outside of manually parsing and iterating over the args vector.
- elktea 10y agoit sort of does, though. Trying to use urllib2 is like pulling teeth
- Spiritus 10y agoWhich is why you use httplib[1] for sending HTTP requests. >>> import httplib, json >>> conn = httplib.HTTPConnection("httpbin.org") >>> conn.request("GET", "/get") >>> res = conn.getresponse() >>> print res.status, res.reason 200 OK >>> data = json.load(res) >>> print data {u'origin': '0.0.0.0', ...} >>> conn.close() [1] https://docs.python.org/2.7/library/httplib.html#examples https://docs.python.org/2.7/library/httplib.html#examples
- brandur 10y agoAdmittedly they did ship a lot out of core outright, but a single line in `Cargo.toml` fetches any of these things pretty expediently, and they're still well standardized across the ecosystem. zip = "0.2" tempfile = "2.1.4" getopts = "0.2" hyper = "0.9.12"