Pharo port

Miguel Enrique Cobá Martinez miguel.coba at gmail.com
Thu Aug 13 15:53:40 UTC 2009


El jue, 13-08-2009 a las 21:21 +1000, Stuart Herring escribió:
> Hi all,
> 
> As I mentioned earlier, I've been working on a port to Pharo.
> It's effectively a branch (not a fork), and can be found in the
> MagmaPharo SqueakSource project.  The current version, which is based
> on r42Gamma6 can be loaded via the MagmaPharo-42Gamma6-test3.mcm
> Monicello Configuration Map.
> 
> It loads cleanly into Beta1 (10401) and 10413, and seems to work for
> simple uses.  However, there's still some issues, and the tests do not
> pass yet.
> 
> What I have had to change so far:
> 
> * Ma base additions:
>   - Copied the extension methods from BlockContext to BlockClosure,
> which has been previously discussed.
> * Ma object serialization:
>   - Removed the extension methods for classes no longer existent in
> Pharo - meaning no more warnings when loading.
>   - Created a new MaBlockClosureStorage class based on
> MaBlockContextStorage, to handle the different internal representation
> of a BlockClosure.  I'm not entirely sure of my handling of the
> outerContext instVar though.
>   - copied the extension methods from BlockContext, but modified them
> to use MaBlockClosureStorage instead of MaBlockContextStorage, and to
> call asBlockClosure not asBlockContext when materializing.
> * Ma Armored Code
>  - Replace the use of the missing ScreenController class with Display
>  - Changes to the code to connect to localhost to support Pharo (
> #connectTo:port: no longer accepts a ByteArray for the address - so
> used SocketAddress loopback4 instead)
>  * Ma object serialization tester:
>  - removed the soundSamples method, due to the classes being tested no
> longer existing.
>  - Copied #maEquivalentForSerializationTest:... from BlockClosure to
> BlockContext, modifying it to reflect the differences between the
> classes.
> * MagmaTester
>  - replace usage of Utilities>>setAuthorInitials with Author>>initials
> to prevent the tests being paused by deprecation warnings.  I'll have
> to update it again now to use Author>>fullName Author>>initials was
> also deprecated sometime after 10401.
> 
> As I said, the tests don't pass yet.
> There's two immediate issues:
> 1. A Pharo bug - (issue 966) preventing MethodProperties from being
> compared which causes the object serialization tests to fail.  I've
> submitted a fix for that, which hopefully will make its way in.
> 2. Even with the MethodProperties fix, the sampleProcess serialization
> tests fail.  This appears to be because a Process in Pharo has a
> slightly different representation to one in Squeak - in Squeak, the
> suspendedContext instVar is a BlockContext, in Pharo it's a
> MethodContext.  After coming out of #maMaterializeFromGraph:, that
> MethodContext in suspendedContext appears to be incomplete.  I haven't
> been able to figure out why yet, probably because I haven't consumed
> enough coffee to understand exactly what happens in the
> serialization/materialization process.
> In addition, some experimentation shows that some of the collection
> tests may also fail, but I'll worry about that once the Process stuff
> is dealt with.
> Also, I don't think there's a version of NewCompiler that works with
> Pharo yet, so there's no WriteBarrier support.
> 
> If anyone with a deeper understanding of either the serialization
> process, or Processes, BlockClosures and MethodContexts wants to have
> a look, please do!
> 
> The general idea of the MagmaPharo repository is that it should only
> contain changes specifically required to make Magma work on Pharo,
> general non pharo-specific changes should go to Chris and MagmaTester
> as usual.
> Whenever Chris publishes a new .mcm, I'll merge it into the MagmaPharo
> repository, and then publish a new .mcm for Pharo, once I've verified
> that all the tests still pass (assuming we've got to the point where
> the tests do in fact pass).

Just yesterday was I loading your code on my PharoCore. And I have a
worry. First than anything, your work is very valuable. Thanks for it.
But I am worry about the sustainability of this effort. In a mail
somedays ago, Chris said that (his idea) it would be to add a *platform
connector* that meditates between squeak/pharo versions of Magma. Also,
this is on a new repo, MagmaPharo, that adds to the existing, Magma,
MagmaTester and squeakmap.
My dream would be that for the new r42 release, a new, unified,
multi-platform, seaside-addons tested, historic versions free repository
be created. This new repository should contain the code for r42 and
*also* your adapters to make it work on Pharo, ideally, integrated
directly on the Magma core, but this depends on the availability of
Chris and Keith, you and anyone that wants to collaborate. I will use it
of course and report my findings/fixes when I can.
Anyway, keep doing this *great* work. Maybe the next Magma release will
integrate Pharo and seaside addons as a integrated/tested whole.

Thanks for your work.

P.S. I am trying my application using your MagmaPharo code. I will
report anything that I find.

-- 
Miguel Cobá
http://miguel.leugim.com.mx



More information about the Magma mailing list