|
|
vor 6 Jahren | |
|---|---|---|
| .github | vor 6 Jahren | |
| bin | vor 6 Jahren | |
| core | vor 6 Jahren | |
| examples | vor 6 Jahren | |
| misc | vor 7 Jahren | |
| shared | vor 6 Jahren | |
| src | vor 6 Jahren | |
| .gitignore | vor 7 Jahren | |
| .travis.yml | vor 6 Jahren | |
| LICENSE | vor 8 Jahren | |
| Makefile | vor 6 Jahren | |
| README.md | vor 6 Jahren | |
| appveyor.yml | vor 6 Jahren | |
| build.bat | vor 6 Jahren | |
| build.sh | vor 7 Jahren | |
| build_ci.bat | vor 6 Jahren |
A fast, concise, readable, pragmatic and open sourced 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:
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);
}
Odin only supports x86-64 at the moment (64-bit), relies on LLVM for code generation and an external linker.
In addition, the following platform-specific steps are necessary:
Windows
opt.exe and llc.exe in Odin/bin. Pre-built Windows binaries can be found here and must be explicitly copiedx64 Native Tools Command Prompt for VS2017 shortcut bundled with VS 2017, orvcvarsall.bat x64 from a blank cmd sessionMacOS
brew install llvm)$PATH environmental variableGNU/Linux
$PATH environmental variableThen build the compiler by calling build.bat (Windows) or make (Linux/MacOS). This will automatically run the demo program if successful.
Notes for Linux:: The compiler currently relies on the core and shared library collection being relative to the compiler executable. Installing the compiler in the usual sense (to /usr/local/bin or similar) is therefore not as straight forward as you need to make sure the mentioned libraries are available. As a result, it is recommended to simply explicitly invoke the compiler with /path/to/odin in your preferred build system, or add /path/to/odin to $PATH.
Please read the Getting Started Guide for more information.
Please read the Getting Started Guide.
Windows
opt.exe, llc.exe, and lld-link.exevcvarsall.bat to setup the pathMacOS
brew install llvm)GNU/Linux