Eric Lasota

46 Followers
15 Following
133 Posts
Programmer at Red Storm, ScummVM contributor, game tech enthusiast, aspiring master chef.

Today I learned that in C++, if you declare a function prototype as "inline", then the definition of it may not wind up in the output obj file.

But, if you declare it as inline, and it's not defined in the current TU, then it will still compile just fine, it'll just generate an import reference to it, which will fail to link.

Wat.

Apparently Apple didn't support futexes on their operating systems until 2024, oof.

(They've been on Linux since 2003 and Windows since 2012, and OpenBSD since 2016.)

Conceptually WASM is kinda cool but so much of it feels rushed to minimum-viable-product without considering important details.

The stack pointer handling is.... bad.

Practically every non-trivial language feature (longjmp, exceptions, threads) has multiple conflicting implementations or proposals.

A lot of these things only require proposals in the first place because of specific design decisions that prevented them from working from the outset.

Oh yeah and there's some stuff that sorta kinda lets you set stack limits, which is fine as long as you don't have functions trying to allocate so much stack space that it underflows.

That means you can't pass negative numbers to alloca either, right?

.......... Right?

.... Welp.

Hmm okay so WebAssembly has basically two stacks, one with the WASM vars and one for variables that need to be spilled to memory. What happens if the memory stack overflows?

Oh... it just... underflows the stack pointer and starts stomping memory. Welp.

Really weird that C++ got coroutines before it got bound method pointers.

Yes, you can do it by just passing an object ref and a pointer-to-member to something that wraps it up, but the language doesn't allow a bound method to be used for anything other than calling it, so why not just make it convertible to a bound method type to simplify the syntax?

Just recently realized how nonsensical and dangerous it is to catch stack overflow exceptions.

Like let's say you're right near the limit, you do operation A then operation B, and operation B stack overflows, and you need to undo operation A. Even if you're just going to rethrow, if you call ANY function to undo operation A, it could stack overflow again and fail.

Apparently, Java and .NET both realized this and do not allow stack overflow exceptions to be caught.

Python does though!

Okay everyone, I am begging you, if this dialog (from calling SHBrowseForFolder) is anywhere in whatever you're making, pleeeeeease stop everything you're doing and fix it to use IFileDialog instead.

(Latest offender: Visual Studio 2026)

Really hope Microsoft steals the VK_KHR_pipeline_binary design cause it's pretty much exactly how all of the shader cache APIs should have worked in the first place.