SultanC is a systems programming language designed with Arabic as its primary language while offering an interchangeable English syntax. Both surfaces compile to the same syntax tree and semantics, and diagnostics can be presented in either language. The language combines static ownership and borrow checking with algebraic data types, exhaustive pattern matching, generics, compile-time evaluation, and error values. It also provides threads and synchronization primitives, with checks on which values threads may capture. Its compiler uses a verified intermediate representation, checking each transformation before code generation.
The compiler is written in SultanC and verifies its self-hosting by requiring successive compiler generations to produce byte-identical results. It supports native x86-64 and ARM64 code generation, LLVM-based cross-compilation for other targets, and WebAssembly; listed platforms include Linux, macOS, Windows, FreeBSD, and Android. A shared interpreter runs the same intermediate representation and standard library without compilation. The library covers text processing, collections, files, networking, data formats, compression, cryptography, and concurrency. Building typically requires a C compiler and LLVM, though bootstrap options include a WebAssembly seed or an existing SultanC compiler. The project includes documentation on its compiler architecture, type system, safety model, platform support, and Arabic terminology, and is distributed under the MIT license.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.