• So, a couple of thoughts. You can absolutely write safe code that produces wrong results. Rust doesn’t help - at all - with correctness. Even Rustaceans will agree on that point.

    I agree that Rust is safer than C; my point is that if correctness and safeness is the deciding criteria, then why not use Haskell? Or Ada? Both are more “safe” even than Rust, and if you’re concerned about correctness, Haskell is a “provable” language, and there are even tools for performing correctness analysis on Haskell code.

    But those languages are not allowed in the kernel, and - indeed - they’re not particularly popular; certainly not in comparison to C, Go, or Rust. There are other factors than just safety and correctness; otherwise, something like OCaml would probably be a dominant language right now.

    • GarlicToast@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      We didn’t get similar run times with Haskell.

      Rust let us abstract even file types (path to a fastq file, fasta file, annotations, etc) with no run time costs. This eliminate many bugs at compile time.

      You may say that we can get it in C too, and you will be correct. But in C we spend our time on herding pointers. Research is given X money for N months (sort of), so we have time constraints on development time.

      If we do bit wise work, the compiler tests our base types.

      Not to mention multithreading just works. Even big projects like BLAST had bugs that led to wrong results due C/CPP horrible multithreading. We encountered two more tools that had similar bugs.

      I think that if someone ever does a meta-studies of research code written in C it may get papers retracted.