3 ms·
A while back I was reverse engineering a mobile game that used a completely custom serialization format for game data, most of it in one giant "config" blob sev
by Retr0id 3y ago
A while back I was reverse engineering a mobile game that used a completely custom serialization format for game data, most of it in one giant "config" blob several megabytes in size. I'd written a parser and serializer for it in Python, using custom classes to represent the various nested object types, but I didn't have a convenient way to explore and edit the data.
So, I wrote some code to parse the giant blob and emit a python source file, consisting of a whole bunch of nested class constructors (with named parameters etc. making it quite readable), and a final function call to serialize the whole lot back into a blob. Now I could edit that source file and run it, and have my source-level edits reflected in the output blob (which I could subsequently feed back into the game engine to see the results of my changes).
- baq 3y agoNote: this is essentially what the AWS CDK does. Yet another example that configures is code is configuration is code is…