Skip to main content

Xvr A Tiny Educational Interpreter

Learn how interpreters work by writing and running simple code

XvrLang code example
// defining the variable
var name = "arfy";

// can explicitly with some data types
var other: string = "james";

// cannot using space if using long variable name
var someNumber: int = 30;
var SomeFloating: float = 3.14;
var sOmeStRing: string = "wello";
var soMeboOlean: bool = true;
var somEArray: [int] = [1, 2, 3];
var sOmeData: [string: int] = ["pertama": 1, "kedua": 2];

Typed Variables

Declare variables with explicit types like int and string for safer and clearer code.

Control Flow Support

Use if, while, and for loops to build logic and handle repetitive tasks easily.

// let's we create some example
var today_raining: bool = false;

if (today_raining) {
print("wear jacket or use umbrella");
} else {
print("use sunglasses");
}

if (!today_raining) {
print("use sunglasses");
} else {
print("wear jacket");
}
proc call() {
print("hello");
print("we can make some procedure");
}

// call it
call();

Procedures & Recursion

Define reusable procedures with proc, support parameters and return values, even recursive functions like Fibonacci.

Bytecode Interpreter

xvr compiles your code into an intermediate bytecode and interprets it—great for learning how interpreters and virtual machines work.

still in confusion

Help & Support

Join our community on Discord — ask questions, share, help others.