Sign in

Jonathan Müller

@foonathan.fosstodon.org.ap.brid.gy
79 followers 0 following 61 posts

C++, compilers, and programming languages. Software engineer @ LSEG, chair for std::ranges @ C++ standardization committee. 🌉 bridged from ⁂ fosstodon.org/@foonathan, follow @ap.brid.gy to interact

PostsRepliesMedia
Jonathan Müller @foonathan.fosstodon.org.ap.brid.gy · 19/11/2025
@vitaut Feels like -0°.
Screenshot of a weather app, the temperature is 4° but it feels like -0°.
010
Jonathan Müller @foonathan.fosstodon.org.ap.brid.gy · 22/10/2025
I'm hoping a cobus is enough like a bus in that it gets me to my destination.
Photo of a sign in a bus saying the name of the manufacturer/model:

cobus 3000
100
Jonathan Müller @foonathan.fosstodon.org.ap.brid.gy · 17/08/2025
Got tired of linking with LLVM so I've written something to emit bitcode directly. The blocks and records are conveniently defined in a little X macro file which then is used to stamp out a fully type safe builder API.
X Macro definition file:

//=== identification block ===//
LLVM_BC_DEFINE_BLOCK (IDENTIFICATION, 13)

LLVM_BC_DEFINE_RECORD (IDENTIFICATION, STRING, 1, (String, str))
LLVM_BC_DEFINE_RECORD (IDENTIFICATION, EPOCH, 2, (llvm_BcEpoch, epoch))

//=== module block ===//
LLVM_BC_DEFINE_BLOCK(MODULE, 8)

LLVM_BC_DEFINE_RECORD (MODULE, VERSION, 1, (llvm_BcModuleVersion, version))
LLVM_BC_DEFINE_RECORD (MODULE, SOURCE_FILENAME, 16, (String, name))

Usage example of the API:

auto identification = llvm_bc_block(IDENTIFICATION, ctx, memory.task);
{
    llvm_bc_record(
        IDENTIFICATION_STRING, ctx, identification, memory.task, .str = zstring("my-producer")
    );
    llvm_bc_record(
        IDENTIFICATION_EPOCH, ctx, identification, memory.task, .epoch = LLVM_BC_EPOCH
    );
}

auto module = llvm_bc_block(MODULE, ctx, memory.task);
{
    llvm_bc_record(MODULE_VERSION, ctx, module, memory.task, .version = LLVM_BC_MODULE_VERSION);
    llvm_bc_record(MODULE_SOURCE_FILENAME, ctx, module, memory.task, .name = zstring("input"));
}

llvm_bitcode(ctx, memory.task, identification, module, out);
010
Jonathan Müller @foonathan.fosstodon.org.ap.brid.gy · 24/01/2025
I'm going to be speaking at the C++ meetup in Helsinki on February 4th! Overengineering `max(a, b)`: Mixed Comparison Functions, Common References, and Rust's Lifetime Annotations www.meetup.com/cpphelsinki/events/3… #cpp #cplusplus
Meetup #10
Tuesday 4 February 2024 Maijansali, Oodi Helsinki Central Library Doors: 17:00 Talks start: 18:00
Sponsored by: think-cell

Main talk:Jonathan Müller “Overengineering max (a, b) Mixed comparison functions, X common references, and Rust's lifetime annotations”
020
Jonathan Müller @foonathan.fosstodon.org.ap.brid.gy · 18/12/2024
I've found a cool idiom for tagged unions of aggregates: Give each aggregate member a tag defaulted to the correct kind. That way, when you use designated initializers to construct the object, it will be automatically initialized correctly. godbolt.org/z/MYE91hGY6 #cpp #cplusplus
Picture of the code from the godbolt link
010