News for hackers. Stuff that matters.
Re:The C3 Programming Language by ajuc on Saturday January 03, 2026 @02:54PM (#46480844)
So the compiler could have debug mode where it checks the invariants and release mode where it assumes they are true and optimizes around that without checking?
Re:The C3 Programming Language by esrauch on Saturday January 03, 2026 @03:04PM (#46480960)
Yes, and that same pattern already does exist in C and C++. Asserts that are checked in debug builds but presumed true for optimization in release builds.
Re:The C3 Programming Language by mananaysiempre on Saturday January 03, 2026 @03:46PM (#46481356)
Not unless you write your own assert macro using C23 unreachable(), GNU C __builtin_unreachable(), MSVC __assume(0), or the like. The standard one is defined[1] to either explicitly check or completely ignore its argument.

[1] https://port70.net/~nsz/c/c11/n1570.html#7.2

Re:The C3 Programming Language by esrauch on Saturday January 03, 2026 @06:22PM (#46482857)
Yeah, I meant it's common for projects to make their own 'assume' macros.

In Rust you can wrap core::hint::assert_unchecked similarly.