Odin v0.6.0 Release (The "Big One")

https://github.com/gingerBill/Odin/releases/tag/v0.6.1a

Restoring the original declaration syntax, parametric polymorphics ("Generics"), `union`, nested struct declarations, and much more!

Edited by Ginger Bill on
Hi,

"Restoring the original declaration syntax."

Happy to hear this and I wanted to try the new version out this evening. But seems I can not compile the 0.6.0 version. 0.5.0 works. The error is "odin-0.6.0\src\array.cpp(14): Assert Failure: `0 <= index && index < count` Index 2 is out of bounds ranges 0..<2"

EDIT: Actualy it did build the odin.exe. What asserts is building the demo.odin file.

EDIT2: odin.exe asserts also with simple Hello World. The message is the same.

Edited by Vidar on
Which OS? Could you give the demo code too, please?
- Windows 10 x64

- Hello World

1
2
3
4
5
import "fmt.odin";

main :: proc() {
    fmt.println("Hello Odin World :D");
}


- demo.odin: https://gist.github.com/enurlyx/3...2f036d8b3a39085150#file-demo-odin

- visual studio 2015

- CMD: VS2015 x64 Native Tools Command Prompt

- Compiled github version: Tag v0.6.0

EDIT:

Its calling the following way:

1
2
3
4
5
6
7
8
9
odin!Array<gbThread>::operator[](int64 index = 0n2)+0x5e [c:\users\enurlyx\desktop\odin-0.6.0\src\array.cpp @ 14] 
odin!parse_files(struct Parser * p = 0x000000df`78efe7d0, struct String * init_filename = 0x000000df`78efe690)+0x61f [c:\users\enurlyx\desktop\odin-0.6.0\src\parser.cpp @ 5103] 
odin!main(int arg_count = 0n3, char ** arg_ptr = 0x000002a5`93f09070)+0x768 [c:\users\enurlyx\desktop\odin-0.6.0\src\main.cpp @ 489] 
odin!invoke_main(void)+0x34 [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 65] 
odin!__scrt_common_main_seh(void)+0x127 [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 253] 
odin!__scrt_common_main(void)+0xe [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 296] 
odin!mainCRTStartup(void)+0x9 [f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp @ 17] 
KERNEL32!BaseThreadInitThunk+0x14
ntdll!RtlUserThreadStart+0x21

Edited by Vidar on
I tried your new version 0.6.1a. I had to remove -WX in the build.bat from the compiler settings (Warnings became errors). After this I could build a odin.exe. But running odin.exe on an *.odin file gives the same error as before.

EDIT: Setting #define USE_THREADED_PARSER 0 in main.cpp makes odin.exe work with the demo.odin and my Hello World.

Edited by Vidar on
The problem is, that you loop over two arrays with different sizes. It will be fine as long as the thread_count is >= imports.count. See the following lines:

https://github.com/gingerBill/Odin/blob/master/src/parser.cpp#L5098
https://github.com/gingerBill/Odin/blob/master/src/parser.cpp#L5102

When I run odin on Hello World. I got 3 imports but only 2 threads, leading to the assert.