Languages
D
Installing the D Programming Language on Ubuntu in TIDE
D Programming Language
D is a general-purpose programming language with static typing, systems-level access, and C-like syntax, designed for high productivity and performance.
Installation
You can install D on Ubuntu using either the LLVM D Compiler (ldc) and package manager (dub) via apt, or using the official installation script for dmd.
Option 1: Using apt (Recommended)
Run the following commands in TIDE's terminal:
sudo apt update
sudo apt install -y ldc dubOption 2: Using the Official DMD Installer
To install the reference compiler (dmd):
curl -fsSL https://dlang.org/install.sh | bash -s dmd
source ~/dlang/dmd-*/activateVerification
Check the compiler version:
ldc2 --versionWriting and Running Code
Create a file named hello.d:
import std.stdio;
void main() {
writeln("Hello, World from D!");
}Run the script directly using rdmd or compile it with ldc2:
rdmd hello.dOr compile into an executable:
ldc2 hello.d -of=hello
./hello