Skip to content

Install Ḍād

What works today

dad run runs Ḍād programs: values, functions, lambdas, types, enums, matching, optionals and errors. Tables, components and routes (جدول, مكون, مسار) come in Phases 2 and 3 (see the roadmap). You can also run code in your browser without installing anything.

Install

curl -fsSL https://raw.githubusercontent.com/mtwalli/dad-lang/main/install.sh | sh

The script downloads the latest release for your system, verifies its checksum and puts dad in ~/.dad/bin, together with the Arabic alias ضاد. If that folder isn't on your PATH yet, the script prints the one line to add.

In PowerShell:

irm https://raw.githubusercontent.com/mtwalli/dad-lang/main/install.ps1 | iex

The script installs dad.exe in %LOCALAPPDATA%\dad\bin and adds it to your PATH. Open a new terminal afterwards.

If you have Go 1.24 or newer:

go install github.com/mtwalli/dad-lang/cmd/dad@latest

Download the archive for your system from the releases page, unpack it and put dad (or dad.exe) anywhere on your PATH. checksums.txt lists the SHA-256 of every archive.

To install a specific version, set DAD_VERSION, for example DAD_VERSION=v0.1.0, before running the script.

Check the installation

dad version

You should see the version number in Arabic and Latin digits, for example ضاد ٠.١.٠ (0.1.0).

Your first file

Save this as hello.dad:

// أول برنامج بلغة ضاد
ثابت اسم = "العالم"
اطبع("مرحبا يا {اسم}!")

Run it from the folder where you saved it:

dad run hello.dad        # or: ضاد شغل hello.dad
مرحبا يا العالم!

dad hello.dad works too. Any .dad file runs the same way, for example the examples in the repository:

git clone https://github.com/mtwalli/dad-lang
cd dad-lang
dad run examples/03-shapes.dad

When something goes wrong

Errors found while running stop the program and point to the line, in Arabic:

ثابت أ = ١٠
اطبع(أ / ٠)
hello.dad: خطأ أثناء التشغيل [السطر ٢، العمود ٨]: مشكلة لم تُعالَج: قسمة على صفر

To find mistakes without running anything, use check:

dad check hello.dad      # or: ضاد فحص hello.dad
✓ hello.dad: لا أخطاء (١١ رمزاً)

Now add a line with a mistake, a number that mixes Arabic and Latin digits:

ثابت عمر = ١2

Check again. Ḍād reports the problem in Arabic, with its line and column:

hello.dad: خطأ [السطر ٤، العمود ١٢]: لا يجوز خلط الأرقام العربية (٠-٩) واللاتينية (0-9) في عدد واحد

To see how Ḍād reads your code, print its tokens:

dad tokens hello.dad     # or: ضاد رموز hello.dad

For highlighting, errors as you type and a Run button, install the Ḍād extension for VS Code (or search for Ḍād in the Extensions view). The editor guide has the details.

Commands

Command Arabic What it does
dad run <file> ضاد شغل <ملف> Run a program (dad <file> also works)
dad check <file> ضاد فحص <ملف> Report errors and warnings in a file (--json for tools)
dad tokens <file> ضاد رموز <ملف> Print every token with its line and column
dad version ضاد إصدار Print the installed version
dad help ضاد مساعدة List the commands

Uninstall

rm -rf ~/.dad

Then remove the PATH line from your shell profile if you added one.

Delete %LOCALAPPDATA%\dad, then remove that folder from your user PATH in Settings → System → About → Advanced system settings → Environment Variables.

rm "$(go env GOPATH)/bin/dad"