#typedef
I don't know Rust, but wouldn't a generic way to easily create "strong typedef"s have the same problem as C++, that it's too difficult to decide in general what the "API" of a type is? Arthur O'Dwyer wrote about this here: quuxplusone.github.io/blog/2018/06... (last section of this article)
Perennial impossibilities of C++
These topics come up perennially in std-proposals, StackOverflow, and other places where us C++ types hang out. I thought I’d collect them all in one place.
quuxplusone.github.io
November 17, 2026 at 11:31 PM
I’M RUNNING VHOLUME WITH @typedef-sorbet.bsky.social AT AGDQ 2027!!!!
I genuinely can't believe this is real.

Tune in January to see one of the best parkour games in existence with me and @frogvent.bsky.social!

Can't wait to share this game with you all.
November 4, 2026 at 6:34 PM
windows c api devs on their way to typedef a boolean as "LPJFJCKKFFCKTHSSHT"
November 4, 2026 at 10:04 PM
Typedef struct
November 1, 2026 at 10:52 PM
Does that mean you have to do the equivalent of making a typedef for each pointer type?
November 2, 2026 at 12:14 PM
Ampharos from memory, also for @typedef-sorbet.bsky.social

hands down one of my favorite electric types! I enjoyed the opportunity to draw it. <3 #empydraws
October 30, 2026 at 8:44 PM
Typedef is joining Factory 🤝 The team behind a context layer that maps data lineage from code will help Factory's Droids plan migrations, debug pipelines and refactor data models with clearer evidence.

#AI #AIAgents #DataEngineering
factory.com/news/typedef
October 31, 2026 at 12:30 AM
This is gonna blow your mind: a helpful model is to think of 'sex' as a trait primitive of typedef 'continuously variable unit scalar'. Then recall: the body is a 3d object so voxelize it densely, at least tissue level. Conclusion? Sex is a high-rank tensor, a len2 enum can't capture a person, so...
October 30, 2026 at 5:50 PM
PSA: you're not meant to write "uint32_t" every time. They chose that name to be deliberately awkward, to avoid collisions with existing code because nobody in their right mind would actually use it. You're meant to typedef it to something sane like "u32".
October 28, 2026 at 5:18 PM
はてなブログを更新しました。 RISC-V OoO CPUを実装する (39. 境界をまたぐmisalignedアクセスを実行する)
https://msyksphinz.hatenablog.com/entry/2026/10/30/040000
RISC-V OoO CPUを実装する (39. 境界をまたぐmisalignedアクセスを実行する)
riscv-testsで唯一落ちていたのが rv64ui-p-ma_data だった。 仕様はmisalignedアクセスをトラップしてもよいと認めている。 ただしこのテストは実行されることを要求するので、実行する側に倒した。 54/55が55/55になった。 8バイトの行を2回に分ける DTCMは8バイト単位でアクセスする。 0x80003001 から8バイト書くリクエストは、 0x80003001 に7バイトと 0x80003008 に1バイトの2回になる。 ロードも同じで、2つの行を読んでつなぐ。 問題は、どこでその分割を持つかになる。 STQのエントリを作り直す 今までのSTQは、シフト済みのデータと8ビットのマスクを持っていた。 typedef struct packed { logic valid ; rob_id_t rob_id ; vaddr_t addr ; logic [ 63 : 0 ] data ; // already shifted into its lane logic [ 7 : 0 ] mask ; } stq_entry_t ; この形だと上位の行に行くはずだったバイトが、キューに入る時点で消えている。 0x80003001 に sd すると、8バイトのうち7バイトしか残らない。 レジスタが持っているままのデータとサイズを持たせる形に変えた。 typedef struct packed { logic valid ; rob_id_t rob_id ; vaddr_t addr ; logic [ 63 : 0 ] data ; // as the register holds it, not shifted logic [ 1 : 0 ] size ; // funct3[1:0]: 00 B, 01 H, 10 W, 11 D } stq_entry_t ; エントリは117ビットから111ビットになった。 シフトをコミット時に回したので、保持するものが減っている。 128ビットのシフト1回で両方出る コミット側は128ビットに広げて1回シフトする。 assign w_deq_data_ext = { 64'h0 , r_stq [ r_tail [ STQ_W - 1 : 0 ]]. data } << ( r_stq [
msyksphinz.hatenablog.com
October 29, 2026 at 11:03 PM
MS LearnのPOINTS構造体(複数形ではなくPOINTのshort版)、
謎のプリプロセッサーディレクティブが載ってる

learn.microsoft.com/en-us/window...
October 28, 2026 at 6:54 AM
やべ、急にこんがらがったけど
int yjsnpi[114][514];
のyjsnpiは 長さ114の(長さ514のint配列)の配列 で

typedef int Ikuiku[1919];
Ikuiku ton[810];
のtonは 長さ810の(長さ1919のint配列)の配列 なんだよね?
October 21, 2026 at 6:54 AM
Fun times
October 19, 2026 at 9:05 PM
Wooper from memory for @typedef-sorbet.bsky.social

This
#empydraws
October 9, 2026 at 12:11 AM
ruining my brain by forcing myself to think about cache locality every time i make a new struct typedef
October 7, 2026 at 3:10 PM
Announcing: Little Haskell Compiler v0.1.0 pre-release - Try it online!
An update is almost here. In the meantime, I want to talk about atoms and the C FFI. Brace yourselves for some C - you can’t avoid it when talking about the C FFI! Atoms are tagged unions allowing us to pass around any value that fits in a cons-cell. typedef enum AtomType : uint8_t { ATOM_BIT, // Boolean type ATOM_INT8 // ... } AtomType; typedef union AtomData { bool bit; int8 int8; // ... } AtomData; typedef struct Atom { AtomType type; AtomData data; } Atom; #define FIELD_NAME(TYPE) FIELD_ ## TYPE #define ATOM_NAME(TYPE) ATOM_ ## TYPE #define FIELD_BIT bit #define FIELD_INT_8 int8 In order to make this compiler more flexible, I have made base data types a choice. An example is the ‘boolean’ data type, which might be backed by a single `bit` (C really hates me calling it a bool) or if you don’t have a bool, might store it as an `int8` // Obviously, we should do this, if we can #define ATOM_BOOLEAN ATOM_BIT #define FIELD_BOOLEAN FIELD_BIT #define BOOLEAN_FALSE false #define BOOLEAN_TRUE true // But if bool was unavailable (WASM32, RISCV) we could do this: #define ATOM_BOOLEAN ATOM_INT8 #define FIELD_BOOLEAN FIELD_INT8 #define BOOLEAN_FALSE 0 #define BOOLEAN_TRUE 1 This was useful for swapping out implementations, but then I realized that I can actually use it to make a C FFI: #define UNPACK_ATOM(TYPE,ATOM) ((ATOM).data.FIELD_NAME(TYPE)) #define PACK_ATOM(TYPE,VAL) atom(ATOM_NAME(TYPE), (AtomData){ .FIELD_NAME(TYPE) = (VAL) }) #define UNPACK_BIT(ATOM) UNPACK_ATOM(BIT, ATOM) #define PACK_BIT(VAL) PACK_ATOM(BIT, VAL) #define UNPACK_INT8(ATOM) UNPACK_ATOM(INT8, ATOM) #define PACK_INT8(VAL) PACK_ATOM(INT8, VAL) The `PACK_` functions are probably useful just for creating Atom values, but where this really shine is when I define a small wrapper to pop arguments from a stack, and push the result: #define C_FFI_WRAP_1(RET_TYPE, FN_NAME, ARG0_TYPE) \ void c_ffi_##FN_NAME(Machine * m) { \ Atom arg0 = cell_atom(yard_peek_pop(m->yard, &(m->reg.stack))); \ Atom out = PACK_ATOM(RET_TYPE, FN_NAME(UNPACK_ATOM(ARG0_TYPE, arg0))); \ YardAddr out_addr = yard_atom(m->yard, out); \ yard_push(m->yard, &(m->reg.stack), out_addr); \ } Then, given a function bool complement(bool b) { return !b; } // generates void c_ffi_complement(Machine * m) // Assume an FFI index of 0 C_FFI_WRAP_1(BIT, complement, BIT) We could add a CFFI instruction taking an FFI index: // State before // S: [true] // C: [CFFI, 0], triggers the FFI call c_ffi_complement(m); // State after // S: [false] And because of the type and field magic, we can use the same function on an `int8 fn(int8)`: int8 increment(int8 a) { return a + 1; } // generates void c_ffi_increment(Machine * m) // Assume an FFI index of 1 C_FFI_WRAP_1(INT8, increment, INT8) // State before // S: [3] // C: [CFFI, 1], triggers the FFI call c_ffi_increment(m); // State after // S: [4] This means I’ll need to add syntax support to the Landin / Haskell parser for foreign imports, of course, to automatically generate linker code - you know, these statements: foreign import capi "botan/ffi.h f" some_fn :: CInt -> IO CInt This would kick off compiler directives to patch in a C_FFI_WRAP_N with the appropriate types, and link it to the generated FFI index so it can be called via the CFFI opcode. Oh yes, of course the first library I want to bind to is `botan` - I’ve been planning this for some time! This compiler will support code signing, and `memalloc` and `botan` both have big parts to play!
discourse.haskell.org
October 3, 2026 at 6:37 AM
Windows APIのCreateWindow(Ex)関数、関数の引数にいろいろ指定する感じになってるけど
仮にもっとあとから登場していたらDWORD cbSizeをメンバーとして持つ構造体へのポインターを渡して使うような関数になっていたのかな
October 1, 2026 at 7:49 AM