WebPPL is probably positioned as an educational framework to teach probabilistic programming but I found it has lots of features which makes it ideal for experimentation before moving on to more robust things, like PyMC3 and Pyro. This JavaScript library boasts:

As an example, this is a simple weather model with temperatures depending on a Bernoulli flip whether it’s clouded or sunny:

It results in a clean line-chart

If you want add a factor (i.e. constraint) you can do so with the ‘condition’ statement:

corresponding to an observation of a temperature around 25 degrees:

telling you that around this temperature there is an equal chance of having a ‘cloud’ or ‘sunny’ variable. The viz framework auto-detects what works best. If you return a boolean you’ll get a bar-chart which shows even more clearly the result:

Now, let’s do the same with PyMC3. It takes more code and a different way of thinking too:

In Pyro it amounts to something like

Although Pyro is the cool new kid in the PPL landscape I found it more abstruse, especially trying to understand how to impose constraints.

Take a look at the wonderful WebPPL tutorials related to multi-agent modeling and how HTML/JS works as a rapid prototyping environment.