Pharo, Squeak and GNU: Smalltalk runs on Android devices

I’ve mentioned Stefan Krecher’s work on GNU Smalltalk integration for Android a few weeks ago and somehow forgot to mention that it’s not the only Smalltalk environment that runs on this nice mobile operating system.

Just yesterday, I read on The Weekly Squeak that a new version of the Cog VM for Android has been announced together with a corresponding Pharo Image. The VM, however, can run Squeak Images as well. There’s quite some information on how to install and run the VM, the corresponding Pharo Image and known limitations and stuff available.

So it seems at least for Smalltalk, the openness of Android is excellent news. Even though there is some sort of VM and image support for iOS for Squeak and Pharo, it’s somewhat hard to find and even harder to get installed on users’ devices. I hope to find the time to get my fingers at either Pharo or Gnu ST on Android soon.

Smalltalk Inspect Episode 16: Udo Schneider und Smalltalk aus dem Untergrund

Vor lauter Urlaub und anschliessender Aufholjagd mit allem währenddessen liegen Gebliebenen ist mir völlig durch die Lappen gegangen, auf unsere Episode 16 hinzuweisen.

Dabei haben wir ein extrem interessantes Gespräch mit Udo Schneider geführt. Neben diesem, jenem und anderem ging es vor allem auch um ein von ihm gestartetes Projekt für eine Administrationsoberfläche für ein Sicherheits-Appliance. Anstatt irgend jemanden zu fragen, nutzte er einfach Squeak bzw. Pharao und Seaside, um einen Prototypen zu erstellen. Dieser war dann so überzeugend, dass nun eben eine Smalltalk-Anwendung auf dem Gerät läuft.

Wie immer ist diese Episode hörenswert für jeden, der sich immer wieder mal fragt, wie man eigentlich Smalltalk in der eigenen Firma platzieren könnte. Hier gibt’s dazu die passenden Anregungen…

New Seaside Application goes live: airflowing

If you still ask yourself if Smalltalk and Seaside are ready for real world web applications, there now is one more place to look at: airflowing.com.

This online platform for small/medium businesses in the creativy industry has been in semi-public beta (invitation only) for a while now but has just gone live for the open public.

Here’s an excerpt from Sebastian’s blog post:

Thank you to Alan Kay, Dan Ingalls and all the team that gestated Smalltalk, the only programming environment that maximizes design thinking from its very fundamentals.
Thank you Squeak community for being there and having an environment where play and real work has no clear borders.
Thank you to all Pharo fellows, specially Esteban Lorenzano for patience and support.
Thank you Stéphane Ducasse for helping Pharo to evolve.
Thank you Avi Bryant for making Seaside, a key part in the airflowing’s engine, and thank you to all Seasiders including Lukas Renggli, Phillipe Marchall, Julian Fitzell and many many other contributors that made Seaside possible one package commit at the time.

Pharo: How to load a Metacello Configuration into an offline image

I just had a little, maybe weird sounding problem.

I needed to get Seaside and some other stuff into a Pharo image on a machine at a place where there is very limited offline access. The network there is configured in a way that not every application can download stuff from the web. Pharo, of course, is not on that list.

So the usual code snippet:

Gofer new
                  squeaksource: 'MetacelloRepository';
                  package: 'ConfigurationOfSeaside30';
         load.

         ((Smalltalk at: #ConfigurationOfSeaside30) project latestVersion) load.

simply doesn’t work.
So my idea was to use the web browser to download all the monticello packages by hand (which is possible at the place) using the web browser and copying all of them into a directory.

I started off by downloading the ConfigurationOfSeaside30 package from http://www.squeaksource.com/MetacelloRepository/ConfigurationOfSeaside30-dkh.316.mcz and loading it into the image using monticello. From there one, I could probably find out which packages I need.

Well, good idea, but how do I actually find out which ones I need?Of course, all that’s required to load is described in the Configuration Class, but being a Metacello config, it would pre-load other configs that describe even more packages to load.
So without having Pharo accessing the web, there’s no way of determining which packages to load. The snippet

ConfigurationOfSeaside30 project latestVersion fetch loadDirective

would give me all the information I need …. if #fetch would really work. But I am offline.Oh my…

My next idea was to use a machine that’s on another network and where Pharo can access Squeaksource and load the config there. I used a clean image with an empty package-cache subdirectory, so that I simply had to zip all the mcz files in there and could copy them to the target machine.

So I created a directory on the target machine and copied all the packages into it.

Then I needed a way to convince Metacello/Gofer to use this local directory instead of Squeaksource.

Fortunately, Norbert and Dale answered my question on the Metacello Group at Google and pointed me to the perfect place to find what I needed: the Metacello FAQ, specifically the question “How do I override the repository for a config?”.

So, for completness’ sake, here’s how I got to load the whole config from a local directory:

| version repo |
  repo := MCDirectoryRepository new.
  repo directory: (FileDirectory on: '<path to directory>').
  version := ConfigurationOfSeaside30 project latestVersion.
  version repositoryOverrides: (OrderedCollection with: repo).
  version load.

It’s easy once you’ve got all the Configurations and Packages at hand. But still there is a problem of how to find out which ones you need. I just circumvented the problem, but maybe there is a better way of reaching the goal. Maybe it would be a good idea to have some sort of web service that bundles all the packages into a big zip file that one can download without using a Smalltalk image – for whatever reason.

In fact, putting up a Pharo or Squeak Image as a seaside Server that simply does the #loadDirective thing and packs all the files into a zip and delivers it to the user, would be all it needs to do. That’s maybe a nice exercise to dip my feet a bit deeper into Pharo…

This post is mostly a memo to myself to look this stuff up later when I need it again, but maybe it’s helpful for others as well.

[Update] Just a few minutes after I had finished this post another thought crept into my head:

I wonder if the idea of having such an extraction tool isn’t helpful for more scenarios than the one I’ve mentioned here. In most companies you have to hand the complete source code of a specific product version into a special version control system before it goes into production. This repos is independent of the development VCS and only keeps deliverables.

So an extract of a repo that includes a complete ConfigurationOfXXX with all required packages in their specific versions is exactly what’s needed for this. [/Update]

Alan Kay will talk at Potsdam about “Next steps for qualitatively improving programming”

On July 21st, 2011, the Hasso-Plattner-Institute at the University of Potsdam, Germany, will give Alan Kay its HPI Fellowship Award (german). Kay is known as the father of object oriented programming and Smalltalk and the Dynabook vision and coined a few famous terms:

The best way to predict the future is to invent it

I invented the term “object oriented” and I can tell you I did not have c++ in mind

The computer revolution hasn’t happened yet!

There’s so much more to say about Kay that I don’t even try because I will not do a good job of it. If you don’t know about Kay, start with the Wikipedia article here.

At the event, he will give a talk called “Next steps for qualitatively improving programming”, which will also be recorded and put online after the event.

Venue: Lecture Hall 1, Hasso-Plattner-Institut Potsdam, Germany
Date and time: July 21 (Thu) 2011, 16:00-17:00

ESUG Day 2

ESUG is really the place to be. There’s so much to learn about what people do in Smalltalk and it’s good to see the energy being put into Smalltalk by young people. Tuesday started off with Colin Putney’s talk on Monticello 2, from which I was a bit distracted by some production problems back home (greetings from sunny Barcelona, btw!), followed by Thomas Stalzers System Integration talk. Nice to see his Smalltalk-based home automation stuff is taking off. Seems he’s found a niche which is both fun and a place where nobody cares about what technology that stuff is written in, as long as it’s just good.

Another highlight for me was Esteban’s presentation of Reef. To me it seems most adopters of Smalltalk are currently working on the same problems: server side object representation of their widgets. Everybody needs a way to add validation to fields and display error messages as well as conversion logic and such. The next step then is Ajax/Javascript integration, which then brings up the problem that rendering a piece of Javascript code means transporting HTML-IDs back and forth between the server and the browser. So what we all typically do is look for a clever way to produce our widget objects ahead of rendering, and then make them carry their html-ID and make these available fro rendering Ajax callbacks later. Every now and then I thought: well, that’s about the same thing I did in my application, or: I had the very same problem here. And we all have the same problem in our design of this widgetry: we concentrate too much on the form input elements, but for the javascript stuff, everything on a page (and by that I mean every single html node in the DOM tree) we also need a div’s or span’s ID to feed it into the js render machinery. Then there’s the problem of how to render a comonent with its surrounding DIV at “normal” rendering time and just the DIV’s contents when replacing it in an AJAX callback. So there is a pattern here in what I’ve seen in the Seaside related presentations at this year’s ESUG.

The next talk gave us an overview of what Esteban is doing with Reef in their ibizlog application, which was also very interesting.

Eli Green’s talk on platform integration was just plain cool: he’s building a tool in Objective-C that allows for easy integration of a Gemstone server with native Cocoa Aplications on a Mac. He built a little Cocoa Application in the XCode Interface Builder that allowed displaying and managing data of the Seaside Sushi store on a Mac natively. What I mean by that is that he used an Array controller in IB to display the contents of a Smalltalk Collection from Gemstone. There was no ObjC-code to write in order to add new sushis to the inventoryl, just the usual drag&drop and wiring stuff in IB. Just to prove the date was really being stored in the Gem, he instantly refreshed the sushi store in his web browser and the added sushi was there. Very cool stuff, and open source. Not to mention that Eli had a very nice way of presenting. It was fun listening and watching!

The last talk for the day was Veronicy Uquillaz Gomez showing Torch, a tool for visualizing changes in code. The idea behind all that was to make integrating changes committed by several code maintainers easier. She’s come up with a very understandable way of visualizing changes in packages, classes and methods and presents them in a so-called dashboard. After a short introduction of what the several boxes and lines mean, we had a little quiz: what has changed in a body of code, just seeing the dashboard (no code changes). I must admit that the first one or two were really hard for me, but once you get the pattern, you can really see what the changes to a package was about, like: well, this must have been a message rename, because in all methods calling this method, there was a little removal right before an insert. Amazing.

The talk on what we can learn from Ruby was cancelled, unfortunately.

We’ve had a glimpse at a few projects in the “Show us your project” session, and instead of trying to remember specifically interesting things I just say: wow, amazing what people are coming up with or working on!

Seaside 3 and my first day at ESUG

I may be the last blogger in the Smalltalk arena to mention it, but Seaside 3 has finally been published here at Camp Smalltalk in Barcelona. You can read the full announcement on the Seaside home page.

So what can I say about my first day at ESUG? It was great, and it’s good to meet old and new friends and see the faces behind names you’ve read on the internet so many times.

My highlights yesterday were:

Andreas Tönne talked about his vision of what we as a community could do to make Smalltalk an acceptable solution in the context of Enterprise systems, especially in JEE landscapes. He started off by showing how easy it is to write a stateless bean in JEE today, using Annotations and writing only the business code. Today’s EJB containers provide all the infrastructure services around that: persistence, transactions, failover, life cycle etc. His vision is a vendor-neutral standard centered around Smalltalk acting as another bean container. He showed a few architecture sketches and ideas of how and where to start. His message was: Like it or not, EJB has won the market, and if another technology wants to get a chance in this market, it better plays well with the “standard”.

Gemstone announced that their 7000USD/Year version of Gemstone/S is going to be free for commercial use.

Bert Freudenberg talked about Squeak and EToys and gave an overview of their roadmap. My special highlight here was that they are working on getting Squeak accepted by the open source Linux distributions by providing the VM in the form of build packages and isolated source code.

Unfortunately, I missed the Wolfpack Programming workshop, but there will be another one at the XPdays in Hamburg in late November. From what I’ve heard, it’s well worth a visit.

Johann Brichau’s demo of his Seaside based Event planning system was both impressive and interesting. To me his finding about database options (Magma/Goods/Gemstone) were almost more interesting than his Seaside application, even though I got quite a few inspirational ideas from it.

Martin’s intro to Xtreams was also very interesting. Especially the idea of using Blocks as a Terminal for Streams is fascinating. We’ve talked a bit about it in the evening and found some interesting use cases for this.

We enjoyed some beer, food and Smalltalk sponsored by Instantiations. Mike Taylor, CEO of Instantiations said a few words about the Google transition and their plans for VA Smalltalk. His basic message was that VAST has been and will continue to be profitable and they are currently working on a detailed strategy for the next releases.

This year’s ESUG tech award nominees presented their stuff and I especially liked Esteban’s Mars Project. It is really good to see how far he’s gotten already. It’s great to see a Smalltalk environment with Native Widgets on the Mac.

Since I flew in in the morning, I missed the introduction, but from what I was told, we’re around 140 attendees this year, and about 30% of them are here for the first time. This is the third year that had more than 100 attendees, which is interesting in the context of the current economic situation. The venue (citilab) is great, as well as the food ;-)

Smalltalk on iOS – again an option?

It seems like the growing demand in Android gadgets and the noise of App developers have finally made Apple rethink their rules (Press Release):

In particular, we are relaxing all restrictions on the development tools used to create iOS apps, as long as the resulting apps do not download any code. This should give developers the flexibility they want, while preserving the security we need.

So it seems like it will be allowed to put packaged Smalltalk applications onto the iPhone, iPad (and maybe soon Apple TV???).

We would never say that Steve lost a battle or had to give in to the Mob, would we ;-)

Did I mention that both Squeak and Pharo run on the iPhone? Maybe this change may even motivate some Smalltalk Vendors to work in that direction.  This is surely good news for Esteban and his Mars/Deimos project and for John’s iSqueak work… But not only for Smalltalkers, but also Rubyists, Flash developers and so on…

[UPDATE] Daring fireball has some more details on what exactly changed. The whole “Objective-C,C, C++ or JavaScript only!” nonsense seems to be gone. Downloading code is still forbidden (which was to be expected and is no obstacle for many Applications). There are also some comments about the now publicly available guidelines for app approval.

I want it for VA Smalltalk

To my readers, it is not a secret that I see a lot of room for improvement for the VA Smalltalk tools.

One of the tools that really are nicely done in Eclipse, Squeak and Pharo is their diff tool, in which you can see all changes to a file or method between two revisions. They graphically support the user in finding additions, removals and changes with background colors and lines.

Now VisualWorks gets a nice colored diff browser.

In VA Smalltalk, there is a differences browser, but it is really not as helpful and comprehensible. So if anybody is looking for something useful to do: here’s an idea ;-)