BrettRToomey / Odin

Odin Programming Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Odin logo
A fast, concise, readable, pragmatic and open sourced programming language.

The Odin Programming Language

The Odin programming language is fast, concise, readable, pragmatic and open sourced. It is designed with the intent of replacing C with the following goals:

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

Website: https://odin.handmade.network/

import "core:fmt.odin"

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

Demonstrations:

Requirements to build and run

  • Windows

    • x86-64
    • MSVC 2015 installed (C++11 support)
    • LLVM binaries for opt.exe and llc.exe
    • Requires MSVC's link.exe as the linker
      • run vcvarsall.bat to setup the path
  • MacOS

    • x86-64
    • LLVM explicitly installed (brew install llvm)
    • XCode installed (for the linker)
  • GNU/Linux

    • x86-64
    • Build tools (ld)
    • LLVM installed
    • Clang installed (temporary - this is Calling the linker for now)

Warnings

  • This is still highly in development and the language's design is quite volatile.
  • Syntax is not fixed.

About

Odin Programming Language

License:BSD 2-Clause "Simplified" License


Languages

Language:C 53.1%Language:C++ 46.8%Language:Batchfile 0.1%Language:Shell 0.0%Language:Makefile 0.0%