the smallest object memory so far

Posted in Appsterdam, consulting, Smalltalk, Spoon with tags , , , , , on 21 October 2012 by Craig Latta

The smallest object memory snapshot I’ve made so far is 1,337 bytes long, on 19 January 2006. You can get the bits (also see my notes about the visualization tools). It adds 3 and 4, then quits.

I created it with a new version of the Squeak system tracer that I wrote. This tracer is implemented as a feature of the Squeak virtual machine simulator. It keeps track of all the objects that are touched during a particular duration of operation, then uses that information to guide a final garbage collection and snapshot.

When you run the snapshot, the virtual machine gets the object address (“oop”) for the special-objects array from the snapshot header. Note that the snapshot header doesn’t appear in this picture. The visualization is of the object memory bytes after they’ve been read from the snapshot file, not the snapshot file itself. The header is the only use of bytes in the snapshot file other than the object memory bytes.

Indirectly from the special-objects array (through the Processor and its active process) the virtual machine finds the active context and continues execution. The instructions executed come from a method used by the context. The instructions are: push (3), push (4), add, send (#quitPrimitive). The send invokes >>quitPrimitive, another method. That method terminates the virtual machine via a primitive. The virtual machine needs to look up >>quitPrimitive in the method dictionary of the class of Smalltalk, a literal association in the literal frame of the initial context.

In the above, we’ve touched the following objects from the snapshot file, in the following order:

  1. the special-objects array
  2. the global Processor association
  3. the Processor
  4. the active Process
  5. the active Process’s suspended context
  6. the now-active context’s method
  7. the symbol #quitPrimitive from the context’s literal frame
  8. the global Smalltalk association
  9. the system dictionary (Smalltalk)
  10. class SystemDictionary
  11. SystemDictionary’s method dictionary
  12. SystemDictionary’s method dictionary’s association array
  13. nil (touched during method lookup)
  14. that array’s association for key #quitPrimitive
  15. the value for key #quitPrimitive (the second method)

The method dictionary of the first method is in there also, as is true and false, making 18 objects. (The numbers 3 and 4 are immediates in the first method’s literal frame.) I could kill those last three, but I declared victory when I got the thing under 1,337 bytes. :)

Context 3 beta 2 (“Usable By Humans”) released

Posted in Appsterdam, consulting, Context, Naiad, Smalltalk, Spoon with tags , , , , , , on 19 October 2012 by Craig Latta

Context 3 beta 2 is released. This one includes the development environment memory from the 3 alpha 3 release, startable from the webpage that the app automatically opens. A remote system browser onto the history memory opens automatically. You can also shut down the development environment from the webpage. It should be fairly easy to get into trouble with this release…

Next, I’ll set up a third memory, a minimal environment which will become Squeak 5. I’ll write instructions for creating unit tests for each package in our community, and imprinting the code run by those tests into the minimal memory, thereby creating a module. We can work toward a release where all the packages anyone might want to load are served by some online history memory, with package metadata searchable with Google.

All I want for Christmas is a virtual machine running Snow Leopard.

Posted in Appsterdam, consulting, Smalltalk, Spoon with tags , , , , , , on 19 October 2012 by Craig Latta

Aha, so it’s not possible to build a Cog VM on Mac OS 10.7 or later, because John’s Mac support relies on QuickDraw system calls that were removed in 10.7, and Cog’s unixbuild won’t build on the Mac (not exactly sure why, Eliot just says so). Too bad… I’ve always appreciated having Ian’s Quartz-based Mac support to fall back on when John’s stuff misbehaved.

You can run 10.7 or later in a VMWare or Parallels virtual machine, but no earlier non-server releases (because of policy issues, nothing technical). So I guess I need to find and buy a copy of Snow Leopard Server.

I’m writing a C build environment in Smalltalk.

Posted in Appsterdam, consulting, Smalltalk, Spoon with tags , , , on 17 October 2012 by Craig Latta

I can no longer tolerate makefiles, autoconf, and all the other bullshit that currently permeates building C projects like the Squeak virtual machine. We’ve had the ability to manipulate command-line utilities from Smalltalk for years. I’m writing a model of C build artifacts, dependencies, and utilities. I’m collecting transcripts of successful Squeak virtual machine builds from all platforms, from which I will reverse engineer. Please do send yours. Thanks!

I’m interviewed on the Smalltalk Inspect podcast

Posted in Appsterdam, consulting, Naiad, Smalltalk, Spoon with tags , , , , , on 1 October 2012 by Craig Latta

Oh! I forgot to mention: I had another fun podcast interview, this time with Joachim Tuchel for the Smalltalk Inspect podcast. Check it out!

Gemstone 3.1.0.1

Posted in Appsterdam, consulting, GLASS, Seaside, Smalltalk with tags , , , , , , , on 30 September 2012 by Craig Latta

I made a new EC2 machine running Ubuntu 12.04 and Gemstone 3.1.0.1, with GemTools displaying onto a virtual xpra display. It all seems to work. Cool!

Looking forward to fun new visualizations with Cytoscape

Posted in Appsterdam, consulting, Naiad, Smalltalk, Spoon with tags on 18 September 2012 by Craig Latta

Wow, check out Cytoscape. I’ve made some very useful visualizations of Spoon object memory reference graphs before. With Cytoscape I think I’ll be able to illustrate the relative popularity of individual objects. There’s a pleasing synchronicity here, too: Cytoscape was designed for bioinformatics visualization, which jibes nicely with Alan Kay’s notions of message-passing recapitulating biology.

slides from my InnoViz talk today at PICNIC

Posted in Appsterdam, consulting, Naiad, Smalltalk, Spoon with tags , , on 17 September 2012 by Craig Latta

Here are the slides from my presentation today at PICNIC in Amsterdam.

concept: the active filesystem

Posted in Appsterdam, consulting, Naiad, Smalltalk, Spoon with tags , , , , , on 17 September 2012 by Craig Latta

The Spoon history memory’s embedded webserver presents the object memory as a WebDAV filesystem. Classes appear as directories, and methods appear as files in those directories. Developers can mount the filesystem so that it appears normally with the other volumes on their operating system. Because of this, they can also use familiar file-based tools like file browsers and text editors to interact with it. When a file is written with one of these tools, the corresponding method is compiled and installed in the running system. Other side effects can be associated with special locations in the filesystem; for example, when a special “do it” file is written, the expressions in it are evaluated and the answer is written to another special file.

This is an example of an active filesystem: a virtual filesystem with behavior associated with its typical operations. Since the WebDAV server is a Spoon app, we have complete control over the way a virtual filesystem interacts with a user. In particular, we can support commodity tools.

I’m making another active filesystem for the InnoViz project in Amsterdam. This one behaves as a general-purpose database. The class hierarchy still appears as directories, but the methods do not appear. Instead, each class can contain subdirectories representing queries on objects in the database. A query directory contains files indicating the code run by the query, and the objects answered by it. Since queries are just another part of the filesystem, they are persistent and can be reused in another queries by multiple authors. This enables a form of collaborative query.

Users need not be programmers in the traditional sense in order to interact with the database. For example, one may add a new object to the database by editing the another object’s file and saving it under a new name. Still, users who know how to write programs can also interact with the database with their favorite language, they only need to know how to read and write files.

I’m looking forward to finding more use cases for active filesystems…