5 ms·
This seems like a no-brainer for a re-implementation in rust, but I wouldn't expect that someone would rewrite curl itself in rust, but a new library that does
by empath75 10y ago
This seems like a no-brainer for a re-implementation in rust, but I wouldn't expect that someone would rewrite curl itself in rust, but a new library that does the same things.
- pionar 10y agobut why? What does one gain over just using libcurl?
- eckza 10y agoThe novelty of being "the guy that rewrote libcurl, but in Rust!". Probably.
- mathw 10y agoIt might be fun. I don't know that you'd gain much in the real world though. Starting such a project now? Rust, for sure, for me anyway. But is it worth rewriting Curl? I agree with the author there, it most probably isn't.
- jjnoakes 10y agoShorter code, since rust is a higher level of abstraction. Safer code, so half of the vulnerabilities wouldn't have existed. Rust's ecosystem (package manager and libraries). Of course you lose portability and you probably appeal to fewer developers, at least for now. So there is a trade-off. I wish Rust compiled to C. It would be my dream language. The only reason I can't choose rust half the time is because it doesn't support targets I need to support.
- pjmlp 10y agoLLVM used to have a C generator backend, but it was dropped.
- jjnoakes 10y agoLLVM still does (Julia revived it) but last I heard it was only implemented and/or tested for the subset of LLVM IR/bitcode that Julia exercises. My dream is human-readable C as well, which I wouldn't get via LLVM, i.e. a coffeescript-like mapping between Rust and C, as far as that will go. Like I said, it's a dream. I started working on something like it, but I was side-tracked, as often happens. Maybe I'll start it again...
- notriddle 10y agomrustc?
- steveklabnik 10y agomrustc is a rust compiler written in C. You're probably thinking of Corrode, which is a Rust -> C compiler.
- deleted 10y ago[deleted]
- floatboth 10y ago> a new library that does the same things Most languages already have HTTP client libraries. (In particular, Rust has Hyper. Ruby/Python/Node/Go have HTTP clients built-in in the stdlib, Haskell has http-client, etc.) Who uses libcurl really? (Spoiler alert… PHP.) Of course libcurl does FTP and Gopher and all the things, but these aren't commonly required, most applications just need HTTPS.
- IshKebab 10y agoPeople that write C and often C++ use libcurl. A better library for C/C++ developers would be nice and I believe it could be written in Rust, although that would be a bit of a pain because then you need to integrate Rust into your build system.
- LeonidasXIV 10y agoDo you? For building C projects I certainly don't have to build libcurl, it comes packaged and ready to use with my distribution. The same could be the case with a hypothetical HTTP library written in Rust.
- floatboth 10y agoEr, I meant, "who uses libcurl when writing NOT in C/C++"
- bkanber 10y ago> Who uses libcurl really? Thousands upon thousands of projects rely on libcurl...
- geodel 10y agoAlso check Rust/Cargo source trees if they use `Curl` or Hyper.
- stusmall 10y agoCargo depends on curl right now.
- 10y ago