WaterC# is a high-performance, badass, systems-ready programming language and compiler written in C#. It combines a clean, simple syntax with low-level systems capabilities (pointers, raw memory manipulation, structs, and native FFI), making it suitable for creating operating systems, other programming languages, games, and native desktop applications.
- Zero VS Code Extension Needed: You don't need to search or install any extensions from the VS Code Marketplace! WaterC# has built-in tools that make editor plugins unnecessary:
water studio: Built-in in-browser Web IDE with live editor, runner, examples, and standalone EXE compiler!water check <file>: Visual ASCII error pointers showing exact line & column right in your terminal (no red squiggles extension needed).water fmt <file>: Built-in canonical code formatter (no Prettier or formatter plugin needed).
- Run Anywhere (Zero Dependency): Compiles directly into standalone
.exebinaries with zero runtime baggage. Output executables run on any machine without needingwater.exeor any compiler side-by-side. - Zero File Extension Requirement: Name your files however you like!
main,game.wc,kernel.water, orscript.txt. WaterC# compiles and runs them all seamlessly. - Freestanding C/OS Target (
--target os): Emits pure, freestanding C99 code with hardware I/O macros for bare-metal OS kernels, bootloaders, and microcontrollers. - Fast Interactive Dev: Includes instant direct execution (
water run <file>) and an interactive shell (water repl). - Low-Level Power: Direct heap allocation (
alloc,free), memory peek/poke (peek,poke,peek_int,poke_int), and native Windows API calls (extern fn MessageBoxA(...)).
The compiler builds out of the box using Windows' standard built-in C# compiler:
build.bat(Or via PowerShell: .\build.ps1)
This produces water.exe in the root directory.
# Run a file immediately (extensionless files supported!)
water run examples/hello
# Compile to a standalone .exe (runs anywhere without compiler)
water build examples/hello -o hello.exe
.\hello.exe
# Compile for Bare-Metal OS Kernels (Freestanding C99)
water build examples/os_kernel_stub.wc --target os -o kernel.c
# Start the interactive REPL
water replname = "Aqua"
score = 100
score = score + 25
print("Player:", name, "Score:", score)
if score > 100 {
print("Victory!")
} else {
print("Keep playing!")
}
fn add(a, b) {
return a + b
}
result = add(10, 20)
print("Result is:", result)
for i in 0..5 {
print("Round:", i)
}
buf = alloc(16)
buf[0] = 65 // Write byte directly with brackets!
print("Byte 0:", buf[0])
free(buf)
extern fn MessageBoxA(hwnd: ptr, text: string, caption: string, utype: int): int;
fn main() {
MessageBoxA(0, "Running natively on Windows!", "WaterC#", 64);
}
| File | Description | Run / Build Command |
|---|---|---|
examples/beginner_start.wc |
First Time Coder: Variables, math, if/else, and loops in 15 clean lines! | water run examples/beginner_start.wc |
examples/simple_game.wc |
Beginner Game: A fun dice-rolling adventure with HP, gold, and random rolls. | water run examples/simple_game.wc |
examples/hello |
Zero-extension demonstration. Runs and compiles without any file extension. | water run examples/hello |
examples/fibonacci.wc |
Recursive functions and mathematical loops. | water run examples/fibonacci.wc |
examples/systems_memory.wc |
Heap memory, raw pointers, bitwise math, and struct manipulation. | water build examples/systems_memory.wc -o sys.exe |
examples/mini_lang.wc |
Language Building: A virtual machine and stack-based interpreter written in WaterC#! | water run examples/mini_lang.wc |
examples/os_kernel_stub.wc |
OS Development: Bare-metal VGA text buffer (0xB8000) and hardware control. |
water build examples/os_kernel_stub.wc --target os -o kernel.c |
examples/game_water_snake.wc |
Game Development: Real-time console game with game loop, coordinates, and score. | water build examples/game_water_snake.wc -o game.exe |
examples/win32_window.wc |
Native Win32 GUI MessageBox via FFI. | water build examples/win32_window.wc -o win32.exe |
Usage:
water run <file> Run a WaterC# file immediately
water build <file> [options] Compile to standalone binary or C code
water repl Start interactive WaterC# shell
water version Show version information
water help Show this help menu
Build Options:
-o, --output <path> Specify output executable or file name
-t, --target <exe|c|os> Target backend (default: exe)
- exe: Standalone zero-dependency executable
- os: Freestanding C99 for OS kernels/bare-metal
- c: Standard C99 output
Well... while making it took me one day!? yeah... its a one day project u can get a hang of it
