The assumptions C/C++ compilers make, and an argument in favour of giving the compiler more flexibility regarding struct layout and padding.
(I believe Rust gives the compiler more freedom for structs that don't cross an FFI boundary.) https://twitter.com/shafikyaghmour/status/991370524008759296
miniblog.
Related Posts
I've never seen a good design philosophy on how to sort compiler errors for the best UX.
Do you order by line, or by severity? Do you put the most actionable at the end (because that's most visible when the terminal scrolls) or at the beginning?
Anthropic used Claude to write a C compiler in Rust (CCC). I've really enjoyed following the discussion.
The initial post shows how they wrote the harness with GCC as an oracle and a prompt specifying a design using SSA. The author has clear domain expertise.
https://www.anthropic.com/engineering/building-c-compiler
Co-Authored-By: An old Stack Overflow answer, blindly accepting the compiler's suggestions, and a linter.