Arabic Programming Language

I felt like writing Rust, so I hand-rolled a lexer, parser, and interpreter in Rust (no LLVM shortcuts) for a Turing-complete Arabic programming language.

I then compiled this Rust program into WebAssembly (WASM) so that people could play around with the language and run programs directly in their browser (completely client-side).

You can skip ahead to the playground section if you're eager to see the language in action.

This project was purely for educational and entertainment purposes. An excuse to write more Rust to be frank, and an excuse to experiment with WASM.

Turing-Completeness

One way of proving that a programming language is Turing-complete is to implement a Universal Turing Machine (UTM) simulator in that language.

Because the language has the capabilities of conditional branching, iteration, and variables, writing a UTM simulator is possible. I'll keep this exercise for a subsequent post.

Language Reference

As it stands today, the language is procedural, dynamically-typed, and has a C-style syntax.

Keywords

The language uses Arabic keywords for control flow and declarations.

Keyword Description
ليكنDeclares a new variable
دالةDefines a function
إذاStarts a conditional if statement
وإلاSpecifies the else branch
طالماCreates a while loop
أرجعReturns a value from a function
صادقBoolean literal for true
كاذبBoolean literal for false
عدمRepresents the absence of a value (null)
وLogical AND operator
أوLogical OR operator

Symbols

Symbol Description
؛Statement Terminator (Arabic Semicolon)
،Separator (Arabic Comma)
\Division (Backslash, differs from standard /)
\\Line Comments
( )Grouping
{ }Scope Blocks

Standard Library

Currently the language only supports a native function for printing (i.e., طبع).

Playground

You can try the language yourself in the editor below.

Output:
← Back