6 ms·
I think there was little traction in curl, because Rust users can just use hyper directly. https://lib.rs/curl https://lib.rs/curl is used in 1000 packages, ht
by pornel 2y ago
I think there was little traction in curl, because Rust users can just use hyper directly.
https://lib.rs/curl https://lib.rs/curl is used in 1000 packages, https://lib.rs/hyper https://lib.rs/hyper is in 21,000 packages.
Curl is big and supports lots of protocols, but Rust doesn't need a one-stop-shop for all of them. HTTPS covers majority of uses, and Rust has separate packages for mail, ftp, websockets, etc.
- methou 2y agoyeah, rust is mainly for developers,and curl are for sysadmins and their derivatives.
- project2501a 2y agoThat is quite the arbitrary distinction. There are plenty of sysadmins that code and/or hold compsci degrees.
- croemer 2y agoNot if you ask meta.stackoverflow.com
- meltyness 2y agoI could see rust catching on as a shell scripting language too, honestly. Well documented, typed abstractions over shell utilities is really quite nice.
- colejohnson66 2y agoI disagree. I would hate to wrangle a borrow checker just to write a simple script.
- burjui 2y agoWhy it's always the borrow checker that bugs the haters? You don't even see it work most of the time, because instead of using references everywhere, like most C++ers are conditioned to do, not only you can move values (doesn't necessarily mean actually performing memory operations), but also the compiler checks that you don't use the variable from which the value has been moved. And even if you do use references everywhere, they don't usually cause any problems, unless you decide to put more than one reference in a often used struct. I often use both shared (RO) and exclusive (RW) references as function arguments and rarely have to specify lifetimes manually, because automatic lifetime elision done by the compiler is sufficient in most cases.
- colejohnson66 2y agoWho said I’m a hater? That was a very aggressive response. All I said is that I think Rust is not a good language for a scripting system. In scripting, I’m not always writing something “correct”, but good enough. Mutability everywhere helps do so, but the borrow checker gets in the way of that.
- meltyness 2y agoI've reached some mechanical sympathy with it, I think. You get some intuition for which methods to use, many structs have a pretty breadthy pallet, and then you can mostly just ignore it; quickly write your algorithm and let the compiler walk you through any oversights with the way you may have coded processing tasks. Also helps to know that the docs support search by type signature since functions operate on or return owned, borrowed, or mutably borrowed, and generally just think of borrowed as a pointer for heuristic reasons. It makes more sense than I do, usually.
- b5n 2y ago_lib_curl https://curl.se/libcurl/ https://curl.se/libcurl/ https://curl.se/docs/companies.html https://curl.se/docs/companies.html
- xign 2y agoI have worked in other large companies that use libcurl and they aren't even listed above. It's pretty much the de facto way to do HTTP requests in C-land unless you really want to write your own backend for some reason. The world still primarily runs on C/C++, not Rust.
- usr1106 2y agoHmm, wasn't it the other way round? Curl using a Rust library (hyper) instead of Rust programs using curl? Disclaimer: Just reading TFA, not an active Rust programmer.
- pornel 2y agoYes, but curl-with-hyper needed Rust programmers to finish and maintain the integration with the C codebase, and couldn't find anyone interested enough, which I assume is because Rust users don't need curl.
- aragilar 2y agoIt sounds like a lack of funding (i.e. the grant ran out) was the real issue. Given how high profile curl is, this raises the question of how sustainable rewrite-in-rust efforts driven by grants (or other short-term funding) are, if they don't have an existing rust community to take advantage of the grant.
- pornel 2y agoThis wasn't a rewrite-in-Rust effort, and I think that's the problem. Nothing valuable from curl has been rewritten in Rust. Only some existing Rust code has been added to curl, but the Rust ecosystem already has a better, safer way of using that code. Curl is not planning to ever require Rust, so the rewrites are limited only to optional components, and can't fully guarantee that the code is safe. The Rust components are required to expose an unsafe unchecked C interface for the rest of curl. C compilers are unable to enforce the safety invariants of the interface, like the Rust compiler would in a program fully written in Rust.
- aragilar 2y agoProbably I misread the original announcement, but I got the impression this was a pilot to adding more rust to curl (and is exactly what a rewrite would start to look like)?