On interoperability between Rust and OCaml

Strict aliasing was started by C, AFAIK, and it’s the ‘feature’ from hell. It literally made existing code crash in the most arbitrary manner costing me about a month of debug time. There is an massive number of programs out there that now suffer from random bugs due to the adoption of strict aliasing by default. It’s no wonder Linus turned it off for Linux.

Regardless, I didn’t know about these things you’ve pointed to. The surface area of C++ is now so vast you can easily miss large chunks of it, and it’s all advancing way too fast for casual programmers to keep up.

The placement new thing is obnoxious for primitive types. I understand where they were going with this, but they clearly didn’t think it through enough. It does make sense for more complex objects though, which need initialization. Placement new is clearly a hack that was added to the language to support more efficient use-cases (which C++ feels it has to own as it must be the king of efficiency), and adding that hack causes many other issues, requiring even more hacks.

1 Like