Getting Started
Your First Program
Section titled “Your First Program”Create a file named hello.tpr:
// Hello World with UTF-8 supportstr greeting = "Merhaba Dünya!";print(greeting);
// Function definitionfunc square(int n) { return n * n;}
// Usageint result = square(5);print("5'in karesi:", result);Run the Program
Section titled “Run the Program”You can run your Tulpar program using the command line:
Linux / macOS
Section titled “Linux / macOS”./tulpar hello.tprWindows (WSL)
Section titled “Windows (WSL)”wsl ./tulpar hello.tprWindows (Native)
Section titled “Windows (Native)”tulpar.exe hello.tprInteractive REPL Mode
Section titled “Interactive REPL Mode”Tulpar also supports an interactive Read-Eval-Print Loop (REPL) mode. Run the interpreter without any arguments to start it:
./tulparIn REPL mode, you can type Tulpar code and see the results immediately.