The 2024 Wheel Reinvention Jam is in 16 days. September 23-29, 2024. More info

Releases

Odin v0.0.3d
https://github.com/gingerBill/Odin/releases/tag/v0.0.3d

What's New
  • Rune literal syntax
  • Now: 'x', was: #rune "x"
  • Add global string constants (for later platform specific use)
    • ODIN_OS (e.g. "windows")
    • ODIN_ARCH (e.g. "amd64")
    • ODIN_VENDOR (e.g. "odin")
    • ODIN_VERSION (e.g. "v0.0.3d")
    • ODIN_ENDIAN (e.g. "little")
  • clamp builtin procedure (works on numerical and string types)

Bug fixes
  • Fix slice expressions for arrays and slices
  • fmt.odin correctly prints f32
  • Fix Vector's type information

Linux and OSX
Coming Soon™

Enjoy!



Odin v0.0.4

https://github.com/gingerBill/Odin/releases/tag/v0.0.4

What's New

* Go/BCPL style semicolon insertion rules - See: https://groups.google.com/forum/#!topic/golang-nuts/XuMrWI0Q8uk
* `odin build_dll` Build project as .dll
* `#export` for procedures
* Always require an entry point procedure - `main`
* Cyclic Type Checking
* `#include` - renamed from `#load`
* Changed import/include name syntax
- `#import thing "some_file.odin"`
* Built in string constants
- ODIN_OS - target operating system ("windows")
- ODIN_ARCH - target architecture ("amd64)
- ODIN_VENDER - compiler vender ("odin")
- ODIN_VERSION ("0.0.4")
- ODIN_ROOT - root directory of the executable
* `when` statement
- Compile time `if` statement (only allowed within procedures)
* `when` condition on `#import`, `#include`, `#foreign_library` `#foreign_system_library`
- `#import "win32.odin" when ODIN_OS == "windows"`
* Standard Library (WIP):
- atomic.odin
- sync.odin (Mutex, Semaphore)
* Disabled `u128` and `i128` until big numbers are properly supported


gingerBill
Odin v0.0.4
* `when` statement
- Compile time `if` statement (only allowed within procedures)


Will you enable 'when' statements outside procedures at some point? Like at global scope? If I have single type I want to define differently based on a constant, having to split that single type into multiple files would be cumbersome.

Edited by Mikkel on Reason: Clarification
Having `when` in file scope is actually impossible as it causes problems resolving symbols. This is due to nature of imports needing to know all the file entities when importing.

However, if you need something like that, `when` statements are perfectly allowed within structs:

1
2
3
4
5
6
7
Thing :: struct {
    when SOME_THING == "whatever" {
        x: u32
    } else {
        x: u16
    }
}


However, system dependent code is probably better split among separate file and included using a when condition in many cases.

1
2
#include "os_windows.odin" when ODIN_OS == "windows"
#include "os_amd64.odin" when ODIN_ARCH == "amd64"
Odin v0.0.6

https://github.com/gingerBill/Odin/releases/tag/v0.0.6

  • Procedure Overloading
  • All loops are for loops:
  • - `for i := 0; i < 12; i+=1 {}`
  • - `for cond {}`
  • - `for {}`
  • - `for val in 0..<12 {}`
  • - `for val in 0..12 {}`
  • - `for val, idx in 3..<12 {}`
  • - `for _ in array {}`
  • - `match type name in expr {}`
  • cast(T) transmute(T) down_cast(T) union_cast(T)
  • Improved fmt.printf
  • Record fields separated by commas struct { x: int, y: f32, z: int }
  • Capacity removed slices. Slices are just ptr + count
  • Helper type
  • - `type int`
  • - `type proc(int) -> f32`
  • Prefixes: immutable using thread_local no_alias
  • Library names - explicit library need for foreign procedures
  • Basic directives: #file #line #procedure
Odin v0.1.3
https://github.com/gingerBill/Odin/releases/tag/v0.1.3

Added

  • Slices now store have capacity (again)
  • Added multiple type cases for match in
  • Named for and match statements (#label)
  • ++ -- statements return

Changes

  • fmt.odin uses ^[]byte and []byte rather than custom buffer type
  • ... and ..< removed and replace with ..
  • .. is used for slice parameters and in for in statements which is equivalent to the old ..<
  • append allows points
  • new_slice allows for capacity

Bug Fixes

  • Signed integer conversion
  • fmt.odin fix printing enums
  • Fix tuple type info bug