dhad is an experimental compiler for a small Arabic C-like programming language.
It is still very much in its infancy: the grammar is evolving, the runtime is tiny,
and most subsystems are rough prototypes.
The language uses a handwritten LALR(1) parser and an LLVM backend (so hopefully a WASM interpreter soon).
-
Install prerequisites
- CMake 3.22 or newer
- LLVM (version >= 17)
- Clang/Clang++ toolchain (incl.
clang-format) - Python 3.10 or newer
-
Clone and configure
git clone https://example.com/dhad.git cd dhad cmake -S . -B build
-
Build the compiler
make
-
Run the smoke tests (lexer, parser, codegen)
make test -
Try the hello world example
./build/dhad examples/hello-world.dh -o hello ./hello
- Programs must import the standard module (so far only print lol) via
استورد أساس;and expose an entry point calledدالة بداية(). - The parser/generator infrastructure relies on Python scripts in
tools/. Regenerate tables withcmake --build build --target parser_tables_genif you edit the grammar. make formatrunsclang-formatoversrc/andtests/.
Contributions are welcome, just be aware that the design is changing quickly and I am still figuring out the fundamentals. Tune in via issues/PRs if you want to help shape the language.