Skip to content

Getting Started

Create a file named hello.tpr:

// Hello World with UTF-8 support
str greeting = "Merhaba Dünya!";
print(greeting);
// Function definition
func square(int n) {
return n * n;
}
// Usage
int result = square(5);
print("5'in karesi:", result);

You can run your Tulpar program using the command line:

Terminal window
./tulpar hello.tpr
Terminal window
wsl ./tulpar hello.tpr
Terminal window
tulpar.exe hello.tpr

Tulpar also supports an interactive Read-Eval-Print Loop (REPL) mode. Run the interpreter without any arguments to start it:

Terminal window
./tulpar

In REPL mode, you can type Tulpar code and see the results immediately.