John Regehr on Nostr: BrainFuck is sort of Turing-machine-inspired: it's a tape machine rather than a stack ...
BrainFuck is sort of Turing-machine-inspired: it's a tape machine rather than a stack machine. in the variant we're implementing, the tape is an array of chars. since in C and C++ and also in LLVM IR the char * type is a wildcard pointer that bypasses type-based aliasing, checkout the crappy codegen we get from operations on an array of chars, compared to the better code we get by operating instead on an array of structs, each of which contains just a char
https://gcc.godbolt.org/z/sEecqEW6zPublished at
2024-09-13 22:21:04Event JSON
{
"id": "9a596f4747f069a3647c76d293bd4a906842f350bfa0d38ef6c8ddcdeedc4fe6",
"pubkey": "c8eb06af5f49cb42cc3107d8c5659e3d8849b4ce57c58f717ac3e9c0ef79f53d",
"created_at": 1726266064,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/@regehr/113132572805202147",
"web"
],
[
"proxy",
"https://mastodon.social/users/regehr/statuses/113132572805202147",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/regehr/statuses/113132572805202147",
"pink.momostr"
],
[
"-"
]
],
"content": "BrainFuck is sort of Turing-machine-inspired: it's a tape machine rather than a stack machine. in the variant we're implementing, the tape is an array of chars. since in C and C++ and also in LLVM IR the char * type is a wildcard pointer that bypasses type-based aliasing, checkout the crappy codegen we get from operations on an array of chars, compared to the better code we get by operating instead on an array of structs, each of which contains just a char\n\nhttps://gcc.godbolt.org/z/sEecqEW6z",
"sig": "53e0d99a0b87c878cb14268ef6dedb9ca123aac893447abb44f829ff480529af6c40cb908ae9edc5fe6f7ada8cd692b65771840f3e701e39f434c14d75e1a9a8"
}