Live data from Hacker News

Doing First Grade Math in Rust's Type System

fprasx.github.io

41–43 of 43 posts

Re: Doing First Grade Math in Rust's Type System

#41

I'm uncomfortable with programs that rely on complicated compile-time evaluation within the type system. For complicated runtime behavior, we have various tools for stepping through the evaluations as they unfold. E.g., debuggers, print statements, etc. But I haven't come across anything similar for these type-based evaluations. Usually the best I get is a compiler warning or error, or even worse, an unexpected succe…

I think that behind this sentiment is an assumption that software development is mostly applications and CRUD services.

If the target system is a space rocket, medical systems, etc. One really want to have guarantees.

Re: Doing First Grade Math in Rust's Type System

#42

Earlier quoted context omitted.

The problem with this peano arithmetic thing is that it only goes up to 88 https://upload.wikimedia.org/wikipedia/commons/b/bd/D274.jpg

If you build rustc with MIDI support enabled, it goes up to 100.

mine goes to 11

Re: Doing First Grade Math in Rust's Type System

#43
post #3

Can someone give an example of a useful application of this technique? Honest question, if it is just for fun that is fine with me.

Theres a train company using these to prove the microcontrollers and train network cant be in bad states. check youtube
Post reply on HN