RE: https://mastodon.social/@Sdowney/116210284393872804
And I'll be talking about allternatives, contravariant functors, and lenses!
@foonathan.fosstodon.org.ap.brid.gy
C++, compilers, and programming languages. Software engineer @ LSEG, chair for std::ranges @ C++ standardization committee. π bridged from β https://fosstodon.org/@foonathan, follow @ap.brid.gy to interact
RE: https://mastodon.social/@Sdowney/116210284393872804
And I'll be talking about allternatives, contravariant functors, and lenses!
Tweet by @trq212 about Claude Code rendering scene graph in 11 ms and printing it to terminal in 5 ms
Tweet by @jarredsumner about Claude Code memory usage growing from 10 Gb in January to 68 Gb to 1.7 Gb now
Gotta give it to Claude Code developers: they are exceptionally brave. I wouldβve been straight up embarrassed to show stats like this.
Reminder: Claude Code is a thin CLI client that reads input from your terminal, sends it to Antrhopic servers and prints back the response.
@pervognsen I watched a talk once where the speaker asked for questions and said "and remember: a question is when you want more information from me".
Reddit blog post discussing a problem.
Commenter A: Can't you just do X?
Commenter B:: No, because Y.
Commenter A: But if you do X, then Z happens, so Y shouldn't be an issue. I didn't read the blog post.
Commenter B: As the blog post explains, Z does not happen!
Screenshot of a weather app, the temperature is 4Β° but it feels like -0Β°.
@vitaut Feels like -0Β°.
RE: https://fosstodon.org/@foonathan/115496833677765010
Thankfully not, after all.
Achievement unlocked:
if consteval {
if constexpr (foo) {
if (bar) {
throw error;
}
}
}
when compiling C code, enable the -fPIE option to compile to Proto-Indo-European, for maximum compatibility with all CPU architectures developed on the Eurasian continent
From the standardization committee that brought you keywords such as `co_return`, `decltype`, and `reinterpret_cast`, now for your consideration:
`trivially_relocatable_if_eligible`
and
`replacable_if_eligible`!
C++ - you're gonna need a bigger column limit.
Photo of a sign in a bus saying the name of the manufacturer/model: cobus 3000
I'm hoping a cobus is enough like a bus in that it gets me to my destination.
As co-organizer of the C++ User Group #Aachen, I am thrilled to announce our program for next Wednesday, September 3, 2025.
We will meet at SLB starting at 6:30 p.m., and the talks will begin at 7:00 p.m..
If possible, please pre-register at [β¦]
[Original post on nrw.social]
However,
a) the bitcode is bit-aligned, not byte aligned, so the slice is more awkward than necessary, and
b) the first entry of the type block needs to specify the number of entries in the byte block. This is encoded as a variable length integer. So after you've encoded all the types and now [β¦]
LLVM bitcode is not good designed if you want to generate it efficiently.
For example, you need to define all types that a module is using without duplicates. This is easily done with a hash table and ideally you could use the binary serialization as key: Serialize into a buffer, do lookup in [β¦]
Another day, another #if 0 ... #endif bisect to find the code that crashes MSVC.
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);
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.
@vitaut I've got a good chuckle when I saw that I contributed to the "hello world foundation"
https://algora.io/profile/foonathan
@maybeanerd Thanks! You can find the slides of an extended version here: https://www.jonathanmueller.dev/talk/functional/
Jonathan on stage answering questions from the aduience
Enjoyed the talk by @foonathan at #weAreDevelopers on how to do functional programming in C++ a lot
I don't even use C++, but it was so well presented that I felt I still understood
Today I rebased my stuff after spending two weeks on conferences only to discover that we've introduced an `use_iter_move_on_xvalue_dereference_index` customization point.
Can anybody I know invite me to lobste.rs?
I've used the `*---*x` operator today.
I've tagged a new release of lexy, my C++ parser library. The last release was December 2022, so this was long overdue:
https://github.com/foonathan/lexy
#cpp #cplusplus
A sign saying "end of token section"
When you finish writing your parser
I love how fixing audio issues on various linux devices has become as simple as `pacman -S pipewire-pulse` or `pacman -S pipewire-alsa`.
Next week, I'm going to be attending C++Now, and I'm going to be giving my two favorite talks of all time:
First, a repeat of my "Overenginering max(a, b)" talk, which is just a bunch of fun metaprogramming to solve a safety problem.
Then, a new talk "Missing (and future?) range concepts" [β¦]
I'm going to be speaking about missing and potentially future C++ range concepts at C++Now:
https://schedule.cppnow.org/session/2025/missing-and-future-c-range-concepts/
#cpp #cplusplus
For example, I have an X macro file containing stuff like
DATA(Foo, (int, a), (float, f))
which generates both struct definitions and JSON serialization code of the form:
json_object_begin(out);
json_object_key(out, "a");
json_int(out, foo.a);
json_object_key(out, "b");
json_float(out, foo [β¦]
And of course, I'm utterly abusing X macros, preprocessor tricks, and _Generic.
Because a good C++ programmer, can write C++ in any language.
I've been programming in C for a small project, a couple of thoughts:
* -Wimplicit-fallthrough isn't enabled by -Wall -Wextra in clang, which has bitten me.
* I got tired of `Foo foo = (foo)x`, so I'm using C23 and auto, sorry, not sorry.
* I spend a lot less time thinking about interface [β¦]
I published my trip report about the Hagenberg meeting last week: https://www.think-cell.com/en/career/devblog/trip-report-winter-iso-cpp-meeting-in-hagenberg-austria
It was pointed out to me that I was wrong about the potential for dangerous optimizations with contracts and ODR. It is in fact [β¦]