Obtaining Pola

Downloading a pre-compiled binary

The easiest way to get started is to download one of the pre-compiled standalone executable files. Not all platforms have executables available and they may not always be up to date, but it is definitely the easiest way to get started. Go to the Files page and find your platform.

Once you have a binary, you will need some Pola source code to try it out on. I recommend downloading Simple.pola which is just a few silly and arithmetic Pola functions. Once you've downloaded that file, you can run, e.g., ./pola Simple.pola, which will load the Pola file and perform type inference. You will then be placed at a prompt where you can try typing in Pola expressions, such as mul(3, 5). Once you're bored of the interpreter you can type :q to quit.

Building from source

To get the source code for Pola, you need to install Subversion on your system. There are many Subversion clients available for all major platforms, many of them offering GUIs, but we only cover the command-line interface here.

Once Subversion is installed, switch to the directory you want to download the source code to and type:
svn co http://projects.wizardlike.ca/svn/pola/trunk

Dependencies

To compile the Pola source code, you need:
  • happy (note: happy should come by default with GHC these days, so it will likely not need to be installed separately)
  • a modern version of GHC (may not compile with GHC before 6.10)
  • pdflatex (optional: to generate documentation)

Let us know if you're having trouble getting it installed. Some of these dependencies can likely be worked around, but it hasn't come up yet.

Building

Note that on some systems (e.g., Solaris), GNU make may be called gmake as opposed to make. To build everything, change into the main Pola directory (where GNUmakefile resides) and type:
make

To build just the compiler, type:
make compiler

You should be left with an executable called pola in the built directory.

Using Pola

If you've downloaded the source code, you will already have a number of example source files in the test/ directory. You can run it via built/pola test/Simple.pola, for instance. That will load the source file Simple.pola and bring you into the interpreter where you can evaluated expressions.

If you haven't downloaded the source code (e.g., you've downloaded just the standalone executable), you can find the example files in the repository

Also available in: HTML TXT