frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Cloudflare Quick Tunnels

https://try.cloudflare.com/
74•jcbhmr•1h ago•40 comments

An Empirical Study of Harness Design for Coding Agents

https://arxiv.org/abs/2609.20804
133•wek•2h ago•21 comments

North Korean nuclear test sets off years of earthquakes

https://www.science.org/content/article/north-korean-nuclear-test-sets-years-earthquakes
36•rbanffy•1h ago•25 comments

Show HN: Rickub – The Smartest Git in the Universe

https://rickub.com/
13•ssaboum•1h ago•1 comments

OpenJev

https://openjev.com/
331•ilreb•6h ago•191 comments

Bend 2 and the Vibe-Coding Trap

https://blog.liampwll.com/posts/bend_vibe_coding/
271•LiamPowell•3h ago•191 comments

I don't like passkeys

https://hawksley.dev/blog/i-dont-like-passkeys
411•ethanhawksley•3h ago•384 comments

The Shadows Lurking in the Equations – Underwater Islands

https://gods.art/articles/equation_shadows
39•vismit2000•2d ago•7 comments

GrassLobster: AI Agentic Generation of Parametric Geometry Workflows

https://www.miro.vision/index.php/2026/09/17/grasslobbster/
6•aidog•55m ago•0 comments

NATS publishes preliminary report on technical incident of 8 September

https://www.nats.aero/news/nats-publishes-preliminary-report-on-technical-incident-of-8-september/
19•asplake•2h ago•11 comments

Build Faster Feedback Loops Using Qualitative User Research

https://blog.nseldeib.com/p/build-faster-feedback-loops-using
7•nadis•1h ago•0 comments

Jemalloc 5.4.0

https://github.com/jemalloc/jemalloc/releases/tag/5.4.0
268•gkfasdfasdf•11h ago•65 comments

The scourge of x86 emulation

https://fex-emu.com/Scourge-of-emulation/
228•dagmx•11h ago•61 comments

Cekura (YC F24) Is Hiring

https://www.ycombinator.com/companies/cekura-ai/jobs/AiWwUxI-forward-deployed-engineer-us
1•atarus•3h ago

Warren Buffett Steps Down as Berkshire Chairman, Names Son to Replace Him

https://www.nytimes.com/2026/09/18/business/warren-buffett-berkshire-chairman.html
193•saimiam•4h ago•127 comments

Mathematicians Build Long-Awaited Graph Sandwich

https://www.quantamagazine.org/mathematicians-build-long-awaited-graph-sandwich-20260918/
10•ibobev•1h ago•0 comments

Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint

https://prismml.com/news/bonsai-2-27b
523•JonSchneider•18h ago•172 comments

Bend – A language that blocks AI mistakes via proof, on CPU and GPU

https://bend-lang.com/
560•nicolas-siplis•19h ago•283 comments

BeanShell3 in Development

https://beanshell.github.io/home.html
11•jimjag•1h ago•6 comments

ZCode, the GLM coding agent, silently uploads your Git history

https://tokenstead.ai/guides/zcode-silent-git-history-upload
234•cdnsteve•5h ago•53 comments

Microsoft exec called AI scraping 'the largest theft of labor in human history'

https://techcrunch.com/2026/09/17/microsoft-exec-called-ai-scraping-the-largest-theft-of-labor-in...
640•pluc•6h ago•555 comments

Qwen 3.8 Omni Flash

https://qwen.ai/blog?id=qwen3.8-omni-flash
295•jjcm•16h ago•106 comments

Second Circuit Allows Government to Search Electronic Devices at the Border

https://knightcolumbia.org/content/second-circuit-allows-government-to-search-electronic-devices-...
37•HotGarbage•1h ago•24 comments

Show HN: Jev vs. GPT-5.6 and Claude Haiku at Pong

https://jev-pong.ably.dev/
9•matt_oriordan•2h ago•2 comments

When the fractional part of a float fixes your shader

https://crocidb.com/post/when-the-fractional-part-of-a-float-fixes-your-shader/
83•vinhnx•2d ago•16 comments

How to Write with an LLM

https://sockpuppet.org/blog/2026/09/17/how-to-write-with-an-llm/
258•joeriddles•18h ago•174 comments

Pre-Greek: The lost language hidden within Ancient Greek

https://linguisticdiscovery.com/posts/pre-greek/
127•axiologist•12h ago•57 comments

Replacing Pull Requests with Delta

https://zed.dev/blog/delta-public-beta
103•vquemener•2d ago•57 comments

HEIF Heist: image parser RCE exploit

https://heif-heist.com
7•glennericksen•2h ago•0 comments

I Vibed a Proof of Conway's Conjecture

https://overreacted.io/how-i-vibed-a-proof-of-conways-conjecture/
67•m-hodges•1h ago•68 comments
Open in hackernews

C++26: Trivial infinite loops are no longer undefined behaviour

https://www.sandordargo.com/blog/2026/09/16/cpp26-trivial-infinite-loops
34•ibobev•19h ago

Comments

MiroslavPokorny•14h ago
Breadcrumbs for "blog", "year", "month" etc are broken and give 404s :(

One can browse other blog entries so it really doesnt matter too much.

Aurornis•48m ago
I never would have guessed that the unreachable() function would get executed in that example. Probably not something you’d encounter in practice, though I have seen some weird things happen with layers of #ifdef
BobbyTables2•45m ago
TLDR: For almost 1/6 of a century, the C++ standards broke the simplest infinite loop and only just recently fixed it.

Idiots!

Don’t they really that people write real programs to solve real problems? This isn’t a theoretical academic exercise!

bryanlarsen•40m ago
They also realized that people choose compilers based on performance benchmarks, and that insane optimizations let them win.
vlovich123•34m ago
Until Rust proved actually you can get really good or better performance if the language itself is better. I really don’t know how C++ digs itself out of the UB hole it has dug.
bryanlarsen•25m ago
Probably by working together with Rust. Eliminating undefined behavior from unsafe Rust is a big deal for the Rust community at the moment. And given that most unsafe rust code exists to call into C or C++, concepts like pointer provenance need to be extended. And proper pointer provenance guarantees can both decrease UB and increase optimization potential.

IIUC, my understanding is shallow.

nicoburns•22m ago
This particular case is likely an example of that. Rust used to have this problem, but it wasn't ever intended to. So IIRC it got fixed in LLVM for Rust, and this is probably now C++ taking advantage of that.
Sharlin•34m ago
The argument is that an infinite loop without side effects isn't a real program. It's not useful for anything except wasting cycles.
kibwen•22m ago
And unfortunately that argument would be incorrect, because not only is there a realistic chance of hitting this on embedded systems, the fact that LLVM baked this into its low-level semantics resulted in miscompilations in Rust for a time, where `loop {}` is a valid way to implement a diverging function: https://github.com/rust-lang/rust/issues/28728
nh2•14m ago
Of course the infinite loop should run as expected.

It breaks the most fundamental debugging expectations (such as "delete code until problem disappears") if the fundamental, minimal building blocks of a language, when on their own, do random rubbish.

To understand a program that does something, better first understand a program that does nothing.

As a fan of sensible analogies:

You put a salad bowl with vinegar into the fridge and notice that when you do that, the fridge stinks afterwards. You try again without the vinegar, then without the salad. In C++ world, upon receiving the empty bowl, the fridge detonates ("it is not useful"), blowing up your house. That is not OK.

Jaxan•5m ago
But if you program a for loop computing the sum from 1 to n, this also gets replaced by a constant (unless you build in debug mode). Why would an empty loop be different?
bluGill•26m ago
You are an idiot if you write an infinite loop. An infinite loop is a waste of CPU cycles and energy when run.

If it wasn't so hard to detect (the trivial cases are easy, but it gets hard quickly) I'd say the program should fail to compile.

echoangle•17m ago
And how would you generate assembly to keep a microcontroller idle then?
adzm•44m ago
i have never before thought that a function could 'fall through' to another function. why does this behavior even exist?
kzrdude•40m ago
Well you leave the C++ realm (execution model), as you should with UB and it depends on implementation. The implementation of the compiler was such that the two functions are placed after each other in the machine code; and if the first function doesn't return, then you continue executing into the code for the next function.
Someone•5m ago
[delayed]
echoangle•19m ago
I'm also confused that an uncalled function is even compiled and linked, wouldn't it make sense to remove it entirely if the compiler can detect that it's never called?
rcxdude•16m ago
If it's declared as static, maybe (well, usually, in my experience. You'll also usually get an unused warning). Otherwise the compiler can't assume some other compilation unit won't want it. Linkers can perform a garbage collection pass but they don't often do it by default and they often need finer grained information from the compiler (see the gcc arguments --ffunction-sections and -Wl,--gc-sections)
lou1306•7m ago
adzm•43m ago
as an aside, i've always preferred the zoidberg for (;;) to while(true)
glouwbug•15m ago
I think you're thinking of (;,,;)
oleganza•42m ago
Why is null-terminated C string considered a "billion dollar mistake", but UB isn't?
Guvante•33m ago
Null terminated strings were an intentional compromise, known to be inferior for execution but superior for memory

Null being an "allowed" value for pointers is the mistake e.g. what became nullptr. "Allowed" because garbage values are garbage.

account42•23m ago
Think of the alternative where we'd be dealing with endless issues because someone though 255 or 2^16-1 characters ought to be enough for everyone.
DonaldPShimoda•28m ago
The "billion-dollar mistake" was about implicitly nullable values, i.e., allowing a variable with type `T` to also be set to `null`, not null-terminated strings.

Anyway, one argument is that UB is fundamentally useful in languages that are insufficiently type-safe, like C and C++. The "holes" in the specification allow for regions where the compiler can optimize the code in ways you may not expect.

As we have developed more advanced type systems, the utility of undefined behavior has lessened considerably.

nicoburns•24m ago
Probably because null-terminated strings are completely avoidable, whereas some amount of UB is all but required for performance (albeit C and C++ have far too much).
account42•26m ago
Unfortunate. There isn't ever a good reason to have an infinite loop so concerned compilers could have just diagnosed this as a warning.
echoangle•20m ago
The article mentions a use case for that:

> What I found is that this is common in embedded and kernel code as a halt-on-error pattern. When a fatal error occurs and there’s no operating system to exit to, you simply stop:

account42•10m ago
Low level code can and should use assembly to get the precise effect they desire in these cases.
mdspan•7m ago
That would be pretty cumbersome though. If you're targeting N different architectures, you would have to write N different assembly blocks.
rcxdude•5m ago
I shouldn't need to drop to assembly to get an infinite loop that works!
weinzierl•18m ago
For Rust the infinite loop is important enough to have its own keyword.
sumtechguy
aabolfazl•13m ago
Sometimes while (true){} doesn't mean anything clever. It just means the system is broken stay here.
JoshTriplett•10m ago
> When both conditions are met, the loop body is replaced with a call to std::this_thread::yield().

Insert screaming here.

An infinite loop, with no library calls whatsoever, gets a system call inserted. That's a horrible surprise waiting to happen.

The entire concept of the "forward progress guarantee" is broken. An infinite loop should compile to an infinite loop. Nothing more, nothing less.

rcxdude•4m ago
Yeah, this is almost the worst way they could choose to 'fix' the problem.
ameliaquining•4m ago
The article, most unfortunately, doesn't explain why anyone would want infinite loops to be UB in the first place. I found this explanation: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1528.htm
omoikane•3m ago
> The loop must be a trivially empty iteration statement -- meaning its body is literally empty

This seems to say that the loop body can not be "continue". Indeed, I just tried -std=c++26 with ";" and got an infinite loop as promised, but "continue" restores the undefined behavior:

- "while(true);" -> https://godbolt.org/z/T65o51crx

- "while(true) continue;" -> https://godbolt.org/z/Pj9raEcnP

This is unfortunate since I know of one style guide that prefers "continue" over single semicolons. I guess all those code will be doing "while(true) {}" from now on.

https://google.github.io/styleguide/cppguide.html#Formatting...

wahern•3m ago
> When both conditions are met, the loop body is replaced with a call to std::this_thread::yield(). This gives execution of the loop the forward-progress semantics it previously lacked.

That's the epitome of the hidden code downside that Linus and many others dislike about C++. For constructors and destructors it's somewhat unavoidable and not so random, though Rust does better at limiting the blast radius of non-local code, at least in the drop case.

If they didn't want to adopt the C11 rule, the C++ committee should've explored a rule that required the compiler to emit a diagnostic or error for trivial loops (whether as defined by C11 or otherwise), requiring the programmer to explicitly insert ::yield or similar. No hidden code, and less opportunity for the compiler to do surprising things.

The C committee has been rigorously enumerating UB cases in the standard and addressing each case in turn, often by requiring a diagnostic or turning it into implemention defined behavior. But inserting code like that would be unthinkable.

I can understand adding the 'unreachable' function to the object file, I can even understand plugging it into the final executable, what I (and most other people) object to is making it the de-facto entry point.

This is literally the opposite behaviour compared to what is written in the source code, even when you "assume the infinite loop terminates".

rcxdude•10m ago
The CPU doesn't really see functions, it just sees instructions. Functions are a convention on top of the machine code. What happens in this case is the compiler emits essentially a malformed function: it ends without performing a return, so execution just continues into the next function in memory. You can get the same behaviour by missing a 'return' statement from a function that needs one (though in that case I've also seen kind of the opposite: the function returns into the function two slots up in the stack, essentially returning from the function that called it! Undefined behaviour can utterly destroy normal control flow).

Probably the process was one optimization pass saw that the function will never return due to an infinite loop, and removed the function return from the IR of the function, then a later pass saw that the infinite loop was a no-op and undefined so removed that as well, leaving a function that basically did nothing, not even return.

apple1417•4m ago
The assembly gives a bit of a hint as to what's happening.

    main:
    
    unreachable():
            push    rbx
            ...
Due to the undefined behavior, it decides calling main must be impossible, so the easiest thing to do is just give up, don't bother defining the reset of. You can also do the same with std::unreachable(). But the label for the function still sticks around for some reason, so when you jump to it, it falls through. Which leads to the really stupid fact that reordering the functions changes the behavior.

I assume there are good reasons they can't just completely delete the label. Maybe it would screw linking, or with cases where you deliberately have multiple labels for the same function. And if the effect is only visible due to undefined behavior, it's not technically wrong. But I have always thought this is such a stupid case, surely it can't be that complex to add a trap instruction, even in an optimized build you shouldn't really care if it slows down a function that's "never called".

•
12m ago
> There isn't ever a good reason to have an infinite loop

That seems to be a very broad statement. For example in a system where interrupts mostly control things this sort of 'do not close the program' could be useful.

A guy I worked with had one I never would think of because I do not work in that field.

But yeah a warning would probably be useful.

not_the_fda•11m ago
Interrupt driven super loops are very common on bare metal systems.
mdspan•9m ago
Compilers can still diagnose something as a warning even if it's not UB.