Jonathan Müller
banner
foonathan.fosstodon.org.ap.brid.gy
Jonathan Müller
@foonathan.fosstodon.org.ap.brid.gy
C++, compilers, and programming languages. Library developer @ think-cell, chair for std::ranges @ C++ standardization committee.

[bridged from https://fosstodon.org/@foonathan on the fediverse by https://fed.brid.gy/ ]
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 […]
Original post on fosstodon.org
fosstodon.org
August 21, 2025 at 7:48 PM
@maybeanerd Thanks! You can find the slides of an extended version here: https://www.jonathanmueller.dev/talk/functional/
Jonathan Müller
www.jonathanmueller.dev
July 11, 2025 at 9:46 AM
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 […]
Original post on fosstodon.org
fosstodon.org
March 9, 2025 at 3:44 PM
And of course, I'm utterly abusing X macros, preprocessor tricks, and _Generic.

Because a good C++ programmer, can write C++ in any language.
March 9, 2025 at 3:35 PM