Posts by rygorous@mastodon.gamedev.place
 (DIR) Post #AQqqqdZ30uTSFW9hzs by rygorous@mastodon.gamedev.place
       2022-12-22T00:43:03Z
       
       0 likes, 0 repeats
       
       @steve between this and JS, I'm becoming convinced unary operator+ is just a long con language designers are unintentionally running on themselves
       
 (DIR) Post #AQqqqedh17mfaDKvsO by rygorous@mastodon.gamedev.place
       2022-12-22T00:51:37Z
       
       0 likes, 0 repeats
       
       @steve @airspeedswift "we should add an operator whose entire purpose is to do nothing but which is quite bad at its job"
       
 (DIR) Post #AQqqqfscP7JjQnKMmO by rygorous@mastodon.gamedev.place
       2022-12-22T01:08:34Z
       
       1 likes, 0 repeats
       
       @steve @airspeedswift the more I think about it, the more I become convinced that "we added a purely functional do-nothing operator then discovered it had side effects" is the most computer science thing that could have happened in that situation
       
 (DIR) Post #AS5pqqmDHSfXmLRAJ6 by rygorous@mastodon.gamedev.place
       2023-01-27T21:17:33Z
       
       0 likes, 0 repeats
       
       Welcome to object file formats, where everything is named confusingly for historical reasons
       
 (DIR) Post #AS5pqrCngbw76nsOkS by rygorous@mastodon.gamedev.place
       2023-01-27T21:21:07Z
       
       4 likes, 7 repeats
       
       ".text" sections don't contain text. ".data" contains some but not all data. ".bss" stands for block started by symbol, a directive in one particular assembler for the IBM 704 (1954!) that just.. stuck around.Object files are files but neither are nor contain objects (in the modern sense). Core dumps are memory dump but they've not been dumps of (magnetic) core memory since the 70s.There are segments and sections, which mean slightly different things in every format.
       
 (DIR) Post #AS5pqvriMR2ZYr384m by rygorous@mastodon.gamedev.place
       2023-01-27T21:22:30Z
       
       0 likes, 0 repeats
       
       There are COMDAT sections, which stands for COMMON DATA, originally meant to implement FORTRAN "COMMON" blocks. These days they're almost exclusively used for non-data (namely ".text", which as said before is also not text) so that's cool
       
 (DIR) Post #AS5pqxTKO4ioXnegLI by rygorous@mastodon.gamedev.place
       2023-01-27T21:27:01Z
       
       1 likes, 0 repeats
       
       Everything has headers with like 20+ fields. Compiler and assembler authors look at those 20+ fields and go "well I know what to put in like 5 of these but for the rest, uh, beats me".Then linkers and OSes "well I need maybe these 5 fields to actually do my job and will just ignore the rest"The other 15 fields are just along for the ride,  tools often put something in there but you usually can't trust it, and nobody's sure why they exist, it just seemed like a good idea at the time
       
 (DIR) Post #AS5pqz8UCXErhjv48O by rygorous@mastodon.gamedev.place
       2023-01-27T21:31:23Z
       
       0 likes, 0 repeats
       
       There's relocations. Originally, these are metadata used to move code built to run in one (memory) location to another. Fine. That's still a thing actually, so that part's fine.Then there are the _other_ relocations. These are other random metadata that have nothing to do with relocating code, but they're used to patch certain magic values in for things like thread-local storage. These are esoteric af and if something gets them wrong all hell breaks loose.
       
 (DIR) Post #AS5pr0v5ZJi7ElfOWu by rygorous@mastodon.gamedev.place
       2023-01-27T21:39:48Z
       
       1 likes, 0 repeats
       
       A lot of info you would expect to be there either just plain isn't, or if it is it has to be awkwardly encoded into strings (name mangling), because this stuff was all originally designed to bolt FORTRAN code together with 5 assembly routines, and neither types nor stacks were a common feature.
       
 (DIR) Post #AS5pr2fZ40TsfCQ1bs by rygorous@mastodon.gamedev.place
       2023-01-27T21:43:11Z
       
       1 likes, 0 repeats
       
       Then there's debug information, which on every platform I've ever worked with always comes in two flavors:1. the old format which can do Assembly and FORTRAN and C code with identifiers <=20 characters, barely knows what types are, and is flat lists of symbol tables and line number info2. the new format meant to support every language under the sun, extended and generalized 20 times, super-expressive and complex, and no two tools agree on how to read or write it
       
 (DIR) Post #AS5pr4LQppZ5rL0yVU by rygorous@mastodon.gamedev.place
       2023-01-27T21:44:53Z
       
       1 likes, 0 repeats
       
       lest you think 1. is stabs and 2. is DWARF,  that is _one_ example, but I've seen other pairings (for example, on MS platforms, 1. is old-school Codeview and 2. is PDB) and it's always two for some reason
       
 (DIR) Post #AS5pr65YLq3HGfbK2C by rygorous@mastodon.gamedev.place
       2023-01-27T21:45:18Z
       
       0 likes, 0 repeats
       
       I guess after how the first rewrite went, everyone decided never to try that again so they just live with the results
       
 (DIR) Post #ASHMmzQBd4BpfdJgxM by rygorous@mastodon.gamedev.place
       2023-01-28T19:10:25Z
       
       0 likes, 0 repeats
       
       @TimWardCam I'm talking about object file formats not comms protocols.
       
 (DIR) Post #AUOXMqADaJT11rJZfk by rygorous@mastodon.gamedev.place
       2023-04-07T00:32:04Z
       
       2 likes, 3 repeats
       
       Always remember kids, if you're a conscientious copper trader who makes fair deals then in 200 years nobody will remember you, but if you screw over people so much there's an entire room full of complaint tablets about your conduct you'll still be a meme 4000 years on