|
há 4 anos atrás | |
---|---|---|
.github | há 4 anos atrás | |
bin | há 4 anos atrás | |
ci | há 5 anos atrás | |
core | há 4 anos atrás | |
examples | há 4 anos atrás | |
misc | há 4 anos atrás | |
shared | há 6 anos atrás | |
src | há 4 anos atrás | |
.gitattributes | há 5 anos atrás | |
.gitignore | há 4 anos atrás | |
LICENSE | há 5 anos atrás | |
LLVM-C.dll | há 5 anos atrás | |
Makefile | há 4 anos atrás | |
PROPOSAL-PROCESS.md | há 4 anos atrás | |
README.md | há 4 anos atrás | |
build.bat | há 4 anos atrás | |
default.nix | há 4 anos atrás |
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 creating an alternative to C with the following goals:
Website: https://odin-lang.org/
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);
}
Instructions for downloading and installing the Odin compiler and libraries.
An overview of the Odin programming language.
Answers to common questions about Odin.
A wiki maintained by the Odin community.
Get live support and talk with other odiners on the Odin Discord.
The official Odin Language specification.
The official blog of the Odin programming language, featuring announcements, news, and in-depth articles by the Odin team and guests.
Odin only supports x86-64/amd64 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.exe
vcvarsall.bat
to setup the pathMacOS
brew install llvm
)GNU/Linux
FreeBSD
Other platforms may be supported but are experimental for the time being.