technology from back to front

August, 2012: Intercession without source changes

Methods in a Smalltalk object live in the method dictionary of its class. A method dictionary maps Symbol s to CompiledMethod s. From the virtual machine’s perspective, anything that understands #run:with:in is compatible with a CompiledMethod , in the sense that the VM sends this message to things that it will execute.

As a result, it’s easy enough to put arbitrary objects (that understand #run:with:in ) in a class’s method dictionary. In fact, there’s a library for it.

With this hammer in hand, it becomes trivial to perform all manner of intercessions on code, without instrumenting code through a rewrite+compile cycle: wrap the CompiledMethod in an ObjectAsMethodWrapper (or several) and away you go. What might you do? Pre- and post-condition checking, flagging which methods execute for coverage analysis, profiling, and so on. Today we’re going to turn a method into a memoised one.

(more…)

by
Frank Shearar
on
31/08/12

August, 2012: TDD for Esoteric Programming Languages (using Clojure and Befunge)

I’ve been learning Clojure recently, and I’d been looking around for a good initial project to test my new knowledge. I’ve always wanted to write a Befunge interpreter, and so decided that sounded like a fun project. Little did I know the maze of twisty little passages I was letting myself in for, but I’ve learnt a lot of interesting things along the way, and there’s a few things worth sharing. (more…)

by
Tom Parker
on
25/08/12

August, 2012: Monticello -> Git

Back in the dark years of 2003, Avi Bryant and Colin Putney tried to use CVS to version their Smalltalk code and failed dismally. They decided to scratch their itch, and Monticello was born, a DVCS centred around managing the structured text of Smalltalk code.

Years have passed, and nowadays we have Mercurial and Git providing succour to so many. How can Smalltalk leverage these tools, instead of maintaining its own custom version control system?

(more…)

by
Frank Shearar
on
20/08/12
2000-13 LShift Ltd, 1st Floor Office, Hoxton Point, 6 Rufus Street, London, N1 6PE, UK +44 (0)20 7729 7060