Language Fundamentals

A RUDRA program is a set of functions. Execution begins at main.

Program structure

fn main() {
    print("Hello, RUDRA!");
}

Statements

Statements end with a semicolon. Bindings, assignments, function calls and control-flow blocks make up the body of a function.

Comments

RUDRA supports line and block comments.

fn main() {
    print("start");
    print("end");
}

In your own source you may write // line comment and /* block comment */. This documentation keeps examples comment-free for clarity.

Printing

The built-in print writes a value followed by a newline. It accepts strings, integers, floats and booleans.

fn main() {
    print("text");
    print(42);
    print(3.14);
    print(true);
}