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:
tar -xzf dlang-0.1.0-<os>-<arch>.tar.gz
cd dlang-0.1.0-<os>-<arch>
./install.shNative platform packages are also available:
- macOS (
.pkg): Run the signed installer package to install into/usr/local/bin/dlang. - Debian / Ubuntu (
.deb): Install withsudo apt install ./dlang_0.1.0_amd64.deb.
Windows (PowerShell)
Extract the release .zip archive and run the PowerShell installer:
powershell -ExecutionPolicy Bypass -File .\install.ps1Verify Your Installation
dlang --versionRun Your First Program
Create a file named 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:
dlang check hello.dl
dlang run hello.dlBuild 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:
dlang build hello.dl -o hello
./helloInteractive REPL
Launch the interactive REPL to test expressions and functions live:
dlang repl