top | item 41477680

(no title)

mav3ri3k | 1 year ago

You examples seems to be for a dynamic environment where things are changing. Rust is naturally at slight odds in such a scenario

Instead of quick and dirty, it allows to embed the logic in the type system such that the compiler can help you. Getting off the ground is much harder but staying there is easier.

.

discuss

order

throwawaymaths|1 year ago

Maybe the compiler (and the syntax) isn't the right place to put these guarantees.

Surely there is some middle ground in design space between rust and ada on one side (fully in the compiler) and c (with sel4-style checking - proof checking on a post compilation artifact) on the other.

Note that the c in sel4 and ada have stronger safety and correctness guarantees than rust

redman25|1 year ago

If you’re ok with sacrificing a small amount of performance for usability, just throw `clone()` everywhere. It will satisfy the compiler.

Rust can be written as simply as you want it to be written. Or, you can go crazy with generics or metaprogramming.

bobajeff|1 year ago

I'm curious about the c with sel4-style checking that was mentioned. Does sel4 have a style checker and/or proof checker that you can run on your c code? Or do they just have some style guide you have to read and memorize?