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).
Regards, Stuart