[Pharo-project] loading bytecodes into the image?

Mariano Martinez Peck marianopeck at gmail.com
Sun Jan 8 22:28:34 CET 2012


On Sun, Jan 8, 2012 at 10:03 PM, Philippe Marschall <kustos at gmx.net> wrote:

> Hi
>
> Ok, I'm not pretending this isn't a stupid idea, I'm just curios.
>
> Suppose I want to build something that would allow me to load "compiled
> classes" (without sources) into the VM. How would you approach something
> like this? What things need special care (bindings, symbols, load order, …)?
>
>
We do that in Fuel. This is part of an external package called
FuelMetalevel, based on Fuel. This package lets you serialize in binary way
classes, traits, method dictionaries, compiled methods, etc. But such
package just takes care about serialization. It doesn't notify, it doesn't
validate, it doesn't add anything in Smalltalk globals, it doesn't rebind
compiled methods, doesn't send class side #initialize, etc. In Marea (
http://rmod.lille.inria.fr/web/pier/software/Marea), I am able to swap out
classes and traits to disk, let proxies in the image, and the swap them
back if they are needed. For this I am using FuelMetalevel for example.

Then we have another external package called FuelPackageLoader which is
based in FuelMetalevel, which adds all the mentioned missing things. It
adds semantics to the plain serialization of FuelMetalevel. It notify about
class creation, it validates classes, rebinds compiled methods, sends class
side #initialize, notifies, etc etc etc.
As an example of this last one, we were able to export all seaside and
materialize them in a different image. No sources.
http://marianopeck.wordpress.com/2011/09/24/importing-and-exporting-packages-with-fuel/



> Cheers
> Philippe
>
>
>


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20120108/6e33e47a/attachment.htm>


More information about the Pharo-project mailing list