News for hackers. Stuff that matters.
Re:Everything in C is undefined behavior by 3form on Wednesday May 20, 2026 @06:05AM (#48205425)
At which point it feels like some sort of high-level assembly-like language, which is simple enough to compile efficiently and stay crossplatform, with some primitives for calls, jumps, etc. could find a nice niche.

Maybe this already exists, even? A stripped down version of C? A more advanced LLVM IR? I feel like this is a problem that could use a resolution, just maybe not with enough of a scale for anyone to bother, vs. learning C, assembly of given architecture, or one of the new and fancy compiled languages.

Re:Everything in C is undefined behavior by simonask on Wednesday May 20, 2026 @06:40AM (#48205654)
Well, Zig is aiming to be a "saner C", and mostly succeeding so far. I hope they make it to production.

Rust is a somewhat more thorough attempt to actually course-correct.

Re:Everything in C is undefined behavior by pjmlp on Wednesday May 20, 2026 @01:40PM (#48211280)
It is basically what you can have today with Object Pascal or Modula-2, with a revamped syntax for C crowds.
Re:Everything in C is undefined behavior by addaon on Wednesday May 20, 2026 @12:09PM (#48210018)
There's Vale [0] as a structured high-level assembly language, but pretty far from usable right now. I do hope it matures. Basically: All non-control-flow instructions can be directly supported. Control flow is lofted to a higher level and implemented in C-style structured blocks and keywords, which map directly to a subset of the ISA that modifies the program counter. This separation means it's not a proper superset of traditional assembly languages -- you can't paste in arbitrary blocks of existing code -- but a lot of interesting things (for them, implementations of cryptographic primitives) are pretty trivial to port over. And in exchange, you get a well defined Hoare logic that can talk about total correctness, not just [1]'s partial correctness.

[0] https://github.com/project-everest/vale

[1] https://nickbenton.name/coqasm.pdf

Re:Everything in C is undefined behavior by pjmlp on Wednesday May 20, 2026 @01:41PM (#48211292)
Yes, there have been quite a few C inspired Assembly languages for DSPs for example, TI had one.