Re:Rewriting TypeScript in Rust? You'D have to be
by xchkr1337 on Wednesday December 14, 2022 @02:06PM
(#33988419)
In my opinion the presence of undefined behavior in the C/C++ specification makes it no better than the "specification by implementation" approach
[ Parent
| on HN ]
Re:Rewriting TypeScript in Rust? You'D have to be
by spac on Wednesday December 14, 2022 @04:16PM
(#33990710)
without a specification you can never tell with certainty if there's a bug
Re:Rewriting TypeScript in Rust? You'D have to be
by yencabulator on Wednesday December 14, 2022 @04:57PM
(#33991196)
C/C++ "undefined behavior" means your program is wrong and not within the spec, not that different compiler implementations might differ. There is no scenario in which any code with UB is valid, regardless of what compiler implementation you use. That's very different. (And IMHO a horrible feature of the spec, but it's there for historical reasons.)
C/C++ spec does have some "implementation defined behavior", which is where you can't rely on what will happen unless you know what compiler you're targeting. They are explicitly listed out as such, and not that common.