It’s been some time since I last visited CompiledMethod land in Smalltalk. Back in the days, I created Knigge to enable two (almost identical) (Squeak-) Smalltalk Images to share their „Behaviour“ in form of classes and compiled behaviour.
Since then, a lot seem to have changed. CompiledMethod got a header and a meaningful set of trailing bytes. Traits have been introduced and will be (hopefully not too much) added complexity to serializing a compiled method as is.
The interesting thing is, that ClassLoader and Knigge start, where other serializing solutions (like SIXX and SmartRefStream) stop. On the other hand, it will have to be configurable – you don’t want to serialize your whole image (or, at least, back then I wasn’t able to without the VM to crash :) ).
The idea is (and was back then) to follow the path of Spoon which dynamically pulls in Behaviour (compiled Smalltalk code) from a master to a slave image. I will probably never achieve this – but the vision is a „slave“ Smalltalk image, that you have (for instance) Seaside loaded in, and a master image with all your development tools. You execute your (complete) test cases within the slave image… and – after the test cases are run – your slave image ends up with all necessary code and objects that you need to run your web app with – and not much more.
For this, we will need
- a minimal-as-possible image that supports Knigge to pull in Behaviour
- a VM that marks executed Behaviour and accessed objects within a master image
- a master image that pushes marked Behaviours and objects into the slave image
- possibly a replay log that ensures that the test case executed ends up in the slave image
I haven’t yet digged into it, but recent developments around CogVM seem to make it mandatory that the slave image will be a ’slightly bloated‘ image that supports the recent developments around Squeak/ Pharo’s JIT.
Yeah, right, I was working on my personal web app to make a decent channel editor for my HD set top box. Turn’s out I am bored by designing user interfaces and like more to fiddle more with the interface between the VM and the „Image„.
For a first assumption, we might share Behaviour between the same stable versions of Pharo Smalltalk – and issue a warning if versions don’t match (worst thing that could happen will be a crash.dmp of the VM with the image not being able to start up anymore).
In other news:
- Smalltalk enthusiast revives Tric-P2P
- Smalltalk enthusiast implements evolutionary algrorithm
- Smalltalk enthusiast connects P2P with evoluationary algorithm in home network
- I, for one, welcome our new overlord, Skynet