Your best companion for getting into the RSA framework and how to implement it with WebPPL is — without a doubt — ProbLang.

WebPPL is a feature-rich probabilistic programming language embedded in Javascript, and you can comfortably run any scripts online here. (Source code on GitHub)

Now, what if you want to run WebPPL locally? The most straightforward guideline for getting started can be found on WebPPL’s very own documentation page: readthedocs

Follow the steps to install git and then install Node.js. After it is installed, you can use npm (node package manager) to install WebPPL:

npm install -g webppl

Unfortunately, I, like many other users, got an error:

Missing write access to /usr/local/lib/node_modules

This is a permission error, which means you don’t have write access to that folder. To solve it, run the following command (which allows you to run as the root user) and try to install the WebPPL package again:

sudo chown -R $USER /usr/local/lib/node_modules

This should get you to successfully have every piece you need in place.

My favourite way to run the scripts is to have the code set up on Atom, open the terminal panel (pick one here), and also install the wonderful WebPPL Live Preview package. After opening it as an additional panel, my Atom setup looks like this:

And you are ready to go.