This is an absolute work of art, if you take the time to digest what they've done. In order to articulate a model of cognition, they have implemented a probabilistic version of Scheme, that compiles to JavaScript, and that allows for forward and reverse simulation in the browser. Given a model that can simulate forward from causes to effects, you can simulate backward (perform inference) from observed effects to causes, all inline throughout the book.
I am one of the contributors to this project. This site is used as the interactive textbook for a class taught by my PhD advisor at Stanford (Psych 204: Computation and Cognition)
Caveat emptor: the project is under very rapid development