Install Ḍād¶
New to programming?
The tutorial starts from here and ends with a site online. It is also in Arabic. You can also run code in your browser without installing anything.
Install¶
Open a new terminal afterwards. winget upgrade mtwalli.dad updates it later.
Download dad_<version>_amd64.deb (or _arm64.deb) from the
releases page, then:
Download dad-<version>-1.x86_64.rpm (or .aarch64.rpm) from the
releases page, then:
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, for example ضاد 0.2.0. On macOS and Linux, Homebrew,
the packages and the install script also give you the command's Arabic name, ضاد.
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. Ḍād writes numbers with the digits 0-9 only, so a number typed with Arabic-Indic digits is an error:
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 fmt <file or folder> |
ضاد نسق <ملف> |
Format files in place (--check lists the ones that need it). See Formatting |
dad lsp |
ضاد خادم_اللغة |
The language server, for editors: definitions, references, rename, completion. See the editor guide |
dad dev <file> |
ضاد تطوير <ملف> |
Serve routes and server functions on localhost:8080, reloading on save (--port to change it). See Server and data |
dad serve <file> |
ضاد انشر <ملف> |
Run the program as a production server: no developer page, no reloading, every network interface, $PORT (--port, --host, --data). See Putting a program online |
dad build <file> |
ضاد ابن <ملف> |
Compile to JavaScript: a static site for a program with an interface, otherwise app.js for Node (--out to choose the folder). See Building for the web |
dad check <file> |
ضاد فحص <ملف> |
Check a file without running it: syntax, names, arguments, types and طابق cases (--json for tools) |
dad preview <file> |
ضاد معاينة <ملف> |
The page of the program's interface, as JSON, for an editor's preview. See Preview the interface |
dad tokens <file> |
ضاد رموز <ملف> |
Print every token with its line and column |
dad version |
ضاد إصدار |
Print the installed version |
dad help |
ضاد مساعدة |
List the commands |
Uninstall¶
Delete %LOCALAPPDATA%\dad, then remove that folder from your user PATH in
Settings → System → About → Advanced system settings → Environment Variables.