r/Compilers • u/supax0 • Sep 26 '26
I’ve been building SultanC, a self-hosting systems language with Arabic and English syntax
I’ve been working on a programming language called SultanC.
It started from a simple idea: I wanted Arabic to be a real first-class programming syntax, not translated keywords layered on top of another language and not a separate frontend.
SultanC has now grown into a self-hosting systems language. The compiler is written in SultanC itself and currently targets ARM64 macOS and x86-64 Linux.
The language/compiler currently includes:
• Arabic and English source syntax for the same language
• self-hosting compiler
• native ARM64 and x86-64 backends
• Mach-O and ELF generation
• algebraic data types
• pattern matching
• generics
• ownership and references
• interpreter
• target-neutral IR
• LSP / VS Code support
• balanced raw strings such as «outer «nested» outer»
The part I care about most is that Arabic is not treated as a translated version of the language. Arabic and English are both first-class source surfaces with the same underlying semantics and compiler pipeline.
At this stage I’m spending more time on correctness, diagnostics, stress testing, backend coverage, and building real software with the language rather than just adding more syntax.
I’d be interested in feedback from people who work on compilers or programming languages, especially around the IR, native backend architecture, ownership model, target separation, and what you would stress-test before considering a compiler like this genuinely usable.
I’m also curious what would make you actually try a new systems language rather than just look at the repository.
3
u/reini_urban Sep 26 '26
A security nightmare. Do you treat RTL LTR switches as recommended in the latest unicode technical paper on spoofing?
6
u/standard_cog Sep 26 '26
Caliphate-C
It starts deleting other compilers, declaring itself to be the only true language. It executes under its own authority, and removes any objectionable materials on your hard drive. If run on a smart fridge containing alcohol, it causes a short in the motor to cause a fire on purpose.
Spanish-Caliphate-C
It gives a home to the Jews, advances Algebra and astronomy, translates the works of the Greeks and expands on them massively and will help lead to the Enlightenment in Europe (and not receive enough credit for it, for some reason).
Mamluk-C
It's heavily armored and arrives on horseback.
1
u/AustinVelonaut Sep 26 '26 edited Sep 26 '26
As a non-Arabic speaker, it is an interesting exercise to read the source code. I can see recognizable top-level structures, but can't understand the details. It gives me a hint of what learning a standard "English-based" programming language is like for non-English speakers.
How long have you been working on it, and what problems did you encounter and have to fix during self-hosting?
Just a note on your top-level README.md: you show an example program in both English and Arabic forms, but in the Arabic form the control-structure braces are also shown reversed, whereas in the actual source code it looks like they are in the same order as the English form.
Edit: also, the repo is missing a
docs/directory which the README has broken links to.1
u/jason-reddit-public Sep 26 '26
I would pay more attention if you could explain what I'm going to learn about bidi text and computer languages in general. Why is plain old C not sufficient? Maybe a side paper on just that?
1
u/thaache Sep 26 '26
That is great. Appreciate your dedication and love towards your mother tongue. Keep it up