2
0

Тайлбар байхгүй

gingerBill efe4b71bae Fix build.sh 7 жил өмнө
core 5f20e04259 Fix on *nix 7 жил өмнө
examples e9e7ce2606 Allow `.allocator` for dynamic arrays; Add `mem.Pool` 7 жил өмнө
misc 28d88f6af4 rounded logo 7 жил өмнө
src bc37bd5429 Merge branch 'packages' of https://github.com/odin-lang/Odin into packages 7 жил өмнө
.gitignore 9e0b69312b Fixed foreign import for linux. Modified .gitignore to ignore temp files and files in shared/. Added a Makefile for linux 7 жил өмнө
LICENSE 9a8759efef Polymorphic type specialization for procedures 8 жил өмнө
Makefile 9e0b69312b Fixed foreign import for linux. Modified .gitignore to ignore temp files and files in shared/. Added a Makefile for linux 7 жил өмнө
README.md 0a99595efe Remove `using in` stuff 7 жил өмнө
build.bat 9bef5ec01a Fix anonymous procedures 7 жил өмнө
build.sh efe4b71bae Fix build.sh 7 жил өмнө

README.md

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/

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

Demonstrations:

Requirements to build and run

  • Windows

    • x86-64
    • MSVC 2010 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.