More actions
Eventually I want an object builder tool that can be helpful for anything from a workspace for handling aliens (like bitmapped image objects) to importing code written in other languages (JS, Smalltalk, Go, Java, C#...).
We might graft some features onto it so that it can also let us inspect a given triple script to be able to e.g. poke at all instances of a given class. We'd exploit the structure of the language (and the dynamism of the runtime) to dynamically introduce new constructors that log all instances. From there, we could offer a way to export an object for later re-import using a strategy of "instantiation through extension". The idea is that the exported object is more or less a source-level (i.e. text-based) class definition that extends the class that it's an instance of, except we've enumerated all its slots and in the subclass's constructor we hardcode them to the values at the time of export. This can get hairy when those slots contain references to other objects, so we'll need to figure out some way to handle that.
XXX 2023 March: if we do a simple extension of the original class, we'll run into issues where the thawed object is not a faithful representation of the original&emdash;e.g. its constructor
differs. We could work around this by having the synthesized class overwrite these to match the original exactly. This then raises an issue of incommensurability regarding the meta-level facilities that things like constructor
were created for. Mirrors and mirror-like things might be one way around this—but how, exactly?
We'll also offer the ability to export an entire workspace, which should consist of the original triple script + any live objects that we've manually interfered with via an inspector. The workspace itself will be an object, exported as above.