Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If it's so great, why does rust not put everything in MIRI into the compiler?


Miri is a runtime thing so it can’t be in the compiler.

The compiler could interpret all unsafe via it but then it would be very slow, defeating the point.


"can’t be in the compiler"

Can't is a strong word. You could 100% put it in the compiler. Yet you don't (for the reasonable reasons you give). The line between compiler static analysis and non-compiler static analysis is a design decision. "defeating the point" is a subjective and pragmatic decision, not one rooted in safety absolutism.


I didn't really phrase this particularly well: I meant that you cannot determine this stuff at compile time because it is inherently a runtime analysis. Of course the compiler could emit the Miri interpreter into a binary if people chose to put the pieces togehter that way.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: