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¶
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:
The script installs dad.exe in %LOCALAPPDATA%\dad\bin and adds it to your PATH.
Open a new terminal afterwards.
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¶
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 hello.dad works too. Any .dad file runs the same way, for example the
examples in the repository:
When something goes wrong¶
Errors found while running stop the program and point to the line, in Arabic:
To find mistakes without running anything, use check:
Now add a line with a mistake, a number that mixes Arabic and Latin digits:
Check again. Ḍād reports the problem in Arabic, with its line and column:
To see how Ḍād reads your code, print its tokens:
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 |