From: Ralf Jung Date: Thu, 18 Nov 2021 16:25:32 +0000 (-0500) Subject: publish UB blog post X-Git-Url: https://git.ralfj.de/web.git/commitdiff_plain/7a98aadea1ccf9070d3ae803e587df1d4de135e3 publish UB blog post --- diff --git a/ralf/_drafts/ub-good-idea.md b/ralf/_posts/2021-11-18-ub-good-idea.md similarity index 97% rename from ralf/_drafts/ub-good-idea.md rename to ralf/_posts/2021-11-18-ub-good-idea.md index 1539cde..1f374b2 100644 --- a/ralf/_drafts/ub-good-idea.md +++ b/ralf/_posts/2021-11-18-ub-good-idea.md @@ -3,9 +3,9 @@ title: "Undefined Behavior deserves a better reputation" categories: rust research --- -*This is a cross-post of an [article that I wrote for the SIGPLAN blog](https://blog.sigplan.org).* +*This is a cross-post of an [article that I wrote for the SIGPLAN blog](https://blog.sigplan.org/2021/11/18/undefined-behavior-deserves-a-better-reputation/).* -"Undefined Behavior" often has a bad reputation. People often see it as an excuse compiler writers use to break code, or an excuse by a lazy language designer to not complete the specification and properly define all this behavior. +"Undefined Behavior" often has a bad reputation. People see it as an excuse compiler writers use to break code, or an excuse by a lazy language designer to not complete the specification and properly define all this behavior. But what, really, is Undefined Behavior, and is it as bad as its reputation? In this blog post, I will look at this topic from a PL perspective, and argue that Undefined Behavior (or UB for short) is a valuable tool in a language designer's toolbox, and that it can be used responsibly to convey more of the programmer's insight about their code to the compiler with the goal of enabling more optimizations. I will also explain why I spent a significant amount of time adding *more* UB to Rust.