23,650 karma · joined October 15, 2013
It also wouldn't be a big deal when a supermarket employee makes an old-fashioned phone call (gasp!) to the refrigerator service company when some red light starts blinking ;)
Don't know what Bun does though.
AFAIK the C committee is on the right track though. Start with collecting and classifying all mentions of UB in the standard (IIRC it's somewhere around 200 items), then decide what to do with each of those. A lot of the UB items are completely silly ancient artifacts which can easily be clarified (like the "no newline at the end of a source file").
Then there's probably quite a few items that can become implementation defined behaviour instead.
And only then decide what should happen to the remaining UB items that are actually important for optimization, maybe require a new 'checked mode' which turns those cases into runtime errors.
Also I think the "nasal demons" problem needs to tackled somehow (e.g. the thing that a compiler is allowed to do anything in the presence of UB) - obviously this is the trickiest part, and in reality there's hardly any C program which doesn't contain UB.
Unfortunately Node still can't do something like this out of the box (AFAIK at least):
import { Bla } from "npm:bla@^5";
Such direct imports are basically the killer feature of Deno for simple standalone tooling scripts in otherwise non-JS/TS projects, e.g. it made TS a perfect replacement for Python even without a "batteries included" standard library.Deno also has a builtin TS type checker, linter, formatter, test runner with coverage support, package manager, language server etc etc... In node these are all separate (and often 3rd-party) tools.
https://www.themoscowtimes.com/2026/05/28/russia-lets-privat...
Deno's ability to import directly from a package registry or even git repo in a standalone TS script without requiring a package.json or similar 'meta-data' file was actually really nice for shell scripting stuff. AFAIK node.js still can't do anything similar?
> Dead code removal is unexpected by the programmer, because programmer does not write dead code.
Of course it is expected, because the optimizations leading to dead code are fundamental for the performance you get out of a release-mode binary (and that's also true for languages with less UB like Rust btw).
When you have a function:
static int add(int a, int b) {
return a + b;
}
And you call that function with const parameters: int c = add(2, 3);
Then you want that entire function call to be removed and "folded" into its result 5, and when this was the only place the function was called, you'd also want the actual function to be removed from the binary (because what's the point of lugging code around in the binary that's guaranteed to never be executed).That's already a fundamentally wrong assumption :) With today's compilers, C is a high level language like all the others. The optimizations happening to C code are not fundamentally different than for any other compiled high level language.
> We should discourage the usage of C in application programming and prod application developers towards memory safe languages like Rust or Go.
No that's rubbish, just as it would be rubbish trying to 'discourage' people from writing programs in assembly code or any other programming language.
Ultimately, guaranteeing "safety" is the job of the sandbox your untrusted code is running in (e.g. the browser, operating system or VM).
The only difference between Rust and any "unsafe" language should be that one fails already at compilation time and the other at runtime (because the sandbox killed your rogue process).
E.g. if an operating system is exploitable because it allows untrusted programs to leak out of the sandbox, then that problem must be fixed in the operating system.
The resulting performance difference is basically the price to pay for such a 'strict' compiler which translates the input source code straight into machine code instructions without attempting to simplify the output code via inlining, constant folding and dead code removal.
That's oversimplified. If after inlining and constant folding an if-condition turns out to be always true or false I would definitely expect that the compiler removes the dead branch.
This type of optimization is the base for the fabled "zero-cost-abstraction" (which isn't only a C++ thing, C code depends on it just as much), and removing those optimization would seriously tank peformance in any non-trivial codebase.
Also AFAIK the point where UB causes 'runtime disruption' is way after the C frontend in the optimizer passes, e.g. much too late for issuing compilation warnings even if the UB situation could be detected (because as far as I understand the problem, the breakage happens mainly because of unexpected 'spooky actions at a distance' between different optimizer passes, e.g. a specific optimizer pass doesn't even notice that it broke the code).
You can get runtime errors for a lot of serious UB problems via UBSAN though of course (at the cost of some performance).
It's of course everybody's personal choice, and it's nice for an experiment to figure out what Claude can do. But why go on HN and brag about a project entirely created by Claude when literally everybody else can do the same thing without lifting a finger?
Only in your opinion :)