A programming language that reads like thought. No parentheses, no commas, no semicolons โ just logic.
def add(x, y):
return x + y
result = add(3, 5)
print(result)
function add x y return x + y print add 3 5
Everything you need, nothing you don't.
Interpret with saurav.py for quick runs, or compile to native C with sauravcc.py for maximum performance.
No parens for calls, no commas between args, no semicolons. Indentation defines blocks. Code reads like pseudocode.
Full recursion support. Parentheses disambiguate nested calls: factorial (n - 1).
Dynamic arrays with append, len, indexing, and assignment. Compiles to bounds-checked C arrays.
Object-oriented with class, self, and new. Methods and field access via dot notation.
try/catch blocks. The compiler maps these to setjmp/longjmp in generated C.
Requirements: Python 3, gcc (MinGW on Windows) for compiling.
Run with the interpreter:
Or compile to native executable:
See sauravcode in action.
function fib n if n <= 1 return n return fib (n - 1) + fib (n - 2) print fib 10 # 55
function factorial n if n <= 1 return 1 return n * factorial (n - 1) print factorial 10 # 3628800
# Dynamic lists with bounds checking nums = [10, 20, 30] append nums 40 for i 0 (len nums) if nums[i] > 25 print nums[i] # prints 30, 40
class Point function init x y self.x = x self.y = y function display print self.x print self.y p = new Point p.init 10 20 p.display
From .srv to native executable in four stages.
| Stage | Input | Output | Tool |
|---|---|---|---|
| 1. Tokenize | Source code | Tokens | Regex scanner |
| 2. Parse | Tokens | AST | Recursive descent |
| 3. Generate | AST | C source | CCodeGenerator |
| 4. Compile | C source | Executable | gcc |
Use --emit-c to see the generated C code, or --keep-c to preserve it alongside the binary.
Deep-dive into sauravcode.