4 ms·
One thing I don't see remarked upon enough is that UB fundamentally is about the logical side of programming languages, in particular https://en.wikipedia.org/w
by Ericson2314 5y ago
One thing I don't see remarked upon enough is that UB fundamentally is about the logical side of programming languages, in particular https://en.wikipedia.org/wiki/Principle_of_explosion https://en.wikipedia.org/wiki/Principle_of_explosion . This quote:
> Here I refer to the typical modern interpretation of UB: assumptions the compiler may trust, without bounds on what happens if they are violated.
Makes that abundantly clear.
This basic realization opens up many avenues for interdisciplinary research. For example, maybe all the ink spill on "paraconsistent logics" will finally be useful for designing an unsafe language like C. (https://plato.stanford.edu/entries/logic-paraconsistent/ https://plato.stanford.edu/entries/logic-paraconsistent/ https://ncatlab.org/nlab/show/paraconsistent+logic https://ncatlab.org/nlab/show/paraconsistent+logic .) Maybe "unsafe" in Rust is best understood as a logical "mode" of some sort. Lattice of allowed behaviors lead to a nice fine-grained semantics for semi-defined behavior.
I honestly don't know whether no one talks about this because it is very obvious to researchers in the field, or because no one actually dove deep into this interpretation.
- Ericson2314 5y agoI got those earliest-comment-stays-on-top upvotes, but no replies, and so the mystery of whether this is obvious and I am preaching to the choir, or this is a genuinely enlightening point, is not resolved :)
- tomerv 5y agoMy take is that there is a wide gap between informal discussions of UB, such as blog posts, and the way compiler writers think of them. So I'm leaning towards the "obvious to researchers" option.
- Ericson2314 5y agoOK thanks. Just to be clear, Ralf Jung might be writing for a popular audience with this blog post, but is certainly a preeminent research of this stuff. I guess I hope some writes a "back to the basics" blog post of this stuff at some point!