暫無描述

gingerBill 184efd4f49 Update demo for `using in` 7 年之前
core 6b3c4cc379 Remove `u128` and `i128` 7 年之前
examples 184efd4f49 Update demo for `using in` 7 年之前
misc 4262c125c5 Fix struct #packed alignment calculation 8 年之前
shared 8e3b77aba8 Library collections 8 年之前
src 6b3c4cc379 Remove `u128` and `i128` 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 649e02f209 Add basic example to README.md 7 年之前
build.bat c6096f9205 Revert to demo.odin 8 年之前
build.sh 6d880bc3bb Added static linking for macOS. Also fixed the build.sh. Thanks, vass :/ 7 年之前

README.md

Odin logo

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.

Roadmap

Not in any particular order and not be implemented

  • Compile Time Execution (CTE)
    • More metaprogramming madness
    • Compiler as a library
    • AST inspection and modification
  • CTE-based build system
  • Replace LLVM backend with my own custom backend
  • Improve SSA design to accommodate for lowering to a "bytecode"
  • SSA optimizations
  • Documentation Generator for "Entities"
  • Multiple Architecture support
  • Debug Information
    • pdb format too
  • Command Line Tooling
  • Compiler Internals:
    • Big numbers library
    • Multithreading for performance increase