gingerBill
Ginger Bill
152 posts
2 projects

I am ginger thus have no soul.

#9573 Releases
Nov. 28, 2016, 10:29 p.m.
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!



gingerBill
Ginger Bill
152 posts
2 projects

I am ginger thus have no soul.

#9719 Releases
Dec. 9, 2016, 4:43 p.m.
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


Hjortshoej
Mikkel Hjortshøj
44 posts
1 project

Beer is love beer is life beer is beer

#9733 Releases
Dec. 10, 2016, 12:07 a.m. Edited by Mikkel Hjortshøj on Dec. 10, 2016, 12:59 a.m. Reason: Clarification
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.

Give a man a beer, and he is happy... End of story.
gingerBill
Ginger Bill
152 posts
2 projects

I am ginger thus have no soul.

#9757 Releases
Dec. 11, 2016, 9:03 p.m.
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"