• 0 Posts
  • 276 Comments
Joined 2 years ago
cake
Cake day: September 2nd, 2023

help-circle

  • 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.


  • 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.





  • You can’t shrink the yardstick down to an infinitesimal size.

    Coastlines are not well defined. They change in time with tides and waves. And even if you take a picture and try to measure that, you still have to decide at what point exactly the sea ends and the land starts.

    If the criteria for that is “the line is where it would make a fractal” then sure, by that arbitrary decision, it is infinite. However, a way better way to answer the question “where is the line” is to just decide on a fixed resolution (or variable if you want to get fancy), which makes the distinction between sea and land clearer.

    It is like saying that an electron is everywhere in the universe, because of Heisenberg’s uncertainty principle. While it is very technically true, just pick a resolution of 1mm^3 and you know exactly where the electron is.











  • 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.