calcopiritus

joined 2 years ago
[–] calcopiritus@lemmy.world 1 points 5 days ago (1 children)

I see you ignored my entire comment.

I don't know what is more explicit about expect. Unwrap is as explicit as it gets without directly calling panic!, it's only 1 abstraction level away. It's literally the same as expect, but without a string argument. It's probably top 10 functions most commonly used in rust, every rust programmer knows what unwrap does.

Any code reviewer should be able to see that unwrap and flag it as a potential issue. It's not a weird function with an obscure panic side effect. It can only do 2 things: panic or not panic, it can be implemented in a single line. 3 lines if the panic! Is on a different line to the if statement.

[–] calcopiritus@lemmy.world 1 points 5 days ago* (last edited 5 days ago) (3 children)

An unhanded error will always result on a panic (or a halt I guess). You cannot continue the execution of the program without handling an error (remember, just ignoring it is a form of handling). You either handle the error and continue execution, or you don't and stop execution.

A panic is very far from a segfault. In apparent result, it is the same. However, a panic is a controlled stopping of the program's execution. A segfault is a forced execution stop by the OS.

But the OS can only know that it has to segfault if a program accesses memory outside its control.

If the program accesses memory that it's under it's control, but is outside bounds, then the program will not stop the execution, and this is way worse.

EDIT: As you said, it's also an important difference that a panic will just stop the thread, not the entire process.

[–] calcopiritus@lemmy.world 6 points 6 days ago (6 children)

Replace uncaught exception for unhanded error.

[–] calcopiritus@lemmy.world 12 points 6 days ago

"unwrap should not exist" is true as long as you don't want to ever use the language. If you actually want to use it, you need it. At least while developing.

Some values cannot have a default value. And some cases it's preferable to panic even if it has a default value.

unwrap is not the problem. Cloudflare's usage is.

[–] calcopiritus@lemmy.world 20 points 6 days ago (3 children)

It's really hard to do without Rc (or similar) or unsafe.

[–] calcopiritus@lemmy.world 13 points 2 weeks ago (4 children)

Data storage devices are the last items you wanna buy second hand though. A drive failing could mean much more than just having to buy a new one.

[–] calcopiritus@lemmy.world 0 points 3 weeks ago (1 children)

I'll remember this post when someone manages to make a human fly by tieing a cow to their feet.

[–] calcopiritus@lemmy.world 5 points 3 weeks ago (8 children)

No it is not. It is the same as saying you can't have coal energy production without production of CO2. At most, you can capture that CO2 and do something with it instead of releasing to the atmosphere.

You can have energy production without CO2. Like solar or wind, but that is not coal energy production. It's something else. In order to remove CO2 from coal energy production, we had to switch to different technologies.

In the same way, if you want to not have hallucinations, you should move away from LLMs.

[–] calcopiritus@lemmy.world 21 points 4 weeks ago (2 children)

Gen AI porn and shitposts are the only 2 decent use cases I've seen of gen AI.

You can't make half of those without training it on porn.

[–] calcopiritus@lemmy.world 4 points 1 month ago

This comment was surprisingly easy to read. Definitely easier than if it were for the "th" sound

[–] calcopiritus@lemmy.world 5 points 1 month ago

The problem with that is that reviewing takes time. Valuable maintainer time.

Curl faced this issue. Hundreds of AI slop "security vulnerabilities" were submitted to curl. Since they are security vulnerabilities, they can't just ignore them, they had to read every one of them, only to find out they weren't real. Wasting a bunch of time.

Most of the slop was basically people typing into chatgpt "find me a security vulnerability of a project that has a bounty for finding one" and just copy-pasting whatever it said in a bug report.

With simple MRs at least you can just ignore the AI ones an priorize the human ones if you don't have enough time. But that will just lead to AI slop not being marked as such in order to skip the low-prio AI queue.

[–] calcopiritus@lemmy.world 12 points 1 month ago (1 children)

I hope they are prepare for the AI slop DDoS. Curl wasn't, and they didn't even state they would welcome AI contributions.

view more: next ›