User:Colby Russell/Object builder

Revision as of 14:47, 26 October 2020 by Colby Russell (talk | contribs) (the main motivation of this note is actually in capturing the "instantiation through extension" pattern)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Eventually I want an object builder tool that can be helpful for anything from a workspace for handling aliens (like images) to importing code written in other languages (JS, Smalltalk, Go, Java, C#...).

We might graft some capabilities 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 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.

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.