Installation

First, install git.

Second, install Node.js. WebPPL is written in JavaScript, and requires Node to run. After it is installed, you can use npm (node package manager) to install WebPPL:

npm install -g webppl

Create a file called test.wppl:

var greeting = function () {
    return flip(.5) ? "Hello" : "Howdy"
}

var audience = function () {
    return flip(.5) ? "World" : "Universe"
}

var phrase = greeting() + ", " + audience() + "!"

phrase

Run it with this command:

webppl test.wppl

Updating

WebPPL is in active development. To update WebPPL, run:

npm update -g webppl