Overview

These are my notes on how to install a D Programming Language compiler along with its package management tool Dub, and how to set up a first "Hello World" project on a Raspberry Pi running Raspbian.

Installing the Compiler

I've chosen the GDC compiler due to its comprehensive architecture support (https://wiki.dlang.org/Compilers#Comparison) and ease of install:

sudo apt-get install -y gdc

Installing DUB

DUB is the D Programming Language package manager, similar to Node.js npm and PHP Composer. Installing DUB on Raspbian is done by downloading the latest release:

wget https://code.dlang.org/files/dub-0.9.24-linux-arm.tar.gz && tar -zxvf dub-0.9.24-linux-arm.tar.gz

Optionally, copy the dub binary to a system path:

cp dub /usr/local/bin

Creating Your First Project

Once installed, create a project using:

dub init helloworld

This command generates the directory structure for your application. Your code will be located at:

./helloworld/source/app.d

To compile and run it, cd into ./helloworld and run:

dub