Getting started with Plasma
version 0.1, Feburary, 2020
Since we don’t have static builds yet, you’ll need to build Plasma from source. This file contains some instructions on setting up the prerequisites and buidling Plasma.
You’ll need another language, Mercury, since our compiler is written in it. A recent snapshot release (ROTD) is required. ROTD 2020-01-08 is known to work. Compiling Mercury from source can take a long time, but if you’re on Debian, Ubuntu or other derivative running on x86_64 then there are some packages! Read on or follow the instructions at https://dl.mercurylang.org/deb/
For Ubuntu 18.04, this is what you need to do:
You’ll need a basic C and C++ build environment. That can be installed with the build-essential:
sudo apt install build-essential
Next install the repo where you can find the packages, They’re signed with Paul’s gpg key, so you’ll need to tell apt to trust things signed by it:
cd /tmp wget https://paul.bone.id.au/paul.asc sudo apt-key add paul.asc
Create a new file in /etc/apt/sources.list.d, name it mercury.list and paste in it:
deb http://dl.mercurylang.org/deb/ stretch main deb-src http://dl.mercurylang.org/deb/ stretch main
sudo apt update sudo apt install mercury-rotd-recommended
If all goes well you now have a working version of Mercury on your computer.
To optionally build the documentation, you want to install AsciiDoc:
sudo apt install asciidoc
Beware, this is a very large installation, on a default Ubuntu installation this amounts to over 1 GB of space and a download of over 300MB. If AsciiDoc is not installed, documentation will not be built.
Now it’s time to clone the plasma repo:
git clone https://github.com/PlasmaLang/plasma.git
If you want or need to, you can configure Plasma’s build settings by copying template.mk to build.mk and editing it. It some contains documentation that explains the build options. These include which C compiler to use, and compilation flags. The default build is reasonable if you have gcc.
Then run make and it will build you the plasma compiler (src/plzc) and the runtime (runtime/plzrun)
The make test command will execute the test suite. Be sure to take a look at the example programs in examples/.
If you’re stuck and the Documentation doesn’t contain the answer or clue you need or you’re struggling to find it. Please ask for help. The Contact page of the website lists all the ways you can get in touch. In particular the Plasma Help mailing list and IRC channel are the best resources for help.
For bugs or missing information please file a bug.
If you want to write some Plasma programs and you use vim. You may wish to use the vim editor support.