Tag

GCC

2 stories

C++26 gets contracts. The man who built them into D says they weren't useful (cppstories.com)

Contracts let a C++ function state what callers must guarantee and what it promises back. A violation can be ignored, observed, enforced or quick-enforced, chosen per build with no portable per-assertion switch, and the guide warns they are not input validation.

Walter Bright, who says he added contracts to Zortech C++ in the 1990s and to D later, wrote that they "just turned out to not be very useful". An embedded developer wants the opposite trade: checks on at the workstation, off on weak production CPUs.

🚀Tech ★ 136 · 💬 147 · Oct 16 · #dev tools#programming#C++26#D#GCC+1

Not just a headline — the discussion unpacked

The top HN threads: facts from the discussions, both sides, insider voices. Email, Telegram, or RSS.

Someone translated the entire Rust compiler into 46 million lines of C (github.com)

The goal isn't the 46M-line artifact; it's the tool that produced it. The author's 'cilly' compiler probes the target C compiler with tiny witness programs instead of assuming anything beyond ANSI C, and can even compile over the network — so 'unsupported target' stops being a knock against Rust.

The thread found the genuinely useful uses. An ex-compiler developer gave a flat endorsement. Others pointed to easier Rust bootstrapping and a security trick: use crustc for Diverse Double-Compiling to check whether the official rustc has a backdoor. The skeptic's fair point: who trusts a beta transpiler on an exotic target?