Draft:Odin (programming language)

This is an old revision of this page, as edited by Hmc1282171021 (talk | contribs) at 15:47, 15 November 2021 (First basic page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Odin
Paradigmsimperative, procedural
Designed byGinger Bill
Typing disciplineStatic, strong, inferred, structural, generic
Platformx86-64, ARM
OSCross-platform
LicenseBSD-3 License
Filename extensions.odin
Websiteodin-lang.org
Influenced by
C, Pascal, Go, Rust

Odin is a general-purpose programming language with distinct typing, built for high performance, modern systems, and built-in data-oriented data types.

Examples

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