odin is a programming language created in 2016.
#100on PLDB | 8Years Old | 417Repos |
git clone https://github.com/odin-lang/Odin
Odin Programming Language
package main
import "core:fmt"
main :: proc() {
program := "+ + * 😃 - /";
accumulator := 0;
for token in program {
switch token {
case '+': accumulator += 1;
case '-': accumulator -= 1;
case '*': accumulator *= 2;
case '/': accumulator /= 2;
case '😃': accumulator *= accumulator;
case: // Ignore everything else
}
}
fmt.printf("The program \"%s\" calculates the value %d\n",
program, accumulator);
}
package main
import "core:fmt"
main :: proc() {
fmt.printf("Hello, world!\n");
}
package main
import "core:fmt"
main :: proc() {
fmt.println("Hello World");
}
Feature | Supported | Example | Token |
---|---|---|---|
Strings | ✓ | "Hello world" | " |
Print() Debugging | ✓ | fmt.println | |
Comments | ✓ | // A comment | |
Line Comments | ✓ | // A comment | // |
Semantic Indentation | X |