The Odin Programming Language

The Odin programming language is designed with the intent of creating an alternative to C with the following goals:

  • simplicity
  • high performance
  • built for modern systems
  • joy of programming

Example Code

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);
}

Language Features

(Copied from the homepage).

2 Likes

Corresponding tweet for this thread:

Share link for this tweet.

Interestingโ€ฆ How does it compare to Zig that seems to have the same goals?

3 Likes

I didnโ€™t use it yet, but the first thing I noticed is syntactical similarity to Go, the short variable declaration operator, defer keyword, absence of parenthesis around conditions in conditionals, even names of the packages and methods like fmt.printf.

3 Likes

I also thought it looked like go

How to choose between go, rust or zig? :slight_smile:

3 Likes

There is another language which is more similar to Go. The V Programming Language.

3 Likes