THIS PROJECT HAS MOVED TO: https://github.com/SindarinSDK/sindarin-compiler/blob/main/README.md
Sindarin is a statically-typed procedural programming language that compiles to C. It features clean arrow-based syntax, powerful string interpolation, and built-in array operations.
.sn source → Sn Compiler → C code → GCC/Clang → executable
- Static typing with explicit type annotations
- Arrow syntax (
=>) for clean, readable code blocks - String interpolation with
$"Hello {name}!" - Arrays with built-in operations (push, pop, slice, join, etc.)
- Structs for structured data and C library interop
- String methods (toUpper, toLower, trim, split, splitLines, isBlank, etc.)
- File I/O with TextFile and BinaryFile types
- Control flow with for, for-each, while, break, continue
- Module imports for code organization
- Arena memory with shared/private scopes and copy semantics
- C interoperability with native functions, pointers, and callbacks
- SDK modules for compression, math, and more
# Download the .deb package from the latest release
sudo dpkg -i sindarin_*.deb
# Dependencies (gcc, zlib) are installed automatically
sn --version# Download the .rpm package from the latest release
sudo rpm -i sindarin-*.rpm
sn --version# Download PKGBUILD from the release
curl -LO https://github.com/RealOrko/sindarin/releases/latest/download/PKGBUILD
# Build and install
makepkg -si# Download the formula from the release
curl -LO https://github.com/RealOrko/sindarin/releases/latest/download/sindarin.rb
# Install (will prompt for Xcode CLT if needed)
brew install --formula ./sindarin.rb# Download and extract
tar xzf sindarin-*-linux-x64.tar.gz # or macos-x64
cd sindarin-*/
# Add to PATH or copy to /usr/local
export PATH="$PWD/bin:$PATH"
sn --versionOption 1: Winget (local manifest)
# Download winget-manifests.zip from the release
Expand-Archive winget-manifests.zip -DestinationPath winget-manifests
winget install --manifest ./winget-manifestsOption 2: Manual installation
# Download and extract the ZIP
Expand-Archive sindarin-*-windows-x64.zip -DestinationPath C:\sindarin
# Add to PATH
$env:PATH += ";C:\sindarin\bin"
sn --versionPrerequisite for Windows: LLVM-MinGW is required (provides clang).
# Prerequisites: CMake, Ninja, GCC or Clang, zlib
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
bin/sn --versionSee docs/building.md for detailed build instructions.
# Compile a program
sn samples/main.sn -o myprogram
./myprogram
# Or emit C code only
sn samples/main.sn --emit-c -o output.cfn is_prime(n: int): bool =>
if n <= 1 =>
return false
var i: int = 2
while i * i <= n =>
if n % i == 0 =>
return false
i = i + 1
return true
fn main(): void =>
var primes: int[] = {}
for var n: int = 2; n <= 50; n++ =>
if is_prime(n) =>
primes.push(n)
print($"Primes: {primes.join(\", \")}\n")
| Document | Description |
|---|---|
| Overview | Language philosophy, syntax overview, examples |
| Building | Build instructions for Linux, macOS, Windows |
| Strings | String methods and interpolation |
| Arrays | Array operations and slicing |
| Structs | Struct declarations and C interop |
| Lambdas | Lambda expressions and closures |
| Memory | Arena memory management |
| Threading | Threading with spawn and sync |
| Namespaces | Namespaced imports for collision resolution |
| Interop | C interoperability and native functions |
| Interceptors | Function interception for debugging and mocking |
| Document | Description |
|---|---|
| SDK Overview | All SDK modules |
| Date | Calendar date operations |
| Time | Time and duration operations |
| Random | Random number generation |
| UUID | UUID generation and manipulation |
| Environment | Environment variable access |
| Process | Process execution and output capture |
| File I/O | TextFile, BinaryFile, Path, Directory |
| Networking | TCP and UDP operations |
Source (.sn)
↓
Lexer → Parser → Type Checker → Optimizer → Code Gen → GCC
↓
Executable
See src/ for compiler implementation details.
The unified Python test runner works on all platforms (Linux, macOS, Windows):
python scripts/run_tests.py unit # Unit tests
python scripts/run_tests.py integration # Integration tests
python scripts/run_tests.py explore # Exploratory tests
python scripts/run_tests.py sdk # SDK tests
python scripts/run_tests.py all # All test suitesOptions:
-j N/--parallel N- Run tests with N parallel workers (default: CPU count)-v/--verbose- Show detailed output on failures--exclude TESTS- Comma-separated list of tests to skip
├── src/ # Compiler source code
├── sdk/ # SDK modules (date, time, io, net, etc.)
├── tests/ # Unit, integration, exploratory, and SDK tests
├── samples/ # Example .sn programs
├── docs/ # Language and SDK documentation
├── scripts/ # Build and test scripts
├── packaging/ # Platform packages (deb, rpm, homebrew, etc.)
├── benchmark/ # Performance benchmarks
├── bin/ # Compiled outputs (sn, tests)
├── build/ # CMake build directory
├── cmake/ # CMake modules
├── vcpkg/ # vcpkg dependencies
└── CMakeLists.txt # CMake build configuration
- Fork the repository
- Create a feature branch
- Run tests with
make test - Submit a pull request
MIT License - feel free to use, modify, and distribute!
Named after the Elvish language from Tolkien's legendarium