(no title)
OskarS | 4 months ago
Essentially, this system works great if you know the exact hardware and compiler toolchain, and you never expect to upgrade it with things that might break memory layout. Obviously this does not hold for Word: it was written originally in a 32-bit world and now we live in a 64-bit one, MSVC has been upgraded many times, etc. There's also address space concern: if you embed your pointers, are you SURE that you're always going to be able to load them in the same place in the address space?
The overhead of deserialization is very small with a properly written file format, it's nowhere near worth the sacrifice in portability. This is not why Word is slow.
skywal_l|4 months ago
And then you have things like cap'n'proto if you want to control your memory layout. [1]
But for "productivity" files, you are essentially right. Portability and simplicity of the format is probably what matters.
[0]: https://www.hytradboi.com/2025/05c72e39-c07e-41bc-ac40-85e83...
[1]: https://capnproto.org/
OskarS|4 months ago
amelius|4 months ago
That's exactly the point!
(For example, if Rust would detect a version change, it could rewrite the data into a compatible format, etc.)
johngossman|4 months ago