STON for VAST on VASTGoodies


I’ve just uploaded a port of STON, the Smalltalk Object Notation for VA Smalltalk to the VASTGoodies.com repository.

STON is a project that was implemented by Sven van Caekenberghe on Pharo Smalltalk and it is a slightly extended version of JSON (Javascript Object Notation) to persist Smalltalk objects in a human and machine readable form. JSON is a bit of a successor for XML in many areas, because it holds some of the promises that XML never could. In fact, the format itself is language independent, so you could also export and import objects from most other object oriented language. STON can also read and write pure JSON data.

The code is quite compact and well-done. I had to change a few things, mostly in the tests, due to language constructs that are supported in Pharo Smalltalk but not in VAST.

What can STON be used for? The options are numerous, but there are a few highlights I’d like to mention and that I found it promising for:

  • Use it as as simple persistence mechanism to save objects (like XML, but easier to edit)
  • Exchange data between two Smalltalk dialects or Smalltalk and any other language that speaks JSON/STON
  • Send JSON data to a JavaScript application that runs in a web browser
  • Exchange Smalltalk objects with a web application implemented in Amber.js
  • you can surely think of others…

STON is extremely simple to use and performance is not too bad for reasonable amounts of objects. More details about STON can be found on its github page.

So I’d be interested in hearing if STON is being used in the VA ST world and of course also about bugs and possible extensions.

STON also is the basis of Cypress, which is intended to make version control of Smalltalk code in “normal” source control systems like git or mercurial simpler. Who knows, maybe cypress one day even allows for exchange of smalltalk source code between smalltalk platforms with at least some level of automatic code conversion.