developerWorks Live from EclipseCon
Its been a crazy week and a half. Wrath, along with several other infrastructure-related items, has now been backported into all J9 VM patch streams. I'm surprised at how cleanly the backport went - in most cases the streams were Wrath-compliant in under 45 minutes. Our mirror story has paid off big time as each stream only need minor updates. Its nice when you get to see your technology just work.[Read More]
King Arthur: The swallow may fly south with the sun or the house martin or the plover may seek warmer climes in winter, yet these are not strangers to our land?
Unfortunately, source code, like coconuts, needs help to migrate from on repository to another. When we started, we only wanted to change where our Smalltalk source was stored. We had lived with multiple repositories and were tired of ensuring that dependent changes in each of the repositories got into the right build, or was correctly backed out when there were problems. Our original goal was only to replace the ENVY repository with CVS, or any other version control system, and continue to use all the existing browsers.
To get to that goal, we needed a way to export our Smalltalk code to flat files and a way to load from the files back into the image. The obvious answer is Smalltalk's existing file-format, the "chunk" format. Chunk format, while fine for computers, leaves something to be desired when it comes to human consumption. Various other file-formats for Smalltalk have been development but none of them felt quite right for us.
Our solution is something we call FileBasedSmalltalk (FBS), which has become on of the core components of STDT. FBS provides a meta-model to map classes and methods back to their files so that the source can be kept on disk, not in memory. The model maps FbApplications, FbSubApplications, FbClassDefinitions, FbExtensions and FbMethods onto their "normal" ENVY model objects. The FbLoader is responsible for reading the files in and creating these model objects. To provide name resolution, the FbResolver was created and it can be thought of as the Smalltalk dictionary for FBS.
I can hear you thinking, "You have a meta-model... you still haven't actually installed any classes in the image" and you're right. The EmImageBuilder is a fantastically complex piece of code that does a great job of atomically loading classes, applications, etc. We definitely didn't want to rewrite it, so we did the next best thing - we subclassed it. FbImageBuilder is the new image builder that can force the FBS model objects into the right shape, allowing them to be loaded and installed as classes. Getting this correct was a lot of fun as mistakes often meant starting with a new image.
Now, I've explained how the Smalltalk source gets loaded into the image, but what does this have to do with repository migration? At the same time we were getting the FBS figured out and working, we had started to mirror all of our code from ENVY into CVS each as part of every build. Source code without history - no change comments and no ability to see why things changed - makes it very difficult to determine if that nonsensical code snippet is there for some vastly important reason or can be safely removed. Today there is over a full year's worth of history in CVS for all of our Smalltalk source.
As part of each build, our Smalltalk tools were run twice, once from ENVY and once using FBS. The output from the two were compared to ensure they were identical. It was now safe to only run the tools using FBS, although ENVY was still the "master" for the source and the mirroring to CVS continued. And that was the migration, a gradual switch once confidence had been built up in the new tools.
Turned out that trying to keep the ENVY browsers and make them work on files was more work than was practical. Instead, the STDT tools were born.[Read More]
STDT 270001KR9K 1,406 Visits
Mark Driver, an analyst for Gartner, has an interesting post about the resurgence of Smalltalk. His conclusion:
If you have investments in Smalltalk consider the risk of the language to be lower over the next 3 years than the last 3 years. Smalltalk is cool again. Is it the start of a long term trend or a fad? Yet to been seen.I love hearing about how Smalltalk is coming back into the mainstream. Definitely a good time to be working on Smalltalk tools![Read More]
Time flies. We've completed migrating the J9 team from ENVY to STDT in the current development line. Its been fun to watch people actually start using the tools we've been pouring ourselves into for the past year. The process has gone relatively smoothly - the death toll is still at zero. There have only been one or two major problems so far (*shakes fist at directories with spaces in them *).
I had promised an explanation of how we mapped ENVY concepts into Eclipse. Its probably a good idea to review how ENVY organized code. ENVY did this by provided first-class code organization structures:
To get to our new world, we had to port these concepts into the Eclipse Resource model. Eclipse basically allows things to be organized into Projects containing directory trees of files. We opted to use a straight forward mapping: Configuration Maps become Projects, Applications become a Directory plus a file of the same name, SubApplications are identical to Applications except they must be stored in Application, and both classes and extensions became files.
There were a couple of things we had to give up to live in an Eclipse world:
Just because that's how we laid things out in the Eclipse Workspace, doesn't mean we wanted to live with just Eclipse's Project Explorer-style views. We wanted our browsers back! At this point, I need to say a big thanks to the guys at Instantiations for providing us with a couple of free copies of WindowBuilder to use on this project. Their tools have made our lives a lot easier, especially when we've been prototyping new UI designs. Meeting with John O'Keefe and Eric Clayberg at Smalltalk Solutions and not only seeing their enthusiasm for STDT, but also seeing the great things they are doing with VA Smalltalk, the successor to IBM's VisualAge Smalltalk, was an awesome experience.
So two Smalltalk perspectives were born:
the Smalltalk Applications perspective,
and the Smalltalk Classes Perspective.
STDT 270001KR9K 1,473 Visits
For the past year, Graeme, Gabriel and I have been busy creating a Smalltalk IDE inside Eclipse. Two weeks ago we started an internal beta, using IBM's J9 VM team as our guinea pigs. Now the hard work begins as bug reports and feature requests have come pouring in.
So why have we done this? I guess it never hurts to provide some background.
All three of us work with IBM's J9 VM team, which was born out of OTI - the original creators of OTI Smalltalk and ENVY. Unfortunately, ENVY is showing its age in several ways (it was born in 1994 after all). We started experiencing problems working with distributed teams due to ENVY's chatty protocol, which requires a low-latency connection to the database. ENVY was also causing us problems because it doesn't have a lightweight tagging mechanism, making it difficult to get back to the exact code used in last weeks build. Finally, ENVY's strong notions of user/manager roles caused a lot of confusion when bringing new people on board. "Of course you can't do that. Only GAC can do that, obviously you have to be GAC to version, and you to release." Not exactly simple.
We looked at the current situation and picked out a few goals:
So we came up with a plan to migrate from ENVY to an Eclipse-based Smalltalk IDE, which we called STDT for Smalltalk Development Tools. There has already been some flak from coworkers for calling it STDT due to the fact that we have two many 'T's in there. That extra T comes from the '.st' file extension of our source files. Internally, the project has been called WRATH. Why WRATH? Well... figuring we should follow ENVY's example and pick one of the seven deadly sins, we looked at which of them had the letters ST in them. LUST jumped out as the most obvious choice. Sentences like "I've been working really hard on LUST lately" where enough to dissuade us of that name. WRATH seemed like the next coolest of the sins, so that's what we used.
We've also presented STDT at both EclipseCon 2008 and Smalltallk Solutions 2008:
In our next posts, we'll describe how we've mapped from ENVY into Eclipse and show some screenshots.[Read More]