Stochastic Pi Machine

Stochastic Pi Machine

Established: November 21, 2008




The Stochastic Pi Machine (SPiM) is a programming language for designing and simulating computer models of biological processes. The language is based on a mathematical formalism known as the pi-calculus, and the simulation algorithm is based on standard kinetic theory of physical chemistry. The language features a simple graphical notation for modelling a range of biological systems, and can be used to model large systems incrementally, by directly composing simpler models of subsystems


  • Introductory chapter on SPiM [pdf]
  • Introductory slides on SPiM [ppt] [pdf]
  • Basic SPiM examples and simulation results [pdf]
  • Coupled chemical reactions in SPiM [pdf]
  • The SPiM language definition [pdf]
  • Some 3D videos of SPiM simulations: Repressilator [wmv] Mapk [wmv] MHCI [wmv]

Online Simulator (2011-0506)

Download (version 0.05, 2008)



  • Luca Cardelli worked on the formal specification of SPiM, the design of the SPiM language, and on extensive testing and debugging.
  • Rich Williams developed the Network 3D software for visualising simulations in 3D.
  • Stefan Leye assisted with debugging the SPiM scheduling algorithm.
  • James Margetson and Luca Cardelli developed the SPiM GUI.
  • Pascal Zimmer assisted with debugging the OCaml bytecode distribution.
  • The BioSpi project was the main inspiration for SPiM, and many of the SPiM chemical examples are adaptations of earlier BioSpi models.
  • The core SPiM language was developed in F#.