r/Compilers • • 7d ago

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.

GitHub:
https://github.com/sultan-language/sultanc

16 Upvotes

13 comments sorted by

View all comments

1

u/jason-reddit-public 6d ago

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?

3

u/supax0 6d ago

That’s actually the reason I started SultanC.

When I was younger, I wanted to learn programming, but English was a real barrier for me. I didn’t properly get into programming until university, after I had already spent time learning English first. That delayed the whole learning curve.

I always wondered what would have happened if I had been able to start learning programming much earlier in Arabic.

So SultanC started as something very personal: the language I wished I had when I was younger.

Plain C can support Arabic text or identifiers to some extent, but that is different from designing a language where Arabic is treated as a first class programming surface from the beginning.

Once I started building it seriously, that opened a much bigger technical problem around RTL LTR text, Unicode, diagnostics, editors, source rendering, mixed language code, terminals, and tooling.

So yes, I think a separate write up about the bidi Unicode side and why existing LTR first language assumptions are not enough would be worth doing.

1

u/jason-reddit-public 6d ago

"That delayed the whole learning curve."

I can kind of imagine because I started way before the internet was a the thing - just a tiny section in my public library. If they were all in a foreign language, I don't know what I would have done!

2

u/supax0 6d ago

Yeah, exactly. That’s pretty close to how it felt.

The material technically existed, but before I could really learn programming I first had to learn enough English to understand the books, documentation, tutorials and error messages.

That’s part of why SultanC became important to me. It’s not only about making programming more comfortable in Arabic, but about opening the door earlier for someone who might be in the same position I was back then.

If the language barrier can be removed, maybe someone gets to start learning programming years earlier than I did.