The Stochastic Pi Machine language (SPiM) is a programming language for modelling and simulating complex biological processes in a modular way. The language is based on a computational 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 interactions between biological processes, and can be used to model large systems incrementally, by directly composing simpler models of subsystems.


Related publications


Andrew Phillips, Luca Cardelli, Matthew Lakin, Filippo Polo, Microsoft Research.


  • 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#.


  • Introductory Tutorial.
  • 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]


Contact Us Terms of Use Trademarks Privacy Statement © Microsoft Corporation. All rights reserved.