Configuring sub-objects from the parent object
A recurrent problem that comes up in Spin programming is the issue of how to configure a sub-object from the parent object. @cgracey recently added constant overrides, so we can now do things like:
obj d : "driver" | BASEPIN=16, HZ=120
to override the values of constants BASEPIN and HZ in the child object. This helps a lot, and is a very useful feature. But it doesn't quite cover all use cases. In particular, there are cases where we want to be able to change which objects the child object uses, or to glue together objects. For example, it'd be nice if my ANSI text driver could be used with different display objects (VGA, HDMI, etc.); or we may want the upper level program to tell the child object which memory driver it needs to include.
Another common use case is to want to pass a serial or display object initialized in the parent to the child objects so they can print status. The SEND and RECV keywords can help with this to a degree, but they don't cover all situations.
So this thread is to brainstorm possible ways to extend the various Spin2 compilers to allow parents more control over child objects. I'd be particularly interested in feedback from @cgracey and @macca over how their compilers work and what would be feasible for them to implement.