Examples
This page will cover example programs in Rune to help you learn the basics.
Hello World
Just prints hello world, not much else to it
Fibonacci Sequence
This program calculates 50 fibonacci numbers by starting with 0 and 1 in an array, then computing their sum, and then repeating this process of calculating the sum of the last 2 numbers and pushing the result to the array. Note that when mutability is required, we have to free the variable before reassigning, it is preferred to not need mutability but for programs that require it this trick can be used without needing to either use a new variable for every step or having variables that are mutable for the whole program. The purpose of this is to force intentional use of variables to help with making memory safe code, all variables used have to freed before being reused, making it definite that nothing else besides what you want will modify the variable.
Also note that the variables are typed with their type before the name, this is required for defining variables but if the type if to be inferred use "(_)" as the type.
Math Expression Parser
This program takes input using the input() function, then parses the inputted math expression using the math() function, and then prints the result. The math() function can parse most math expressions and includes even more advanced functions such as trigonometric functions and logarithms.