Hi--
I just experienced an amusing imprinting session. The main application
I'm transferring happened to evaluate (HttpAdaptor dataTimeout), which
sends Object>>binding. To transfer the latter method, the source system
must immediately define and initialize a global variable method literal
("Binding") in the target system. Doing *that* requires defining a
couple other classes (BindingsAccessor and DynamicBindings) and
initializing them, and defining and signalling a new Exception subclass
(BindingsLocator).
Well, it all worked. The amusing part is that the target system
(basically Dan's 2.2 mini snapshot) had no exception-handling support at
the outset; it got imprinted inline as a side effect. :)
So, I think this stuff actually works... I plan to make a new release
soon, so that others can try to find things that the imprinter can't
deal with. In the meantime, I'd appreciate any test suggestions (like
the HttpAdaptor one-liner above).
thanks,
-C
--
Craig Latta
improvisational musical informaticist
craig(a)netjam.org
www.netjam.org
[|] Proceed for Truth!
Hi--
Just a note to say that I rewrote my imprinting VM changes as proper
Slang, so now it runs at normal speed (it only ran under simulation
before). This also means one only needs the source and target snapshots
(no need for the source-copy or simulator snapshots). It also works with
multiple concurrent targets (as in the "behavior broadcasting" example I
mentioned previously).
-C
--
Craig Latta
improvisational musical informaticist
craig(a)netjam.org
www.netjam.org
[|] Proceed for Truth!
Hi--
I've implemented the more brute-force means of transferring behavior on
demand, as mentioned in my 3 July message. I have successfully
transferred, from one snapshot to another, all the methods run in the
first million sends of an application, without using the compiler, and
without any special consideration for which methods those were. I call
this process "imprinting".
The main benefit of this approach, as I'm using it now, is making an
application smaller by leaving unused behavior behind. (This is useful
because I want to minimize the download time of the resulting
snapshot.) I can see other interesting uses as well; for example,
"behavior broadcasting", in people "tune in" to a running system (e.g.,
at a demo during a conference), and come away with all the behavior
needed to run the demo again for themselves. It's also a good way of
transferring unmodularized behavior from one place to another without
having to understand its architecture or dependencies.
[This reminds me a little of the first Matrix movie, where characters
have martial-arts or helicopter-flying skills imprinted onto them. :)
But notice they didn't start fighting or flying before the imprinting
was finished. That'd be similar to the first on-demand transfer approach
I tried, and later shelved (see the Squat mailing list archive). I
suppose for reference I'll call the previous approach "active
imprinting", and the current one "passive imprinting".]
The process works by running the application in a copy of the source
snapshot (the "input" snapshot), which reports the ID of each method run
to the original source snapshot (via a special virtual machine); the
source then ensures that the corresponding methods are installed in the
target. The communication between the input and the source, and between
the source and the target, is done with remote message-sending (a
message-event server in the input sends messages to a message-event
client in the source, which then sends messages to a Squat module in the
target).
In my current sessions, the source is a 3.6 snapshot, and the target is
a 2.2 snapshot. This encourages me that the technique will work between
snapshots of any likely vintage.
-C
--
Craig Latta
improvisational musical informaticist
craig(a)netjam.org
www.netjam.org
[|] Proceed for Truth!