Getting Started / Installation & Quick Start

Installation & Quick Start

Install Dlang on macOS, Linux, or Windows, run your first .dl program, and build a standalone native executable.

Install Dlang

Download the latest release package for your platform and ensure clang is available on your PATH for native compilation (dlang check and dlang repl also work without Clang).

macOS & Linux

Install from a downloaded release tarball (.tar.gz) into $HOME/.dlang and add dlang to your PATH:

terminal
tar -xzf dlang-0.1.0-<os>-<arch>.tar.gz
cd dlang-0.1.0-<os>-<arch>
./install.sh

Native platform packages are also available:

Windows (PowerShell)

Extract the release .zip archive and run the PowerShell installer:

powershell
powershell -ExecutionPolicy Bypass -File .\install.ps1

Verify Your Installation

terminal
dlang --version

Run Your First Program

Create a file named hello.dl:

hello.dl
x = 10
y = 2.5
show x
show y

fn square(n)
    return n ^ 2
end

show square(12)

Type-check and run it with dlang:

terminal
dlang check hello.dl
dlang run hello.dl

Build a Standalone Executable

Use dlang build to compile a self-contained native binary. The generated executable does not require dlang, Clang, or .dl source files on the target machine:

terminal
dlang build hello.dl -o hello
./hello

Interactive REPL

Launch the interactive REPL to test expressions and functions live:

terminal
dlang repl