The rust rewritten curl has 4832 occurrences of "unsafe" in its *.rs files with 430k lines of rust code.
I am not smart enough to understand what this is for.💁🏻♂️
The rust rewritten curl has 4832 occurrences of "unsafe" in its *.rs files with 430k lines of rust code.
I am not smart enough to understand what this is for.💁🏻♂️
The reason for the rewrite is the language.Absolutely makes sense 😁
The rewrite was written by Claude, Anthropic's model, working in Claude Code under the direction and review of this repository's maintainer.I guessed it even before I clicked the link.
@icing I have limited memory from reading the rust book a few years ago, and have never written Rust code. Allowing for that, I am pretty sure `unsafe` means memory ownership enforcement is turned off or relaxed for a piece of code. Not good… this is like 95% of the Rust value proposition I think.
@arrakeen_urbanite @icing
I'd venture to say over 99%.
@icing
Don't want to defend a possibly slop-coded project, but the use od unsafe is described quite early in the readme 🫣
unsafe does not necessary have to be bad either. But i do not know enough to judge here...
@icing You don't get it. It's written in Rust. Rust is safe scale.
@icing Just for comparision, how many lines of code does curl have?
Are 430k 100x more or less or where are we standing there? (And just out of curiosity, does that include comments or not?)
@sheogorath @icing About 185k [1] from what @bagder posted. I'd assume with any comments.
[1] https://daniel.haxx.se/blog/2026/11/17/actual-curl-rewrites-in-rust/
@edd @sheogorath @icing curl production code was 184,141 lines this morning. Including comments, excluding blank lines
@bagder @edd @sheogorath @icing people developing newer programming languages seem to forget that a good programming language must be concise. More LOCs means more bugs. Rust, C++, java, zig all fail on that measure.
@hyc taking a slop project and comparing LOC with a proper develop project is not genuine to the discussion.
Especially if naidering a lot of rust "code" is probably auto-generated rust<->c api for libcurl
LOC had never been a good indication of quality or anything really, without proper understanding what is going on.
@lesto in this particular effort, feel free to point out the people with a proper understanding of what they're doing. I'll wait.
@hyc @bagder @edd @sheogorath @icing It has long been one of my personal maxims that a program should be as short as possible, but not any shorter (to paraphrase Einstein).
@icing wait, they just named it “curl”? That seems bad.
@LeafyEricScott they should call it curb
@icing “the reason for the rewrite is the language” but who would use this unmaintained thing? If it was “pushing the limits of Claude” it would make some sense as an experiment.