removed 'proc' keyword from core libraries and examples
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 1 Feb 2021 00:26:11 +0000 (18:26 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 1 Feb 2021 00:26:11 +0000 (18:26 -0600)
44 files changed:
bin/onyx
core/alloc.onyx
core/alloc/arena.onyx
core/alloc/fixed.onyx
core/alloc/heap.onyx
core/alloc/pool.onyx
core/alloc/ring.onyx
core/array.onyx
core/builtin.onyx
core/conv.onyx
core/intrinsics/simd.onyx
core/intrinsics/wasm.onyx
core/io/reader.onyx
core/io/writer.onyx
core/js/webgl.onyx
core/map.onyx
core/math.onyx
core/memory.onyx
core/random.onyx
core/stdio.onyx
core/string.onyx
core/sys/js.onyx
core/sys/wasi.onyx
core/wasi.onyx
docs/bugs
docs/new_hash_plan [deleted file]
docs/todo
examples/01_hello_world.onyx
examples/02_variables.onyx
examples/03_basics.onyx
examples/04_fixed_arrays.onyx
examples/05_slices.onyx
examples/06_dynamic_arrays.onyx
examples/07_structs.onyx
examples/08_enums.onyx
examples/09_for_loops.onyx
examples/10_switch_statements.onyx
examples/11_map.onyx
examples/12_varargs.onyx
examples/13_use_keyword.onyx
examples/14_overloaded_procs.onyx
examples/15_polymorphic_procs.onyx
examples/16_pipe_operator.onyx
onyx.exe

index 03b888b8017d529c438bc7b70f67755a8a5fe1d1..586a6c15456bac8096e0ffbcb381030ca48b808f 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index 9d7d25b46beb287ecad5ff2e05f9165f2246aa38..169e8df58a03a234e214482f5a57c4ee682b46e4 100644 (file)
@@ -17,7 +17,7 @@ heap_allocator : Allocator;
 temp_state     : ring.RingState;
 temp_allocator : Allocator;
 
-init :: proc () {
+init :: () {
     heap.init();
 
     temp_buffer := raw_alloc(heap_allocator, TEMPORARY_ALLOCATOR_SIZE);
index e30515f5c018e6eb04af95ef25a356fc8784f907..df6b90b2af3a89e0ac4163ed9bf340014eadec2c 100644 (file)
@@ -26,7 +26,7 @@ ArenaState :: struct {
 Arena :: struct { next : ^Arena; }
 
 #private_file
-arena_alloc_proc :: proc (data: rawptr, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
+arena_alloc_proc :: (data: rawptr, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
     alloc_arena := cast(^ArenaState) data;
 
     if aa == AllocationAction.Alloc {
@@ -60,7 +60,7 @@ arena_alloc_proc :: proc (data: rawptr, aa: AllocationAction, size: u32, align:
 }
 
 // NOTE: `arena_size` must be at least 4
-make :: proc (backing: Allocator, arena_size: u32) -> ArenaState {
+make :: (backing: Allocator, arena_size: u32) -> ArenaState {
     initial_arena := cast(^Arena) raw_alloc(backing, arena_size);
     initial_arena.next = null;
 
@@ -74,14 +74,14 @@ make :: proc (backing: Allocator, arena_size: u32) -> ArenaState {
     };
 }
 
-make_allocator :: proc (rs: ^ArenaState) -> Allocator {
+make_allocator :: (rs: ^ArenaState) -> Allocator {
     return Allocator.{
         func = arena_alloc_proc,
         data = rs,
     };
 }
 
-free :: proc (arena: ^ArenaState) {
+free :: (arena: ^ArenaState) {
     walker := arena.first_arena;
     trailer := walker;
     while walker != null {
index a9879c26530dd79122f6e9a027930b7a5dd7fc9c..4019da8cf46176a8e9b4d0f49b0a2e8407a1b7c2 100644 (file)
@@ -16,7 +16,7 @@ FixedAllocatorData :: struct {
 }
 
 #private_file
-fixed_allocator_proc :: proc (data: rawptr, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
+fixed_allocator_proc :: (data: rawptr, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
     fa_data := cast(^FixedAllocatorData) data;  
 
     if aa != AllocationAction.Alloc do return null;
@@ -25,14 +25,14 @@ fixed_allocator_proc :: proc (data: rawptr, aa: AllocationAction, size: u32, ali
     return fa_data.ptr;
 }
 
-make :: proc (ptr: rawptr, size: u32) -> FixedAllocatorData {
+make :: (ptr: rawptr, size: u32) -> FixedAllocatorData {
     return FixedAllocatorData.{
         ptr  = ptr,
         size = size,
     };
 }
 
-make_allocator :: proc (fa_data: ^FixedAllocatorData) -> Allocator {
+make_allocator :: (fa_data: ^FixedAllocatorData) -> Allocator {
     return Allocator.{
         func = fixed_allocator_proc,
         data = fa_data,
index 1989f59e9c26a5c632427073644349b428f55031..6c0643703ffc359143d4120d44e8fedf7d569de3 100644 (file)
@@ -27,7 +27,7 @@ heap_block :: struct {
 }
 
 #private_file
-heap_alloc :: proc (size_: u32, align: u32) -> rawptr {
+heap_alloc :: (size_: u32, align: u32) -> rawptr {
     if size_ == 0 do return null;
 
     size := size_ + sizeof heap_block;
@@ -78,7 +78,7 @@ heap_alloc :: proc (size_: u32, align: u32) -> rawptr {
 }
 
 #private_file
-heap_free :: proc (ptr: rawptr) {
+heap_free :: (ptr: rawptr) {
     hb_ptr := cast(^heap_block) (cast(u32) ptr - sizeof heap_block);
 
     // DEBUGGING: Fills freed memory with 0's
@@ -89,7 +89,7 @@ heap_free :: proc (ptr: rawptr) {
 }
 
 #private_file
-heap_resize :: proc (ptr: rawptr, new_size: u32, align: u32) -> rawptr {
+heap_resize :: (ptr: rawptr, new_size: u32, align: u32) -> rawptr {
     if ptr == null do return null;
     
     hb_ptr := cast(^heap_block) (cast(u32) ptr - sizeof heap_block);
@@ -123,7 +123,7 @@ heap_resize :: proc (ptr: rawptr, new_size: u32, align: u32) -> rawptr {
 }
 
 #private_file
-heap_alloc_proc :: proc (data: rawptr, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
+heap_alloc_proc :: (data: rawptr, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
     if aa == AllocationAction.Alloc do return heap_alloc(size, align);
     if aa == AllocationAction.Resize do return heap_resize(oldptr, size, align);
     if aa == AllocationAction.Free {
@@ -134,7 +134,7 @@ heap_alloc_proc :: proc (data: rawptr, aa: AllocationAction, size: u32, align: u
     return null;
 }
 
-init :: proc () {
+init :: () {
     heap_state.free_list = null;
     heap_state.next_alloc = __heap_start;
     heap_state.remaining_space = (memory_size() << 16) - cast(u32) __heap_start;
index 1f1e51accdd5fcd0c3a9b5b4a65d6738b339c78b..0f6ff50bbae40d4975c32a94b3b277f5b3dbf843 100644 (file)
@@ -17,7 +17,7 @@ PoolAllocator :: struct (Elem: type_expr) {
 }
 
 #private_file
-pool_allocator_proc :: proc (pool: ^PoolAllocator($Elem), aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
+pool_allocator_proc :: (pool: ^PoolAllocator($Elem), aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
     switch aa {
         case AllocationAction.Alloc {
             assert(size == sizeof Elem, "Allocating wrong size from pool allocator.");
@@ -38,14 +38,14 @@ pool_allocator_proc :: proc (pool: ^PoolAllocator($Elem), aa: AllocationAction,
     return null;
 }
 
-pool_alloc :: proc (pool: ^PoolAllocator($Elem)) -> ^Elem {
+pool_alloc :: (pool: ^PoolAllocator($Elem)) -> ^Elem {
     if pool.first_free == null do return null;
 
     defer pool.first_free = cast(^Elem) *(cast(^rawptr) pool.first_free);
     return pool.first_free;
 }
 
-pool_free :: proc (pool: ^PoolAllocator($Elem), elem: ^Elem) {
+pool_free :: (pool: ^PoolAllocator($Elem), elem: ^Elem) {
     // TODO: Maybe add a check that the elem pointer is actually in the buffer?? 
     *(cast(^rawptr) elem) = cast(rawptr) pool.first_free;
     pool.first_free = elem;
@@ -54,7 +54,7 @@ pool_free :: proc (pool: ^PoolAllocator($Elem), elem: ^Elem) {
 
 // This could become: proc (buffer: [] u8, $Elem: type_expr) -> PoolAllocator(Elem)
 // when that feature is implemented.
-make :: proc (buffer: [] $Elem) -> PoolAllocator(Elem) {
+make :: (buffer: [] $Elem) -> PoolAllocator(Elem) {
     assert(sizeof Elem >= sizeof rawptr, "Cannot have a pool allocator of a type less than a rawptr in size.");
 
     for i: 0 .. buffer.count - 1 {
@@ -69,7 +69,7 @@ make :: proc (buffer: [] $Elem) -> PoolAllocator(Elem) {
     };
 }
 
-make_allocator :: proc (pool: ^PoolAllocator($Elem)) -> Allocator {
+make_allocator :: (pool: ^PoolAllocator($Elem)) -> Allocator {
     return Allocator.{
         func = #solidify pool_allocator_proc { Elem = Elem },
         data = pool,
index 474f5eb62ab09da680ef7203595d9e0c818c9524..1f11bd2a840a3bebcd107da6de949f10492ec432 100644 (file)
@@ -17,7 +17,7 @@ RingState :: struct {
 }
 
 #private_file
-ring_alloc_proc :: proc (data: rawptr, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
+ring_alloc_proc :: (data: rawptr, aa: AllocationAction, size: u32, align: u32, oldptr: rawptr) -> rawptr {
     ss := cast(^RingState) data;
 
     if aa == AllocationAction.Alloc {
@@ -38,7 +38,7 @@ ring_alloc_proc :: proc (data: rawptr, aa: AllocationAction, size: u32, align: u
     return null;
 }
 
-make :: proc (buffer: rawptr, length: u32) -> RingState {
+make :: (buffer: rawptr, length: u32) -> RingState {
     return RingState.{
         base_ptr = buffer,
         curr_ptr = buffer,
@@ -46,7 +46,7 @@ make :: proc (buffer: rawptr, length: u32) -> RingState {
     };
 }
 
-make_allocator :: proc (rs: ^RingState) -> Allocator {
+make_allocator :: (rs: ^RingState) -> Allocator {
     return Allocator.{
         func = ring_alloc_proc,
         data = rs,
index 0fcfa04716666abe4fc02cc648e25f88d64129ca..edff7a78622ac68ef768487d5ee0a3c49e004840 100644 (file)
@@ -3,19 +3,19 @@ package core.array
 // ---------------------------------
 //           Dynamic Arrays
 // ---------------------------------
-make :: proc ($T: type_expr, initial_cap := 4) -> [..] T {
+make :: ($T: type_expr, initial_cap := 4) -> [..] T {
     arr : [..] T;
     init(^arr, initial_cap);
     return arr;
 }
 
-init :: proc (arr: ^[..] $T, initial_cap := 4) {
+init :: (arr: ^[..] $T, initial_cap := 4) {
     arr.count = 0;
     arr.capacity = initial_cap;
     arr.data = calloc(sizeof T * arr.capacity);
 }
 
-free :: proc (arr: ^[..] $T) {
+free :: (arr: ^[..] $T) {
     arr.count = 0;
     arr.capacity = 0;
 
@@ -23,7 +23,7 @@ free :: proc (arr: ^[..] $T) {
     arr.data = null;
 }
 
-copy :: proc (arr: ^[..] $T) -> [..] T {
+copy :: (arr: ^[..] $T) -> [..] T {
     new_arr : [..] T;
     init(^new_arr, arr.count);
     new_arr.count = arr.count;
@@ -32,7 +32,7 @@ copy :: proc (arr: ^[..] $T) -> [..] T {
     return new_arr;
 }
 
-copy_range :: proc (arr: ^[..] $T, r: range) -> [..] T {
+copy_range :: (arr: ^[..] $T, r: range) -> [..] T {
     new_arr : [..] T;
     init(^new_arr, r.high - r.low);
     new_arr.count = r.high - r.low;
@@ -41,11 +41,11 @@ copy_range :: proc (arr: ^[..] $T, r: range) -> [..] T {
     return new_arr;
 }
 
-clear :: proc (arr: ^[..] $T) {
+clear :: (arr: ^[..] $T) {
     arr.count = 0;
 }
 
-ensure_capacity :: proc (arr: ^[..] $T, cap: u32) -> bool {
+ensure_capacity :: (arr: ^[..] $T, cap: u32) -> bool {
     if arr.capacity >= cap do return true;
 
     while cap > arr.capacity do arr.capacity <<= 1;
@@ -55,14 +55,14 @@ ensure_capacity :: proc (arr: ^[..] $T, cap: u32) -> bool {
     return true;
 }
 
-push :: proc (arr: ^[..] $T, x: T) -> bool {
+push :: (arr: ^[..] $T, x: T) -> bool {
     if !ensure_capacity(arr, arr.count + 1) do return false;
     arr.data[arr.count] = x;
     arr.count += 1;
     return true;
 }
 
-insert :: proc (arr: ^[..] $T, idx: u32, x: T) -> bool {
+insert :: (arr: ^[..] $T, idx: u32, x: T) -> bool {
     if !ensure_capacity(arr, arr.count + 1) do return false;
 
     arr.count += 1;
@@ -75,7 +75,7 @@ insert :: proc (arr: ^[..] $T, idx: u32, x: T) -> bool {
     return true;
 }
 
-remove :: proc (arr: ^[..] $T, elem: T) {
+remove :: (arr: ^[..] $T, elem: T) {
     move := 0;
 
     while i := 0; i < arr.count - move {
@@ -88,7 +88,7 @@ remove :: proc (arr: ^[..] $T, elem: T) {
     arr.count -= move;
 }
 
-delete :: proc (arr: ^[..] $T, idx: u32) {
+delete :: (arr: ^[..] $T, idx: u32) {
     if idx >= arr.count do return;
 
     for i: idx .. arr.count - 1 {
@@ -98,31 +98,31 @@ delete :: proc (arr: ^[..] $T, idx: u32) {
     arr.count -= 1;
 }
 
-fast_delete :: proc (arr: ^[..] $T, idx: u32) {
+fast_delete :: (arr: ^[..] $T, idx: u32) {
     if idx >= arr.count do return;
 
     arr.data[idx] = arr.data[arr.count - 1];
     arr.count -= 1;
 }
 
-contains :: proc (arr: ^[..] $T, x: T) -> bool {
+contains :: (arr: ^[..] $T, x: T) -> bool {
     for it: *arr do if it == x do return true;
     return false;
 }
 
-pop :: proc (arr: ^[..] $T) -> T {
+pop :: (arr: ^[..] $T) -> T {
     arr.count -= 1;
     return arr.data[arr.count];
 }
 
-average :: proc (arr: ^[..] $T) -> T {
+average :: (arr: ^[..] $T) -> T {
     sum := cast(T) 0;
     for it: *arr do sum += it;
 
     return sum / cast(T) arr.count;
 }
 
-to_slice :: proc (arr: ^[..] $T) -> [] T {
+to_slice :: (arr: ^[..] $T) -> [] T {
     return arr.data[0 .. arr.count];
 }
 
@@ -130,7 +130,7 @@ to_slice :: proc (arr: ^[..] $T) -> [] T {
 ** Simple insertion sort
 **    cmp should return >0 if left > right
 */
-sort :: proc (arr: ^[..] $T, cmp: proc (T, T) -> i32) {
+sort :: (arr: ^[..] $T, cmp: (T, T) -> i32) {
     for i: 1 .. arr.count {
         x := arr.data[i];
         j := i - 1;
@@ -144,20 +144,20 @@ sort :: proc (arr: ^[..] $T, cmp: proc (T, T) -> i32) {
     }
 }
 
-fold :: proc (arr: ^[..] $T, init: $R, f: proc (T, R) -> R) -> R {
+fold :: (arr: ^[..] $T, init: $R, f: (T, R) -> R) -> R {
     val := init;
     for it: *arr do val = f(it, val);
     return val;
 }
 
 // CLEANUP: :slice Move this elsewhere when more slice functionality is added
-fold_slice :: proc (arr: [] $T, init: $R, f: proc (T, R) -> R) -> R {
+fold_slice :: (arr: [] $T, init: $R, f: (T, R) -> R) -> R {
     val := init;
     for it: arr do val = f(it, val);
     return val;
 }
 
-map :: proc (arr: ^[..] $T, data: $R, f: proc (T, R) -> T) {
+map :: (arr: ^[..] $T, data: $R, f: (T, R) -> T) {
     for ^it: *arr do *it = f(*it, data);
 }
 
index 1ba52ae3f05c9809b7e6acdac33b8ccc39e92502..490b27b8a7c69182c81e78afad0edbb926989356 100644 (file)
@@ -16,7 +16,7 @@ vararg :: #type ^struct {
     count: i32;
 }
 
-vararg_get :: proc (va: vararg, ret: ^$T) -> bool {
+vararg_get :: (va: vararg, ret: ^$T) -> bool {
     if va.count <= 0 do return false;
     *ret = *cast(^T) va.data;
     va.data = cast(rawptr) (cast(^u8) va.data + sizeof T);
@@ -32,12 +32,12 @@ OnyxContext :: struct {
     allocator      : Allocator;
     temp_allocator : Allocator;
 
-    assert_handler : proc (msg: str, file: str);
+    assert_handler : (msg: str, file: str) -> void;
 }
 
 context : OnyxContext;
 
-assert :: proc (cond: bool, msg: str, file: str = str.{ null, 0 }) {
+assert :: (cond: bool, msg: str, file: str = str.{ null, 0 }) {
     if !cond do context.assert_handler(msg, file);
 }
 
@@ -55,32 +55,32 @@ AllocationAction :: enum {
     Resize;
 }
 
-allocator_proc :: #type proc (data: rawptr, action: AllocationAction, size: u32, align: u32, old_ptr: rawptr) -> rawptr;
+allocator_proc :: #type (data: rawptr, action: AllocationAction, size: u32, align: u32, old_ptr: rawptr) -> rawptr;
 
 Allocator :: struct {
     data: rawptr;
     func: allocator_proc;
 }
 
-raw_alloc :: proc (use a: Allocator, size: u32, alignment := __DEFAULT_ALLOCATION_ALIGNMENT) -> rawptr {
+raw_alloc :: (use a: Allocator, size: u32, alignment := __DEFAULT_ALLOCATION_ALIGNMENT) -> rawptr {
     return func(data, AllocationAction.Alloc, size, alignment, null);
 }
 
-raw_resize :: proc (use a: Allocator, ptr: rawptr, size: u32, alignment := __DEFAULT_ALLOCATION_ALIGNMENT) -> rawptr {
+raw_resize :: (use a: Allocator, ptr: rawptr, size: u32, alignment := __DEFAULT_ALLOCATION_ALIGNMENT) -> rawptr {
     return func(data, AllocationAction.Resize, size, alignment, ptr);
 }
 
-raw_free :: proc (use a: Allocator, ptr: rawptr) {
+raw_free :: (use a: Allocator, ptr: rawptr) {
     func(data, AllocationAction.Free, 0, 0, ptr);
 }
 
 // Allocators using the context structure.
-calloc  :: proc (size: u32) -> rawptr do return raw_alloc(context.allocator, size);
-cresize :: proc (ptr: rawptr, size: u32) -> rawptr do return raw_resize(context.allocator, ptr, size);
-cfree   :: proc (ptr: rawptr) do raw_free(context.allocator, ptr);
+calloc  :: (size: u32) -> rawptr do return raw_alloc(context.allocator, size);
+cresize :: (ptr: rawptr, size: u32) -> rawptr do return raw_resize(context.allocator, ptr, size);
+cfree   :: (ptr: rawptr) do raw_free(context.allocator, ptr);
 
 
 // @CLEANUP: These need to move to somewhere else eventually
-cmp_asc :: proc (a: $T, b: T) -> i32 do return cast(i32) (a - b);
-cmp_dec :: proc (a: $T, b: T) -> i32 do return cast(i32) (b - a);
+cmp_asc :: (a: $T, b: T) -> i32 do return cast(i32) (a - b);
+cmp_dec :: (a: $T, b: T) -> i32 do return cast(i32) (b - a);
 
index b596de76c1fcf332ae8ba487350dbe60eabbe27d..a389df6aa27a7679f9071e65e9124cabaf09c7ae 100644 (file)
@@ -1,6 +1,6 @@
 package core.conv
 
-i64_to_str :: proc (n: i64, base: u64, buf: [] u8, min_length := 0) -> str {
+i64_to_str :: (n: i64, base: u64, buf: [] u8, min_length := 0) -> str {
     is_neg := false;
     if n < 0 && base == 10 {
         is_neg = true;
@@ -64,7 +64,7 @@ i64_to_str :: proc (n: i64, base: u64, buf: [] u8, min_length := 0) -> str {
 }
 
 // NOTE: This is a big hack but it will work for now
-f64_to_str :: proc (f: f64, buf: [] u8) -> str {
+f64_to_str :: (f: f64, buf: [] u8) -> str {
     f *= 10000.0;
     v := cast(i64) f;
 
@@ -83,11 +83,11 @@ f64_to_str :: proc (f: f64, buf: [] u8) -> str {
     return str.{ buf.data, len };
 }
 
-str_format :: proc (format: str, buffer: [] u8, va: ...) -> str {
+str_format :: (format: str, buffer: [] u8, va: ...) -> str {
        return str_format_va(format, buffer, va);
 }
 
-str_format_va :: proc (format: str, buffer: [] u8, va: vararg) -> str {
+str_format_va :: (format: str, buffer: [] u8, va: vararg) -> str {
     len := 0;
     state := 0;
 
index f2f9c7a88a47cbfc9f3fba1547325a172ba7f1af..55297ad4005081cf78a27f704b099c21ee9866a2 100644 (file)
@@ -11,205 +11,205 @@ f64x2 :: #type simd.f64x2
 v128  :: #type simd.v128
 
 // NOTE: These u8 values must be compile time known values.
-v128_const :: proc (b1: u8,  b2: u8,  b3: u8,  b4: u8,
+v128_const :: (b1: u8,  b2: u8,  b3: u8,  b4: u8,
                     b5: u8,  b6: u8,  b7: u8,  b8: u8,
                     b9: u8,  b10: u8, b11: u8, b12: u8,
                     b13: u8, b14: u8, b15: u8, b16: u8) -> v128 #intrinsic ---
 
-i8x16_const :: proc (b1: i8,  b2: i8,  b3: i8,  b4: i8,
+i8x16_const :: (b1: i8,  b2: i8,  b3: i8,  b4: i8,
                      b5: i8,  b6: i8,  b7: i8,  b8: i8,
                      b9: i8,  b10: i8, b11: i8, b12: i8,
                      b13: i8, b14: i8, b15: i8, b16: i8) -> i8x16 #intrinsic ---
-i16x8_const :: proc (b1: i16,  b2: i16,  b3: i16,  b4: i16,
+i16x8_const :: (b1: i16,  b2: i16,  b3: i16,  b4: i16,
                      b5: i16,  b6: i16,  b7: i16,  b8: i16) -> i16x8 #intrinsic ---
-i32x4_const :: proc (b1: i32,  b2: i32,  b3: i32,  b4: i32) -> i32x4 #intrinsic ---
-i64x2_const :: proc (b1: i64,  b2: i64)                     -> i64x2 #intrinsic ---
-f32x4_const :: proc (b1: f32,  b2: f32,  b3: f32,  b4: f32) -> f32x4 #intrinsic ---
-f64x2_const :: proc (b1: f64,  b2: f64)                     -> f64x2 #intrinsic ---
+i32x4_const :: (b1: i32,  b2: i32,  b3: i32,  b4: i32) -> i32x4 #intrinsic ---
+i64x2_const :: (b1: i64,  b2: i64)                     -> i64x2 #intrinsic ---
+f32x4_const :: (b1: f32,  b2: f32,  b3: f32,  b4: f32) -> f32x4 #intrinsic ---
+f64x2_const :: (b1: f64,  b2: f64)                     -> f64x2 #intrinsic ---
 
 // NOTE: These u8 values must be compile time known values.
-i8x16_shuffle :: proc (a: v128, b: v128,
+i8x16_shuffle :: (a: v128, b: v128,
                        b1: u8,  b2: u8,  b3: u8,  b4: u8,
                        b5: u8,  b6: u8,  b7: u8,  b8: u8,
                        b9: u8,  b10: u8, b11: u8, b12: u8,
                        b13: u8, b14: u8, b15: u8, b16: u8) -> v128 #intrinsic ---
 
-i8x16_extract_lane_s :: proc (v: i8x16, l: u32)           -> i8    #intrinsic ---
-i8x16_extract_lane_u :: proc (v: i8x16, l: u32)           -> u8    #intrinsic ---
-i8x16_replace_lane   :: proc (v: i8x16, l: u32, val: i8)  -> i8x16 #intrinsic ---
-i16x8_extract_lane_s :: proc (v: i16x8, l: u32)           -> i16   #intrinsic ---
-i16x8_extract_lane_u :: proc (v: i16x8, l: u32)           -> u16   #intrinsic ---
-i16x8_replace_lane   :: proc (v: i16x8, l: u32, val: i16) -> i16x8 #intrinsic ---
-i32x4_extract_lane   :: proc (v: i32x4, l: u32)           -> i32   #intrinsic ---
-i32x4_replace_lane   :: proc (v: i32x4, l: u32, val: i32) -> i32x4 #intrinsic ---
-i64x2_extract_lane   :: proc (v: i64x2, l: u32)           -> i64   #intrinsic ---
-i64x2_replace_lane   :: proc (v: i64x2, l: u32, val: i64) -> i64x2 #intrinsic ---
-f32x4_extract_lane   :: proc (v: f32x4, l: u32)           -> f32   #intrinsic ---
-f32x4_replace_lane   :: proc (v: f32x4, l: u32, val: f32) -> f32x4 #intrinsic ---
-f64x2_extract_lane   :: proc (v: f64x2, l: u32)           -> f64   #intrinsic ---
-f64x2_replace_lane   :: proc (v: f64x2, l: u32, val: f64) -> f64x2 #intrinsic ---
-
-i8x16_swizzle :: proc (v: v128, s: v128)  -> v128  #intrinsic ---
-i8x16_splat   :: proc (val: i8)  -> i8x16 #intrinsic ---
-i16x8_splat   :: proc (val: i16) -> i16x8 #intrinsic ---
-i32x4_splat   :: proc (val: i32) -> i32x4 #intrinsic ---
-i64x2_splat   :: proc (val: i64) -> i64x2 #intrinsic ---
-f32x4_splat   :: proc (val: f32) -> f32x4 #intrinsic ---
-f64x2_splat   :: proc (val: f64) -> f64x2 #intrinsic ---
-
-i8x16_eq   :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_neq  :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_lt_s :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_lt_u :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_gt_s :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_gt_u :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_le_s :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_le_u :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_ge_s :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_ge_u :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-
-i16x8_eq   :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_neq  :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_lt_s :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_lt_u :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_gt_s :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_gt_u :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_le_s :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_le_u :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_ge_s :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_ge_u :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-
-i32x4_eq   :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_neq  :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_lt_s :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_lt_u :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_gt_s :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_gt_u :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_le_s :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_le_u :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_ge_s :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_ge_u :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-
-f32x4_eq  :: proc (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
-f32x4_neq :: proc (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
-f32x4_lt  :: proc (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
-f32x4_gt  :: proc (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
-f32x4_le  :: proc (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
-f32x4_ge  :: proc (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
-
-f64x2_eq  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_neq :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_lt  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_gt  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_le  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_ge  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-
-v128_not    :: proc (v: v128) -> v128 #intrinsic ---
-v128_and    :: proc (a: v128, b: v128) -> v128 #intrinsic ---
-v128_andnot :: proc (a: v128, b: v128) -> v128 #intrinsic ---
-v128_or     :: proc (a: v128, b: v128) -> v128 #intrinsic ---
-v128_xor    :: proc (a: v128, b: v128) -> v128 #intrinsic ---
-v128_bitselect :: proc (a: v128, b: v128, c: v128) -> v128 #intrinsic ---
-
-i8x16_abs            :: proc (a: i8x16) -> i8x16 #intrinsic ---
-i8x16_neg            :: proc (a: i8x16) -> i8x16 #intrinsic ---
-i8x16_any_true       :: proc (a: i8x16) -> bool #intrinsic ---
-i8x16_all_true       :: proc (a: i8x16) -> bool #intrinsic ---
-i8x16_bitmask        :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_narrow_i16x8_s :: proc (a: i16x8) -> i8x16 #intrinsic ---
-i8x16_narrow_i16x8_u :: proc (a: i16x8) -> i8x16 #intrinsic ---
-i8x16_shl            :: proc (a: i8x16, s: i32) -> i8x16 #intrinsic ---
-i8x16_shr_s          :: proc (a: i8x16, s: i32) -> i8x16 #intrinsic ---
-i8x16_shr_u          :: proc (a: i8x16, s: i32) -> i8x16 #intrinsic ---
-i8x16_add            :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_add_sat_s      :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_add_sat_u      :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_sub            :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_sub_sat_s      :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_sub_sat_u      :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_min_s          :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_min_u          :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_max_s          :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_max_u          :: proc (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
-i8x16_avgr_u         :: proc (a: i8x16) -> i8x16 #intrinsic ---
-
-i16x8_abs                :: proc (a: i16x8) -> i16x8 #intrinsic ---
-i16x8_neg                :: proc (a: i16x8) -> i16x8 #intrinsic ---
-i16x8_any_true           :: proc (a: i16x8) -> bool #intrinsic ---
-i16x8_all_true           :: proc (a: i16x8) -> bool #intrinsic ---
-i16x8_bitmask            :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_narrow_i32x4_s     :: proc (a: i32x4) -> i16x8 #intrinsic ---
-i16x8_narrow_i32x4_u     :: proc (a: i32x4) -> i16x8 #intrinsic ---
-i16x8_widen_low_i8x16_s  :: proc (a: i8x16) -> i16x8 #intrinsic ---
-i16x8_widen_high_i8x16_s :: proc (a: i8x16) -> i16x8 #intrinsic ---
-i16x8_widen_low_i8x16_u  :: proc (a: i8x16) -> i16x8 #intrinsic ---
-i16x8_widen_high_i8x16_u :: proc (a: i8x16) -> i16x8 #intrinsic ---
-i16x8_shl                :: proc (a: i16x8, s: i32) -> i16x8 #intrinsic ---
-i16x8_shr_s              :: proc (a: i16x8, s: i32) -> i16x8 #intrinsic ---
-i16x8_shr_u              :: proc (a: i16x8, s: i32) -> i16x8 #intrinsic ---
-i16x8_add                :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_add_sat_s          :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_add_sat_u          :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_sub                :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_sub_sat_s          :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_sub_sat_u          :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_mul                :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_min_s              :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_min_u              :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_max_s              :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_max_u              :: proc (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
-i16x8_avgr_u             :: proc (a: i16x8) -> i16x8 #intrinsic ---
-
-i32x4_abs                :: proc (a: i32x4) -> i32x4 #intrinsic ---
-i32x4_neg                :: proc (a: i32x4) -> i32x4 #intrinsic ---
-i32x4_any_true           :: proc (a: i32x4) -> bool #intrinsic ---
-i32x4_all_true           :: proc (a: i32x4) -> bool #intrinsic ---
-i32x4_bitmask            :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_widen_low_i16x8_s  :: proc (a: i16x8) -> i32x4 #intrinsic ---
-i32x4_widen_high_i16x8_s :: proc (a: i16x8) -> i32x4 #intrinsic ---
-i32x4_widen_low_i16x8_u  :: proc (a: i16x8) -> i32x4 #intrinsic ---
-i32x4_widen_high_i16x8_u :: proc (a: i16x8) -> i32x4 #intrinsic ---
-i32x4_shl                :: proc (a: i32x4, s: i32) -> i32x4 #intrinsic ---
-i32x4_shr_s              :: proc (a: i32x4, s: i32) -> i32x4 #intrinsic ---
-i32x4_shl_u              :: proc (a: i32x4, s: i32) -> i32x4 #intrinsic ---
-i32x4_add                :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_sub                :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_mul                :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_min_s              :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_min_u              :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_max_s              :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-i32x4_max_u              :: proc (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
-
-i64x2_neg   :: proc (a: i64x2) -> i64x2 #intrinsic ---
-i64x2_shl   :: proc (a: i64x2, s: i32) -> i64x2 #intrinsic ---
-i64x2_shr_s :: proc (a: i64x2, s: i32) -> i64x2 #intrinsic ---
-i64x2_shr_u :: proc (a: i64x2, s: i32) -> i64x2 #intrinsic ---
-i64x2_add   :: proc (a: i64x2, b: i64x2) -> i64x2 #intrinsic ---
-i64x2_sub   :: proc (a: i64x2, b: i64x2) -> i64x2 #intrinsic ---
-i64x2_mul   :: proc (a: i64x2, b: i64x2) -> i64x2 #intrinsic ---
-
-f32x4_abs  :: proc (a: f32x4) -> f32x4 #intrinsic ---
-f32x4_neg  :: proc (a: f32x4) -> f32x4 #intrinsic ---
-f32x4_sqrt :: proc (a: f32x4) -> f32x4 #intrinsic ---
-f32x4_add  :: proc (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
-f32x4_sub  :: proc (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
-f32x4_mul  :: proc (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
-f32x4_div  :: proc (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
-f32x4_min  :: proc (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
-f32x4_max  :: proc (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
-
-f64x2_abs  :: proc (a: f64x2) -> f64x2 #intrinsic ---
-f64x2_neg  :: proc (a: f64x2) -> f64x2 #intrinsic ---
-f64x2_sqrt :: proc (a: f64x2) -> f64x2 #intrinsic ---
-f64x2_add  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_sub  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_mul  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_div  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_min  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
-f64x2_max  :: proc (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+i8x16_extract_lane_s :: (v: i8x16, l: u32)           -> i8    #intrinsic ---
+i8x16_extract_lane_u :: (v: i8x16, l: u32)           -> u8    #intrinsic ---
+i8x16_replace_lane   :: (v: i8x16, l: u32, val: i8)  -> i8x16 #intrinsic ---
+i16x8_extract_lane_s :: (v: i16x8, l: u32)           -> i16   #intrinsic ---
+i16x8_extract_lane_u :: (v: i16x8, l: u32)           -> u16   #intrinsic ---
+i16x8_replace_lane   :: (v: i16x8, l: u32, val: i16) -> i16x8 #intrinsic ---
+i32x4_extract_lane   :: (v: i32x4, l: u32)           -> i32   #intrinsic ---
+i32x4_replace_lane   :: (v: i32x4, l: u32, val: i32) -> i32x4 #intrinsic ---
+i64x2_extract_lane   :: (v: i64x2, l: u32)           -> i64   #intrinsic ---
+i64x2_replace_lane   :: (v: i64x2, l: u32, val: i64) -> i64x2 #intrinsic ---
+f32x4_extract_lane   :: (v: f32x4, l: u32)           -> f32   #intrinsic ---
+f32x4_replace_lane   :: (v: f32x4, l: u32, val: f32) -> f32x4 #intrinsic ---
+f64x2_extract_lane   :: (v: f64x2, l: u32)           -> f64   #intrinsic ---
+f64x2_replace_lane   :: (v: f64x2, l: u32, val: f64) -> f64x2 #intrinsic ---
+
+i8x16_swizzle :: (v: v128, s: v128)  -> v128  #intrinsic ---
+i8x16_splat   :: (val: i8)  -> i8x16 #intrinsic ---
+i16x8_splat   :: (val: i16) -> i16x8 #intrinsic ---
+i32x4_splat   :: (val: i32) -> i32x4 #intrinsic ---
+i64x2_splat   :: (val: i64) -> i64x2 #intrinsic ---
+f32x4_splat   :: (val: f32) -> f32x4 #intrinsic ---
+f64x2_splat   :: (val: f64) -> f64x2 #intrinsic ---
+
+i8x16_eq   :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_neq  :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_lt_s :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_lt_u :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_gt_s :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_gt_u :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_le_s :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_le_u :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_ge_s :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_ge_u :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+
+i16x8_eq   :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_neq  :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_lt_s :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_lt_u :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_gt_s :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_gt_u :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_le_s :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_le_u :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_ge_s :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_ge_u :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+
+i32x4_eq   :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_neq  :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_lt_s :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_lt_u :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_gt_s :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_gt_u :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_le_s :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_le_u :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_ge_s :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_ge_u :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+
+f32x4_eq  :: (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
+f32x4_neq :: (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
+f32x4_lt  :: (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
+f32x4_gt  :: (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
+f32x4_le  :: (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
+f32x4_ge  :: (a: f32x4, b: f32x4) -> i32x4 #intrinsic ---
+
+f64x2_eq  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_neq :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_lt  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_gt  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_le  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_ge  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+
+v128_not    :: (v: v128) -> v128 #intrinsic ---
+v128_and    :: (a: v128, b: v128) -> v128 #intrinsic ---
+v128_andnot :: (a: v128, b: v128) -> v128 #intrinsic ---
+v128_or     :: (a: v128, b: v128) -> v128 #intrinsic ---
+v128_xor    :: (a: v128, b: v128) -> v128 #intrinsic ---
+v128_bitselect :: (a: v128, b: v128, c: v128) -> v128 #intrinsic ---
+
+i8x16_abs            :: (a: i8x16) -> i8x16 #intrinsic ---
+i8x16_neg            :: (a: i8x16) -> i8x16 #intrinsic ---
+i8x16_any_true       :: (a: i8x16) -> bool #intrinsic ---
+i8x16_all_true       :: (a: i8x16) -> bool #intrinsic ---
+i8x16_bitmask        :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_narrow_i16x8_s :: (a: i16x8) -> i8x16 #intrinsic ---
+i8x16_narrow_i16x8_u :: (a: i16x8) -> i8x16 #intrinsic ---
+i8x16_shl            :: (a: i8x16, s: i32) -> i8x16 #intrinsic ---
+i8x16_shr_s          :: (a: i8x16, s: i32) -> i8x16 #intrinsic ---
+i8x16_shr_u          :: (a: i8x16, s: i32) -> i8x16 #intrinsic ---
+i8x16_add            :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_add_sat_s      :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_add_sat_u      :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_sub            :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_sub_sat_s      :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_sub_sat_u      :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_min_s          :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_min_u          :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_max_s          :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_max_u          :: (a: i8x16, b: i8x16) -> i8x16 #intrinsic ---
+i8x16_avgr_u         :: (a: i8x16) -> i8x16 #intrinsic ---
+
+i16x8_abs                :: (a: i16x8) -> i16x8 #intrinsic ---
+i16x8_neg                :: (a: i16x8) -> i16x8 #intrinsic ---
+i16x8_any_true           :: (a: i16x8) -> bool #intrinsic ---
+i16x8_all_true           :: (a: i16x8) -> bool #intrinsic ---
+i16x8_bitmask            :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_narrow_i32x4_s     :: (a: i32x4) -> i16x8 #intrinsic ---
+i16x8_narrow_i32x4_u     :: (a: i32x4) -> i16x8 #intrinsic ---
+i16x8_widen_low_i8x16_s  :: (a: i8x16) -> i16x8 #intrinsic ---
+i16x8_widen_high_i8x16_s :: (a: i8x16) -> i16x8 #intrinsic ---
+i16x8_widen_low_i8x16_u  :: (a: i8x16) -> i16x8 #intrinsic ---
+i16x8_widen_high_i8x16_u :: (a: i8x16) -> i16x8 #intrinsic ---
+i16x8_shl                :: (a: i16x8, s: i32) -> i16x8 #intrinsic ---
+i16x8_shr_s              :: (a: i16x8, s: i32) -> i16x8 #intrinsic ---
+i16x8_shr_u              :: (a: i16x8, s: i32) -> i16x8 #intrinsic ---
+i16x8_add                :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_add_sat_s          :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_add_sat_u          :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_sub                :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_sub_sat_s          :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_sub_sat_u          :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_mul                :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_min_s              :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_min_u              :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_max_s              :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_max_u              :: (a: i16x8, b: i16x8) -> i16x8 #intrinsic ---
+i16x8_avgr_u             :: (a: i16x8) -> i16x8 #intrinsic ---
+
+i32x4_abs                :: (a: i32x4) -> i32x4 #intrinsic ---
+i32x4_neg                :: (a: i32x4) -> i32x4 #intrinsic ---
+i32x4_any_true           :: (a: i32x4) -> bool #intrinsic ---
+i32x4_all_true           :: (a: i32x4) -> bool #intrinsic ---
+i32x4_bitmask            :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_widen_low_i16x8_s  :: (a: i16x8) -> i32x4 #intrinsic ---
+i32x4_widen_high_i16x8_s :: (a: i16x8) -> i32x4 #intrinsic ---
+i32x4_widen_low_i16x8_u  :: (a: i16x8) -> i32x4 #intrinsic ---
+i32x4_widen_high_i16x8_u :: (a: i16x8) -> i32x4 #intrinsic ---
+i32x4_shl                :: (a: i32x4, s: i32) -> i32x4 #intrinsic ---
+i32x4_shr_s              :: (a: i32x4, s: i32) -> i32x4 #intrinsic ---
+i32x4_shl_u              :: (a: i32x4, s: i32) -> i32x4 #intrinsic ---
+i32x4_add                :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_sub                :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_mul                :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_min_s              :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_min_u              :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_max_s              :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+i32x4_max_u              :: (a: i32x4, b: i32x4) -> i32x4 #intrinsic ---
+
+i64x2_neg   :: (a: i64x2) -> i64x2 #intrinsic ---
+i64x2_shl   :: (a: i64x2, s: i32) -> i64x2 #intrinsic ---
+i64x2_shr_s :: (a: i64x2, s: i32) -> i64x2 #intrinsic ---
+i64x2_shr_u :: (a: i64x2, s: i32) -> i64x2 #intrinsic ---
+i64x2_add   :: (a: i64x2, b: i64x2) -> i64x2 #intrinsic ---
+i64x2_sub   :: (a: i64x2, b: i64x2) -> i64x2 #intrinsic ---
+i64x2_mul   :: (a: i64x2, b: i64x2) -> i64x2 #intrinsic ---
+
+f32x4_abs  :: (a: f32x4) -> f32x4 #intrinsic ---
+f32x4_neg  :: (a: f32x4) -> f32x4 #intrinsic ---
+f32x4_sqrt :: (a: f32x4) -> f32x4 #intrinsic ---
+f32x4_add  :: (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
+f32x4_sub  :: (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
+f32x4_mul  :: (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
+f32x4_div  :: (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
+f32x4_min  :: (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
+f32x4_max  :: (a: f32x4, b: f32x4) -> f32x4 #intrinsic ---
+
+f64x2_abs  :: (a: f64x2) -> f64x2 #intrinsic ---
+f64x2_neg  :: (a: f64x2) -> f64x2 #intrinsic ---
+f64x2_sqrt :: (a: f64x2) -> f64x2 #intrinsic ---
+f64x2_add  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_sub  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_mul  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_div  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_min  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
+f64x2_max  :: (a: f64x2, b: f64x2) -> f64x2 #intrinsic ---
 
 // NOTE: These may be backwards
-i32x4_trunc_sat_f32x4_s :: proc (v: f32x4) -> i32x4 #intrinsic ---
-i32x4_trunc_sat_f32x4_u :: proc (v: f32x4) -> i32x4 #intrinsic ---
-f32x4_convert_i32x4_s   :: proc (v: i32x4) -> f32x4 #intrinsic ---
-f32x4_convert_i32x4_u   :: proc (v: i32x4) -> f32x4 #intrinsic ---
+i32x4_trunc_sat_f32x4_s :: (v: f32x4) -> i32x4 #intrinsic ---
+i32x4_trunc_sat_f32x4_u :: (v: f32x4) -> i32x4 #intrinsic ---
+f32x4_convert_i32x4_s   :: (v: i32x4) -> f32x4 #intrinsic ---
+f32x4_convert_i32x4_u   :: (v: i32x4) -> f32x4 #intrinsic ---
index 9aafb61742c8a379e23d4789ae23cbe950750345..db95e792c8465b1499fd99594cbc4aa098562e84 100644 (file)
@@ -1,48 +1,48 @@
 package core.intrinsics.wasm
 
-memory_size  :: proc () -> i32 #intrinsic ---
-memory_grow  :: proc (val: i32) -> i32 #intrinsic ---
+memory_size  :: () -> i32 #intrinsic ---
+memory_grow  :: (val: i32) -> i32 #intrinsic ---
 
-clz_i32      :: proc (val: i32) -> i32 #intrinsic ---
-ctz_i32      :: proc (val: i32) -> i32 #intrinsic ---
-popcnt_i32   :: proc (val: i32) -> i32 #intrinsic ---
-and_i32      :: proc (lhs: i32, rhs: i32) -> i32 #intrinsic ---
-or_i32       :: proc (lhs: i32, rhs: i32) -> i32 #intrinsic ---
-xor_i32      :: proc (lhs: i32, rhs: i32) -> i32 #intrinsic ---
-shl_i32      :: proc (lhs: i32, rhs: i32) -> i32 #intrinsic ---
-slr_i32      :: proc (lhs: i32, rhs: i32) -> i32 #intrinsic ---
-sar_i32      :: proc (lhs: i32, rhs: i32) -> i32 #intrinsic ---
-rotl_i32     :: proc (lhs: i32, rhs: i32) -> i32 #intrinsic ---
-rotr_i32     :: proc (lhs: i32, rhs: i32) -> i32 #intrinsic ---
+clz_i32      :: (val: i32) -> i32 #intrinsic ---
+ctz_i32      :: (val: i32) -> i32 #intrinsic ---
+popcnt_i32   :: (val: i32) -> i32 #intrinsic ---
+and_i32      :: (lhs: i32, rhs: i32) -> i32 #intrinsic ---
+or_i32       :: (lhs: i32, rhs: i32) -> i32 #intrinsic ---
+xor_i32      :: (lhs: i32, rhs: i32) -> i32 #intrinsic ---
+shl_i32      :: (lhs: i32, rhs: i32) -> i32 #intrinsic ---
+slr_i32      :: (lhs: i32, rhs: i32) -> i32 #intrinsic ---
+sar_i32      :: (lhs: i32, rhs: i32) -> i32 #intrinsic ---
+rotl_i32     :: (lhs: i32, rhs: i32) -> i32 #intrinsic ---
+rotr_i32     :: (lhs: i32, rhs: i32) -> i32 #intrinsic ---
 
-clz_i64      :: proc (val: i64) -> i64 #intrinsic ---
-ctz_i64      :: proc (val: i64) -> i64 #intrinsic ---
-popcnt_i64   :: proc (val: i64) -> i64 #intrinsic ---
-and_i64      :: proc (lhs: i64, rhs: i64) -> i64 #intrinsic ---
-or_i64       :: proc (lhs: i64, rhs: i64) -> i64 #intrinsic ---
-xor_i64      :: proc (lhs: i64, rhs: i64) -> i64 #intrinsic ---
-shl_i64      :: proc (lhs: i64, rhs: i64) -> i64 #intrinsic ---
-slr_i64      :: proc (lhs: i64, rhs: i64) -> i64 #intrinsic ---
-sar_i64      :: proc (lhs: i64, rhs: i64) -> i64 #intrinsic ---
-rotl_i64     :: proc (lhs: i64, rhs: i64) -> i64 #intrinsic ---
-rotr_i64     :: proc (lhs: i64, rhs: i64) -> i64 #intrinsic ---
+clz_i64      :: (val: i64) -> i64 #intrinsic ---
+ctz_i64      :: (val: i64) -> i64 #intrinsic ---
+popcnt_i64   :: (val: i64) -> i64 #intrinsic ---
+and_i64      :: (lhs: i64, rhs: i64) -> i64 #intrinsic ---
+or_i64       :: (lhs: i64, rhs: i64) -> i64 #intrinsic ---
+xor_i64      :: (lhs: i64, rhs: i64) -> i64 #intrinsic ---
+shl_i64      :: (lhs: i64, rhs: i64) -> i64 #intrinsic ---
+slr_i64      :: (lhs: i64, rhs: i64) -> i64 #intrinsic ---
+sar_i64      :: (lhs: i64, rhs: i64) -> i64 #intrinsic ---
+rotl_i64     :: (lhs: i64, rhs: i64) -> i64 #intrinsic ---
+rotr_i64     :: (lhs: i64, rhs: i64) -> i64 #intrinsic ---
 
-abs_f32      :: proc (val: f32) -> f32 #intrinsic ---
-ceil_f32     :: proc (val: f32) -> f32 #intrinsic ---
-floor_f32    :: proc (val: f32) -> f32 #intrinsic ---
-trunc_f32    :: proc (val: f32) -> f32 #intrinsic ---
-nearest_f32  :: proc (val: f32) -> f32 #intrinsic ---
-sqrt_f32     :: proc (val: f32) -> f32 #intrinsic ---
-min_f32      :: proc (lhs: f32, rhs: f32) -> f32 #intrinsic ---
-max_f32      :: proc (lhs: f32, rhs: f32) -> f32 #intrinsic ---
-copysign_f32 :: proc (lhs: f32, rhs: f32) -> f32 #intrinsic ---
+abs_f32      :: (val: f32) -> f32 #intrinsic ---
+ceil_f32     :: (val: f32) -> f32 #intrinsic ---
+floor_f32    :: (val: f32) -> f32 #intrinsic ---
+trunc_f32    :: (val: f32) -> f32 #intrinsic ---
+nearest_f32  :: (val: f32) -> f32 #intrinsic ---
+sqrt_f32     :: (val: f32) -> f32 #intrinsic ---
+min_f32      :: (lhs: f32, rhs: f32) -> f32 #intrinsic ---
+max_f32      :: (lhs: f32, rhs: f32) -> f32 #intrinsic ---
+copysign_f32 :: (lhs: f32, rhs: f32) -> f32 #intrinsic ---
 
-abs_f64      :: proc (val: f64) -> f64 #intrinsic ---
-ceil_f64     :: proc (val: f64) -> f64 #intrinsic ---
-floor_f64    :: proc (val: f64) -> f64 #intrinsic ---
-trunc_f64    :: proc (val: f64) -> f64 #intrinsic ---
-nearest_f64  :: proc (val: f64) -> f64 #intrinsic ---
-sqrt_f64     :: proc (val: f64) -> f64 #intrinsic ---
-min_f64      :: proc (lhs: f64, rhs: f64) -> f64 #intrinsic ---
-max_f64      :: proc (lhs: f64, rhs: f64) -> f64 #intrinsic ---
-copysign_f64 :: proc (lhs: f64, rhs: f64) -> f64 #intrinsic ---
+abs_f64      :: (val: f64) -> f64 #intrinsic ---
+ceil_f64     :: (val: f64) -> f64 #intrinsic ---
+floor_f64    :: (val: f64) -> f64 #intrinsic ---
+trunc_f64    :: (val: f64) -> f64 #intrinsic ---
+nearest_f64  :: (val: f64) -> f64 #intrinsic ---
+sqrt_f64     :: (val: f64) -> f64 #intrinsic ---
+min_f64      :: (lhs: f64, rhs: f64) -> f64 #intrinsic ---
+max_f64      :: (lhs: f64, rhs: f64) -> f64 #intrinsic ---
+copysign_f64 :: (lhs: f64, rhs: f64) -> f64 #intrinsic ---
index a0f037cfac6b25831d56804ae246d1534bc40b4d..8652ea8f728a7a50a1d2935ea67ac947543ead43 100644 (file)
@@ -4,13 +4,13 @@ Reader :: struct {
     stream : ^Stream;
 }
 
-reader_make :: proc (s: ^Stream) -> Reader {
+reader_make :: (s: ^Stream) -> Reader {
     assert(s.vtable != null, "Stream vtable was not setup correctly.");
     
     return Reader.{ s };
 }
 
-read_u32 :: proc (use reader: ^Reader) -> u32 {
+read_u32 :: (use reader: ^Reader) -> u32 {
     n: u32 = 0;
 
     skip_whitespace(reader);
@@ -29,7 +29,7 @@ read_u32 :: proc (use reader: ^Reader) -> u32 {
     return n;
 }
 
-read_u64 :: proc (use reader: ^Reader) -> u64 {
+read_u64 :: (use reader: ^Reader) -> u64 {
     n: u64 = 0;
 
     skip_whitespace(reader);
@@ -48,7 +48,7 @@ read_u64 :: proc (use reader: ^Reader) -> u64 {
     return n;
 }
 
-read_line :: proc (use reader: ^Reader, allocator := context.allocator) -> str {
+read_line :: (use reader: ^Reader, allocator := context.allocator) -> str {
     _, curr_pos := stream_tell(stream);
 
     count := 0;
@@ -71,7 +71,7 @@ read_line :: proc (use reader: ^Reader, allocator := context.allocator) -> str {
     return out;
 }
 
-read_word :: proc (use reader: ^Reader, allocator := context.allocator) -> str {
+read_word :: (use reader: ^Reader, allocator := context.allocator) -> str {
     skip_whitespace(reader);
 
     _, curr_pos := stream_tell(stream);
@@ -103,7 +103,7 @@ read_word :: proc (use reader: ^Reader, allocator := context.allocator) -> str {
     return out;
 }
 
-advance_line :: proc (use reader: ^Reader) {
+advance_line :: (use reader: ^Reader) {
     err, curr := stream_read_byte(stream);
     if err != Error.None do return;
     
@@ -115,7 +115,7 @@ advance_line :: proc (use reader: ^Reader) {
     err, curr = stream_read_byte(stream);
 }
 
-skip_whitespace :: proc (use reader: ^Reader) {
+skip_whitespace :: (use reader: ^Reader) {
     while true {
         err, byte := stream_peek_byte(stream);
         if err == Error.EOF do break;
index 90125517c076b68d1660d9e4271b87bef5c943ad..3d33a20ac7621d4f36c92e607898c77ee441d358 100644 (file)
@@ -6,24 +6,24 @@ Writer :: struct {
     stream : ^Stream;
 }
 
-writer_make :: proc (s: ^Stream) -> Writer {
+writer_make :: (s: ^Stream) -> Writer {
     assert(s.vtable != null, "Stream vtable was not setup correctly.");
 
     return Writer.{ s };
 }
 
-write_str :: proc (use writer: ^Writer, s: str) {
+write_str :: (use writer: ^Writer, s: str) {
     stream_write(stream, s);
 }
 
-write_cstr :: proc (use writer: ^Writer, cs: cstr) {
+write_cstr :: (use writer: ^Writer, cs: cstr) {
     use package core
 
     s := string.make(cs);
     write_str(writer, s);
 }
 
-write_i32 :: proc (use writer: ^Writer, n: i32, base: u32 = 10) {
+write_i32 :: (use writer: ^Writer, n: i32, base: u32 = 10) {
     use package core
 
     buf : [256] u8;
@@ -31,7 +31,7 @@ write_i32 :: proc (use writer: ^Writer, n: i32, base: u32 = 10) {
     write_str(writer, s);
 }
 
-write_i64 :: proc (use writer: ^Writer, n: i64, base: u64 = 10) {
+write_i64 :: (use writer: ^Writer, n: i64, base: u64 = 10) {
     use package core
 
     buf : [256] u8;
@@ -39,7 +39,7 @@ write_i64 :: proc (use writer: ^Writer, n: i64, base: u64 = 10) {
     write_str(writer, s);
 }
 
-write_f32 :: proc (use writer: ^Writer, f: f32) {
+write_f32 :: (use writer: ^Writer, f: f32) {
     use package core
 
     buf : [256] u8;
@@ -47,7 +47,7 @@ write_f32 :: proc (use writer: ^Writer, f: f32) {
     write_str(writer, s);
 }
 
-write_f64 :: proc (use writer: ^Writer, f: f64) {
+write_f64 :: (use writer: ^Writer, f: f64) {
     use package core
 
     buf : [256] u8;
@@ -55,23 +55,23 @@ write_f64 :: proc (use writer: ^Writer, f: f64) {
     write_str(writer, s);
 }
 
-write_bool :: proc (use writer: ^Writer, b: bool) {
+write_bool :: (use writer: ^Writer, b: bool) {
     if b do write_str(writer, "true");
     else do write_str(writer, "false");
 }
 
-write_ptr :: proc (use writer: ^Writer, p: ^void) {
+write_ptr :: (use writer: ^Writer, p: ^void) {
     write_i64(writer, cast(i64) p, 16);
 }
 
-write_range :: proc (use writer: ^Writer, r: range, sep := " ") {
+write_range :: (use writer: ^Writer, r: range, sep := " ") {
     for i: r {
         write_i32(writer, i);
         if i + r.step < r.high do write_str(writer, sep);
     }
 }
 
-write_format :: proc (use writer: ^Writer, format: str, va: ...) {
+write_format :: (use writer: ^Writer, format: str, va: ...) {
     // POTENTIAL BUG: this buffer will need to be bigger (or dynamic).
     buffer: [2048] u8;
     write_str(writer, conv.str_format_va(format, buffer[0 .. 2048], va));
index 39d9a4cc8d8f040fa016ddc892553cf862ccd6ba..2167761c907685a903dfda129ecfad7b22fe0e9a 100644 (file)
@@ -722,128 +722,128 @@ GLMat2 :: #type [4] GLfloat
 GLMat3 :: #type [9] GLfloat
 GLMat4 :: #type [16] GLfloat
 
-activeTexture                  :: proc (texture: GLenum) #foreign "gl" "activeTexture" ---
-attachShader                   :: proc (program: GLProgram, shader: GLShader) -> GLProgram #foreign "gl" "attachShader" ---
-bindAttribLocation             :: proc (program: GLProgram, index: GLuint, name: str) #foreign "gl" "bindAttribLocation" ---
-bindBuffer                     :: proc (target: GLenum, buffer: GLBuffer) #foreign "gl" "bindBuffer" ---
-bindFramebuffer                :: proc (target: GLenum, framebuffer: GLFramebuffer) #foreign "gl" "bindFramebuffer" ---
-bindRenderbuffer               :: proc (target: GLenum, renderbuffer: GLRenderbuffer) #foreign "gl" "bindRenderbuffer" ---
-bindTexture                    :: proc (target: GLenum, texture: GLTexture) #foreign "gl" "bindTexture" ---
-bindVertexArray                :: proc (vertexArray: GLVertexArrayObject) #foreign "gl" "bindVertexArray" ---
-blendColor                     :: proc (red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) #foreign "gl" "blendColor" ---
-blendEquation                  :: proc (mode: GLenum) #foreign "gl" "blendEquation" ---
-blendEquationSeparate          :: proc (modeRGB: GLenum, modeAlpha: GLenum) #foreign "gl" "blendEquationSeparate" ---
-blendFunc                      :: proc (sfactor: GLenum, dfactor: GLenum) #foreign "gl" "blendFunc" ---
-blendFuncSeparate              :: proc (srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) #foreign "gl" "blendFuncSeparate" ---
-blitFramebuffer                :: proc (sx0: GLint, sy0: GLint, sx1: GLint, sy1: GLint, dx0: GLint, dy0: GLint, dx1: GLint, dy1: GLint, mask: GLbitfield, filter: GLenum) #foreign "gl" "blitFramebuffer" ---
-bufferDataWithData             :: proc (target: GLenum, buffer: [] void, usage: GLenum) #foreign "gl" "bufferDataWithData" ---
-bufferDataNoData               :: proc (target: GLenum, size: GLsizeiptr, usage: GLenum) #foreign "gl" "bufferDataNoData" ---
-bufferData                     :: proc { bufferDataWithData, bufferDataNoData }
-bufferSubData                  :: proc (target: GLenum, offset: GLsizei, data: [] void) #foreign "gl" "bufferSubData" ---
-canvasSize                     :: proc (width: GLsizei, height: GLsizei) #foreign "gl" "canvasSize" ---
-checkFrameBufferStatus         :: proc (target: GLenum) -> GLenum #foreign "gl" "checkFrameBufferStatus" ---
-clear                          :: proc (mask: GLbitfield) #foreign "gl" "clear" ---
-clearColor                     :: proc (red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) #foreign "gl" "clearColor" ---
-clearDepth                     :: proc (depth: GLclampf) #foreign "gl" "clearDepth" ---
-clearStencil                   :: proc (s: GLint) #foreign "gl" "clearStencil" ---
-colorMask                      :: proc (red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) #foreign "gl" "colorMask" ---
-compileShader                  :: proc (shader: GLShader) #foreign "gl" "compileShader" ---
-compressedTexImage2D           :: proc (target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: str) #foreign "gl" "compressedTexImage2D" ---
-compressedTexSubImage2D        :: proc (target: GLenum, level: GLint, internalformat: GLenum, xoff: GLint, yoff: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: str) #foreign "gl" "compressedTexSubImage2D" ---
-copyBufferSubData              :: proc (readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) #foreign "gl" "copyBufferSubData" ---
-copyTexImage2D                 :: proc (target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) #foreign "gl" "copyTexImage2D" ---
-copyTexSubImage2D              :: proc (target: GLenum, level: GLint, xoff: GLint, yoff: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) #foreign "gl" "copyTexSubImage2D" ---
-createBuffer                   :: proc () -> GLBuffer #foreign "gl" "createBuffer" ---
-createFramebuffer              :: proc () -> GLFramebuffer #foreign "gl" "createFramebuffer" ---
-createProgram                  :: proc () -> GLProgram #foreign "gl" "createProgram" ---
-createRenderbuffer             :: proc () -> GLRenderbuffer #foreign "gl" "createRenderbuffer" ---
-createShader                   :: proc (type: GLenum) -> GLShader #foreign "gl" "createShader" ---
-createTexture                  :: proc () -> GLTexture #foreign "gl" "createTexture" ---
-createVertexArray              :: proc () -> GLVertexArrayObject #foreign "gl" "createVertexArray" ---
-cullFace                       :: proc (mode: GLenum) #foreign "gl" "cullFace" ---
-deleteBuffer                   :: proc (buffer: GLBuffer) #foreign "gl" "deleteBuffer" ---
-deleteFramebuffer              :: proc (framebuffer: GLFramebuffer) #foreign "gl" "deleteFramebuffer" ---
-deleteProgram                  :: proc (program: GLProgram) #foreign "gl" "deleteProgram" ---
-deleteRenderbuffer             :: proc (renderbuffer: GLRenderbuffer) #foreign "gl" "deleteRenderbuffer" ---
-deleteShader                   :: proc (shader: GLShader) #foreign "gl" "deleteShader" ---
-deleteTexture                  :: proc (texture: GLTexture) #foreign "gl" "deleteTexture" ---
-deleteVertexArray              :: proc (vertexArray: GLVertexArrayObject) #foreign "gl" "deleteVertexArray" ---
-depthFunc                      :: proc (func: GLenum) #foreign "gl" "depthFunc" ---
-depthMask                      :: proc (flag: GLboolean) #foreign "gl" "depthMask" ---
-depthRange                     :: proc (zNear: GLclampf, zFar: GLclampf) #foreign "gl" "depthRange" ---
-detachShader                   :: proc (program: GLProgram, shader: GLShader) #foreign "gl" "detachShader" ---
-disable                        :: proc (cap: GLenum) #foreign "gl" "disable" ---
-disableVertexAttribArray       :: proc (index: GLuint) #foreign "gl" "disableVertexAttribArray" ---
-drawArrays                     :: proc (mode: GLenum, first: GLint, count: GLsizei) #foreign "gl" "drawArrays" ---
-drawArraysInstanced            :: proc (mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) #foreign "gl" "drawArraysInstanced" ---
-drawElements                   :: proc (mode: GLenum, count: GLsizei, type: GLenum, offset: GLint) #foreign "gl" "drawElements" ---
-drawElementsInstanced          :: proc (mode: GLenum, count: GLsizei, type: GLenum, offset: GLint, instanceCount: GLsizei) #foreign "gl" "drawElementsInstanced" ---
-enable                         :: proc (cap: GLenum) #foreign "gl" "enable" ---
-enableVertexAttribArray        :: proc (index: GLuint) #foreign "gl" "enableVertexAttribArray" ---
-finish                         :: proc () #foreign "gl" "finish" ---
-flush                          :: proc () #foreign "gl" "flush" ---
-framebufferRenderbuffer        :: proc (target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: GLRenderbuffer) #foreign "gl" "framebufferRenderbuffer" ---
-framebufferTexture2D           :: proc (target: GLenum, attachment: GLenum, textarget: GLenum, texture: GLTexture, level: GLint) #foreign "gl" "framebufferTexture2D" ---
-framebufferTextureLayer        :: proc (target: GLenum, attachment: GLenum, texture: GLTexture, level: GLint, layer: GLint) #foreign "gl" "framebufferTextureLayer" ---
-frontFace                      :: proc (mode: GLenum) #foreign "gl" "frontFace" ---
-generateMipmap                 :: proc (target: GLenum) #foreign "gl" "generateMipmap" ---
-getActiveAttrib                :: proc (program: GLProgram, index: GLuint, out: ^GLActiveInfo) #foreign "gl" "getActiveAttrib" ---
-getActiveUniform               :: proc (program: GLProgram, index: GLuint, out: ^GLActiveInfo) #foreign "gl" "getActiveUniform" ---
+activeTexture                  :: (texture: GLenum) -> void #foreign "gl" "activeTexture" ---
+attachShader                   :: (program: GLProgram, shader: GLShader) -> GLProgram #foreign "gl" "attachShader" ---
+bindAttribLocation             :: (program: GLProgram, index: GLuint, name: str) -> void #foreign "gl" "bindAttribLocation" ---
+bindBuffer                     :: (target: GLenum, buffer: GLBuffer) -> void #foreign "gl" "bindBuffer" ---
+bindFramebuffer                :: (target: GLenum, framebuffer: GLFramebuffer) -> void #foreign "gl" "bindFramebuffer" ---
+bindRenderbuffer               :: (target: GLenum, renderbuffer: GLRenderbuffer) -> void #foreign "gl" "bindRenderbuffer" ---
+bindTexture                    :: (target: GLenum, texture: GLTexture) -> void #foreign "gl" "bindTexture" ---
+bindVertexArray                :: (vertexArray: GLVertexArrayObject) -> void #foreign "gl" "bindVertexArray" ---
+blendColor                     :: (red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) -> void #foreign "gl" "blendColor" ---
+blendEquation                  :: (mode: GLenum) -> void #foreign "gl" "blendEquation" ---
+blendEquationSeparate          :: (modeRGB: GLenum, modeAlpha: GLenum) -> void #foreign "gl" "blendEquationSeparate" ---
+blendFunc                      :: (sfactor: GLenum, dfactor: GLenum) -> void #foreign "gl" "blendFunc" ---
+blendFuncSeparate              :: (srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) -> void #foreign "gl" "blendFuncSeparate" ---
+blitFramebuffer                :: (sx0: GLint, sy0: GLint, sx1: GLint, sy1: GLint, dx0: GLint, dy0: GLint, dx1: GLint, dy1: GLint, mask: GLbitfield, filter: GLenum) -> void #foreign "gl" "blitFramebuffer" ---
+bufferDataWithData             :: (target: GLenum, buffer: [] void, usage: GLenum) -> void #foreign "gl" "bufferDataWithData" ---
+bufferDataNoData               :: (target: GLenum, size: GLsizeiptr, usage: GLenum) -> void #foreign "gl" "bufferDataNoData" ---
+bufferData                     :: { bufferDataWithData, bufferDataNoData }
+bufferSubData                  :: (target: GLenum, offset: GLsizei, data: [] void) -> void #foreign "gl" "bufferSubData" ---
+canvasSize                     :: (width: GLsizei, height: GLsizei) -> void #foreign "gl" "canvasSize" ---
+checkFrameBufferStatus         :: (target: GLenum) -> GLenum #foreign "gl" "checkFrameBufferStatus" ---
+clear                          :: (mask: GLbitfield) -> void #foreign "gl" "clear" ---
+clearColor                     :: (red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) -> void #foreign "gl" "clearColor" ---
+clearDepth                     :: (depth: GLclampf) -> void #foreign "gl" "clearDepth" ---
+clearStencil                   :: (s: GLint) -> void #foreign "gl" "clearStencil" ---
+colorMask                      :: (red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) -> void #foreign "gl" "colorMask" ---
+compileShader                  :: (shader: GLShader) -> void #foreign "gl" "compileShader" ---
+compressedTexImage2D           :: (target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: str) -> void #foreign "gl" "compressedTexImage2D" ---
+compressedTexSubImage2D        :: (target: GLenum, level: GLint, internalformat: GLenum, xoff: GLint, yoff: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: str) -> void #foreign "gl" "compressedTexSubImage2D" ---
+copyBufferSubData              :: (readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) -> void #foreign "gl" "copyBufferSubData" ---
+copyTexImage2D                 :: (target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) -> void #foreign "gl" "copyTexImage2D" ---
+copyTexSubImage2D              :: (target: GLenum, level: GLint, xoff: GLint, yoff: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) -> void #foreign "gl" "copyTexSubImage2D" ---
+createBuffer                   :: () -> GLBuffer #foreign "gl" "createBuffer" ---
+createFramebuffer              :: () -> GLFramebuffer #foreign "gl" "createFramebuffer" ---
+createProgram                  :: () -> GLProgram #foreign "gl" "createProgram" ---
+createRenderbuffer             :: () -> GLRenderbuffer #foreign "gl" "createRenderbuffer" ---
+createShader                   :: (type: GLenum) -> GLShader #foreign "gl" "createShader" ---
+createTexture                  :: () -> GLTexture #foreign "gl" "createTexture" ---
+createVertexArray              :: () -> GLVertexArrayObject #foreign "gl" "createVertexArray" ---
+cullFace                       :: (mode: GLenum) -> void #foreign "gl" "cullFace" ---
+deleteBuffer                   :: (buffer: GLBuffer) -> void #foreign "gl" "deleteBuffer" ---
+deleteFramebuffer              :: (framebuffer: GLFramebuffer) -> void #foreign "gl" "deleteFramebuffer" ---
+deleteProgram                  :: (program: GLProgram) -> void #foreign "gl" "deleteProgram" ---
+deleteRenderbuffer             :: (renderbuffer: GLRenderbuffer) -> void #foreign "gl" "deleteRenderbuffer" ---
+deleteShader                   :: (shader: GLShader) -> void #foreign "gl" "deleteShader" ---
+deleteTexture                  :: (texture: GLTexture) -> void #foreign "gl" "deleteTexture" ---
+deleteVertexArray              :: (vertexArray: GLVertexArrayObject) -> void #foreign "gl" "deleteVertexArray" ---
+depthFunc                      :: (func: GLenum) -> void #foreign "gl" "depthFunc" ---
+depthMask                      :: (flag: GLboolean) -> void #foreign "gl" "depthMask" ---
+depthRange                     :: (zNear: GLclampf, zFar: GLclampf) -> void #foreign "gl" "depthRange" ---
+detachShader                   :: (program: GLProgram, shader: GLShader) -> void #foreign "gl" "detachShader" ---
+disable                        :: (cap: GLenum) -> void #foreign "gl" "disable" ---
+disableVertexAttribArray       :: (index: GLuint) -> void #foreign "gl" "disableVertexAttribArray" ---
+drawArrays                     :: (mode: GLenum, first: GLint, count: GLsizei) -> void #foreign "gl" "drawArrays" ---
+drawArraysInstanced            :: (mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) -> void #foreign "gl" "drawArraysInstanced" ---
+drawElements                   :: (mode: GLenum, count: GLsizei, type: GLenum, offset: GLint) -> void #foreign "gl" "drawElements" ---
+drawElementsInstanced          :: (mode: GLenum, count: GLsizei, type: GLenum, offset: GLint, instanceCount: GLsizei) -> void #foreign "gl" "drawElementsInstanced" ---
+enable                         :: (cap: GLenum) -> void #foreign "gl" "enable" ---
+enableVertexAttribArray        :: (index: GLuint) -> void #foreign "gl" "enableVertexAttribArray" ---
+finish                         :: () -> void #foreign "gl" "finish" ---
+flush                          :: () -> void #foreign "gl" "flush" ---
+framebufferRenderbuffer        :: (target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: GLRenderbuffer) -> void #foreign "gl" "framebufferRenderbuffer" ---
+framebufferTexture2D           :: (target: GLenum, attachment: GLenum, textarget: GLenum, texture: GLTexture, level: GLint) -> void #foreign "gl" "framebufferTexture2D" ---
+framebufferTextureLayer        :: (target: GLenum, attachment: GLenum, texture: GLTexture, level: GLint, layer: GLint) -> void #foreign "gl" "framebufferTextureLayer" ---
+frontFace                      :: (mode: GLenum) -> void #foreign "gl" "frontFace" ---
+generateMipmap                 :: (target: GLenum) -> void #foreign "gl" "generateMipmap" ---
+getActiveAttrib                :: (program: GLProgram, index: GLuint, out: ^GLActiveInfo) -> void #foreign "gl" "getActiveAttrib" ---
+getActiveUniform               :: (program: GLProgram, index: GLuint, out: ^GLActiveInfo) -> void #foreign "gl" "getActiveUniform" ---
 // getAttachedShaders does not work yet because we can't return a list of things
-getAttribLocation              :: proc (program: GLProgram, name: str) -> GLint #foreign "gl" "getAttribLocation" ---
-getBufferSubData               :: proc (target: GLenum, srcByteOffset: GLintptr, dstBuffer: str, dstOffset: GLuint, length: GLuint) #foreign "gl" "getBufferSubData" ---
+getAttribLocation              :: (program: GLProgram, name: str) -> GLint #foreign "gl" "getAttribLocation" ---
+getBufferSubData               :: (target: GLenum, srcByteOffset: GLintptr, dstBuffer: str, dstOffset: GLuint, length: GLuint) -> void #foreign "gl" "getBufferSubData" ---
 // getBufferParameter and getParameter do not work
-getError                       :: proc () -> GLenum #foreign "gl" "getError" ---
-getInternalformatParameter     :: proc (target: GLenum, internalFormat: GLenum, pname: GLenum) -> GLenum #foreign "gl" "getInternalformatParameter" ---
+getError                       :: () -> GLenum #foreign "gl" "getError" ---
+getInternalformatParameter     :: (target: GLenum, internalFormat: GLenum, pname: GLenum) -> GLenum #foreign "gl" "getInternalformatParameter" ---
 // many of the 'gets' don't work yet because they return very javascripty things
-getProgramParameter            :: proc (program: GLProgram, pname: GLenum) -> GLenum #foreign "gl" "getProgramParameter" ---
-getShaderParameter             :: proc (shader: GLShader, pname: GLenum) -> GLenum #foreign "gl" "getShaderParameter" ---
-getUniformLocation             :: proc (program: GLProgram, name: str) -> GLUniformLocation #foreign "gl" "getUniformLocation" ---
-getVertexAttribOffset          :: proc (index: GLuint, pname: GLenum) #foreign "gl" "getVertexAttribOffset" ---
-hint                           :: proc (target: GLenum, mode: GLenum) #foreign "gl" "hint" ---
-init                           :: proc (canvasname: str) -> GLboolean #foreign "gl" "init" ---
-invalidateFramebuffer          :: proc (target: GLenum, attachments: str) #foreign "gl" "invalidateFramebuffer" ---
-invalidateSubFramebuffer       :: proc (target: GLenum, attachments: str, x: GLint, y: GLint, width: GLsizei, height: GLsizei) #foreign "gl" "invalidateSubFramebuffer" ---
-isEnabled                      :: proc (cap: GLenum) -> GLboolean #foreign "gl" "isEnabled" ---
-lineWidth                      :: proc (width: GLfloat) #foreign "gl" "lineWidth" ---
-linkProgram                    :: proc (program: GLProgram) #foreign "gl" "linkProgram" ---
-pixelStorei                    :: proc (pname: GLenum, param: GLenum) #foreign "gl" "pixelStorei" ---
-polygonOffset                  :: proc (factor: GLfloat, units: GLfloat) #foreign "gl" "polygonOffset" ---
-printProgramInfoLog            :: proc (program: GLProgram) #foreign "gl" "printProgramInfoLog" ---
-printShaderInfoLog             :: proc (shader: GLShader) #foreign "gl" "printShaderInfoLog" ---
-readBuffer                     :: proc (src: GLenum) #foreign "gl" "readBuffer" ---
-readPixels                     :: proc (x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: str) #foreign "gl" "readPixels" ---
-renderbufferStorageMultisample :: proc (target: GLenum, samples: GLsizei, internalforamt: GLenum, width: GLsizei, height: GLsizei) #foreign "gl" "renderbufferStorageMultisample" ---
-sampleCoverage                 :: proc (value: GLclampf, invert: GLboolean) #foreign "gl" "sampleCoverage" ---
-scissor                        :: proc (x: GLint, y: GLint, width: GLsizei, height: GLsizei) #foreign "gl" "scissor" ---
-shaderSource                   :: proc (shader: GLShader, source: str) #foreign "gl" "shaderSource" ---
-stencilFunc                    :: proc (func: GLenum, ref: GLint, mask: GLuint) #foreign "gl" "stencilFunc" ---
-stencilFuncSeparate            :: proc (face: GLenum, func: GLenum, ref: GLint, mask: GLuint) #foreign "gl" "stencilFuncSeparate" ---
-stencilMask                    :: proc (mask: GLuint) #foreign "gl" "stencilMask" ---
-stencilMaskSeparate            :: proc (face: GLenum, mask: GLenum) #foreign "gl" "stencilMaskSeparate" ---
-stencilOp                      :: proc (fail: GLenum, zfail: GLenum, zpass: GLenum) #foreign "gl" "stencilOp" ---
-stencilOpSeparate              :: proc (face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) #foreign "gl" "stencilOpSeparate" ---
-texImage2D                     :: proc (target: GLenum, level: GLint, internalFormat: GLenum, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: str) #foreign "gl" "texImage2D" ---
-texParameterf                  :: proc (target: GLenum, pname: GLenum, param: GLfloat) #foreign "gl" "texParameterf" ---
-texParameteri                  :: proc (target: GLenum, pname: GLenum, param: GLint) #foreign "gl" "texParameteri" ---
-texSubImage2D                  :: proc (target: GLenum, level: GLint, xoff: GLint, yoff: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: str) #foreign "gl" "texSubImage2D" ---
-uniform1f                      :: proc (loc: GLUniformLocation, x: GLfloat) #foreign "gl" "uniform1f" ---
-uniform1i                      :: proc (loc: GLUniformLocation, x: GLint) #foreign "gl" "uniform1i" ---
-uniform2f                      :: proc (loc: GLUniformLocation, x: GLfloat, y: GLfloat) #foreign "gl" "uniform2f" ---
-uniform2i                      :: proc (loc: GLUniformLocation, x: GLint, y: GLint) #foreign "gl" "uniform2i" ---
-uniform3f                      :: proc (loc: GLUniformLocation, x: GLfloat, y: GLfloat, z: GLfloat) #foreign "gl" "uniform3f" ---
-uniform3i                      :: proc (loc: GLUniformLocation, x: GLint, y: GLint, z: GLint) #foreign "gl" "uniform3i" ---
-uniform4f                      :: proc (loc: GLUniformLocation, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) #foreign "gl" "uniform4f" ---
-uniform4i                      :: proc (loc: GLUniformLocation, x: GLint, y: GLint, z: GLint, w: GLint) #foreign "gl" "uniform4i" ---
-uniformMatrix2                 :: proc (loc: GLUniformLocation, transpose: GLboolean, value: GLMat2) #foreign "gl" "uniformMatrix2" ---
-uniformMatrix3                 :: proc (loc: GLUniformLocation, transpose: GLboolean, value: GLMat3) #foreign "gl" "uniformMatrix3" ---
-uniformMatrix4                 :: proc (loc: GLUniformLocation, transpose: GLboolean, value: GLMat4) #foreign "gl" "uniformMatrix4" ---
-useProgram                     :: proc (program: GLProgram) #foreign "gl" "useProgram" ---
-validateProgram                :: proc (program: GLProgram) #foreign "gl" "validateProgram" ---
-vertexAttrib1f                 :: proc (idx: GLuint, x: GLfloat) #foreign "gl" "vertexAttrib1f" ---
-vertexAttrib2f                 :: proc (idx: GLuint, x: GLfloat, y: GLfloat) #foreign "gl" "vertexAttrib2f" ---
-vertexAttrib3f                 :: proc (idx: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) #foreign "gl" "vertexAttrib3f" ---
-vertexAttrib4f                 :: proc (idx: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) #foreign "gl" "vertexAttrib4f" ---
-vertexAttribPointer            :: proc (idx: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLint) #foreign "gl" "vertexAttribPointer" ---
-vertexAttribDivisor            :: proc (idx: GLuint, divisor: GLuint) #foreign "gl" "vertexAttribDivisor" ---
-viewport                       :: proc (x: GLint, y: GLint, width: GLsizei, height: GLsizei) #foreign "gl" "viewport" ---      
+getProgramParameter            :: (program: GLProgram, pname: GLenum) -> GLenum #foreign "gl" "getProgramParameter" ---
+getShaderParameter             :: (shader: GLShader, pname: GLenum) -> GLenum #foreign "gl" "getShaderParameter" ---
+getUniformLocation             :: (program: GLProgram, name: str) -> GLUniformLocation #foreign "gl" "getUniformLocation" ---
+getVertexAttribOffset          :: (index: GLuint, pname: GLenum) -> void #foreign "gl" "getVertexAttribOffset" ---
+hint                           :: (target: GLenum, mode: GLenum) -> void #foreign "gl" "hint" ---
+init                           :: (canvasname: str) -> GLboolean #foreign "gl" "init" ---
+invalidateFramebuffer          :: (target: GLenum, attachments: str) -> void #foreign "gl" "invalidateFramebuffer" ---
+invalidateSubFramebuffer       :: (target: GLenum, attachments: str, x: GLint, y: GLint, width: GLsizei, height: GLsizei) -> void #foreign "gl" "invalidateSubFramebuffer" ---
+isEnabled                      :: (cap: GLenum) -> GLboolean #foreign "gl" "isEnabled" ---
+lineWidth                      :: (width: GLfloat) -> void #foreign "gl" "lineWidth" ---
+linkProgram                    :: (program: GLProgram) -> void #foreign "gl" "linkProgram" ---
+pixelStorei                    :: (pname: GLenum, param: GLenum) -> void #foreign "gl" "pixelStorei" ---
+polygonOffset                  :: (factor: GLfloat, units: GLfloat) -> void #foreign "gl" "polygonOffset" ---
+printProgramInfoLog            :: (program: GLProgram) -> void #foreign "gl" "printProgramInfoLog" ---
+printShaderInfoLog             :: (shader: GLShader) -> void #foreign "gl" "printShaderInfoLog" ---
+readBuffer                     :: (src: GLenum) -> void #foreign "gl" "readBuffer" ---
+readPixels                     :: (x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: str) -> void #foreign "gl" "readPixels" ---
+renderbufferStorageMultisample :: (target: GLenum, samples: GLsizei, internalforamt: GLenum, width: GLsizei, height: GLsizei) -> void #foreign "gl" "renderbufferStorageMultisample" ---
+sampleCoverage                 :: (value: GLclampf, invert: GLboolean) -> void #foreign "gl" "sampleCoverage" ---
+scissor                        :: (x: GLint, y: GLint, width: GLsizei, height: GLsizei) -> void #foreign "gl" "scissor" ---
+shaderSource                   :: (shader: GLShader, source: str) -> void #foreign "gl" "shaderSource" ---
+stencilFunc                    :: (func: GLenum, ref: GLint, mask: GLuint) -> void #foreign "gl" "stencilFunc" ---
+stencilFuncSeparate            :: (face: GLenum, func: GLenum, ref: GLint, mask: GLuint) -> void #foreign "gl" "stencilFuncSeparate" ---
+stencilMask                    :: (mask: GLuint) -> void #foreign "gl" "stencilMask" ---
+stencilMaskSeparate            :: (face: GLenum, mask: GLenum) -> void #foreign "gl" "stencilMaskSeparate" ---
+stencilOp                      :: (fail: GLenum, zfail: GLenum, zpass: GLenum) -> void #foreign "gl" "stencilOp" ---
+stencilOpSeparate              :: (face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) -> void #foreign "gl" "stencilOpSeparate" ---
+texImage2D                     :: (target: GLenum, level: GLint, internalFormat: GLenum, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: str) -> void #foreign "gl" "texImage2D" ---
+texParameterf                  :: (target: GLenum, pname: GLenum, param: GLfloat) -> void #foreign "gl" "texParameterf" ---
+texParameteri                  :: (target: GLenum, pname: GLenum, param: GLint) -> void #foreign "gl" "texParameteri" ---
+texSubImage2D                  :: (target: GLenum, level: GLint, xoff: GLint, yoff: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: str) -> void #foreign "gl" "texSubImage2D" ---
+uniform1f                      :: (loc: GLUniformLocation, x: GLfloat) -> void #foreign "gl" "uniform1f" ---
+uniform1i                      :: (loc: GLUniformLocation, x: GLint) -> void #foreign "gl" "uniform1i" ---
+uniform2f                      :: (loc: GLUniformLocation, x: GLfloat, y: GLfloat) -> void #foreign "gl" "uniform2f" ---
+uniform2i                      :: (loc: GLUniformLocation, x: GLint, y: GLint) -> void #foreign "gl" "uniform2i" ---
+uniform3f                      :: (loc: GLUniformLocation, x: GLfloat, y: GLfloat, z: GLfloat) -> void #foreign "gl" "uniform3f" ---
+uniform3i                      :: (loc: GLUniformLocation, x: GLint, y: GLint, z: GLint) -> void #foreign "gl" "uniform3i" ---
+uniform4f                      :: (loc: GLUniformLocation, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) -> void #foreign "gl" "uniform4f" ---
+uniform4i                      :: (loc: GLUniformLocation, x: GLint, y: GLint, z: GLint, w: GLint) -> void #foreign "gl" "uniform4i" ---
+uniformMatrix2                 :: (loc: GLUniformLocation, transpose: GLboolean, value: GLMat2) -> void #foreign "gl" "uniformMatrix2" ---
+uniformMatrix3                 :: (loc: GLUniformLocation, transpose: GLboolean, value: GLMat3) -> void #foreign "gl" "uniformMatrix3" ---
+uniformMatrix4                 :: (loc: GLUniformLocation, transpose: GLboolean, value: GLMat4) -> void #foreign "gl" "uniformMatrix4" ---
+useProgram                     :: (program: GLProgram) -> void #foreign "gl" "useProgram" ---
+validateProgram                :: (program: GLProgram) -> void #foreign "gl" "validateProgram" ---
+vertexAttrib1f                 :: (idx: GLuint, x: GLfloat) -> void #foreign "gl" "vertexAttrib1f" ---
+vertexAttrib2f                 :: (idx: GLuint, x: GLfloat, y: GLfloat) -> void #foreign "gl" "vertexAttrib2f" ---
+vertexAttrib3f                 :: (idx: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) -> void #foreign "gl" "vertexAttrib3f" ---
+vertexAttrib4f                 :: (idx: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) -> void #foreign "gl" "vertexAttrib4f" ---
+vertexAttribPointer            :: (idx: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLint) -> void #foreign "gl" "vertexAttribPointer" ---
+vertexAttribDivisor            :: (idx: GLuint, divisor: GLuint) -> void #foreign "gl" "vertexAttribDivisor" ---
+viewport                       :: (x: GLint, y: GLint, width: GLsizei, height: GLsizei) -> void #foreign "gl" "viewport" ---      
index 8656ca78f44b03d07c8cd2899fd27ebef4a00e6f..f3e143dad4f34d9b53afdda11f1b5c7520459dcf 100644 (file)
@@ -18,13 +18,13 @@ MapEntry :: struct (K: type_expr, V: type_expr) {
     value : V;
 }
 
-make :: proc ($Key: type_expr, $Value: type_expr, default: Value = 0, hash_count: i32 = 16) -> Map(Key, Value) {
+make :: ($Key: type_expr, $Value: type_expr, default: Value = 0, hash_count: i32 = 16) -> Map(Key, Value) {
     map : Map(Key, Value);
     init(^map, default = default, hash_count = hash_count);
     return map;
 }
 
-init :: proc (use map: ^Map($K, $V), default: V = ~~0, hash_count: i32 = 16) {
+init :: (use map: ^Map($K, $V), default: V = ~~0, hash_count: i32 = 16) {
     array.init(^hashes, hash_count);
     array.init(^entries, 4);
 
@@ -33,12 +33,12 @@ init :: proc (use map: ^Map($K, $V), default: V = ~~0, hash_count: i32 = 16) {
     for i: 0 .. hash_count do array.push(^hashes, -1);
 }
 
-free :: proc (use map: ^Map($K, $V)) {
+free :: (use map: ^Map($K, $V)) {
     array.free(^hashes);
     array.free(^entries);
 }
 
-put :: proc (use map: ^Map($K, $V), key: K, value: V) {
+put :: (use map: ^Map($K, $V), key: K, value: V) {
     lr := lookup(map, key);
 
     if lr.entry_index >= 0 {
@@ -56,19 +56,19 @@ put :: proc (use map: ^Map($K, $V), key: K, value: V) {
     hashes[lr.hash_index] = entries.count - 1;
 }
 
-has :: proc (use map: ^Map($K, $V), key: K) -> bool {
+has :: (use map: ^Map($K, $V), key: K) -> bool {
     lr := lookup(map, key);
     return lr.entry_index >= 0;
 }
 
-get :: proc (use map: ^Map($K, $V), key: K) -> V {
+get :: (use map: ^Map($K, $V), key: K) -> V {
     lr := lookup(map, key);
     if lr.entry_index >= 0 do return entries[lr.entry_index].value;
 
     return default_value;
 }
 
-delete :: proc (use map: ^Map($K, $V), key: K) {
+delete :: (use map: ^Map($K, $V), key: K) {
     lr := lookup(map, key);
     if lr.entry_index < 0 do return;
 
@@ -86,38 +86,39 @@ delete :: proc (use map: ^Map($K, $V), key: K) {
     else                       do hashes[last.hash_index] = lr.entry_index;
 }
 
-update :: proc (use map: ^Map($K, $V), key: K, f: proc (^V)) {
+update :: (use map: ^Map($K, $V), key: K, f: (^V) -> void) {
     lr := lookup(map, key);
     if lr.entry_index < 0 do return;
 
     f(^entries[lr.entry_index].value);
 }
 
-clear :: proc (use map: ^Map($K, $V)) {
+clear :: (use map: ^Map($K, $V)) {
     for i: 0 .. hashes.count do hashes.data[i] = -1;
     entries.count = 0;
 }
 
-empty :: proc (use map: ^Map($K, $V)) -> bool {
+empty :: (use map: ^Map($K, $V)) -> bool {
     return entries.count == 0;
 }
 
 hash_function :: proc {
-    proc (key: rawptr) -> u32 { return 0xcbf29ce7 ^ cast(u32) key; },
-    proc (key: i32) -> u32 { return 0xcbf29ce7 ^ cast(u32) key; },
-    proc (key: i64) -> u32 { return cast(u32) (cast(u64) 0xcbf29ce7 ^ cast(u64) key); },
+    (key: rawptr) -> u32 { return 0xcbf29ce7 ^ cast(u32) key; },
+    (key: i32) -> u32 { return 0xcbf29ce7 ^ cast(u32) key; },
+    (key: i64) -> u32 { return cast(u32) (cast(u64) 0xcbf29ce7 ^ cast(u64) key); },
 
-    proc (key: str) -> u32 {
+    (key: str) -> u32 {
         hash: u32 = 5381;
         for ch: key do hash += (hash << 5) + ~~ch;
         return hash;
     },
 }
 
+// CLEANUP: This could be replaced with operator overloading of '=='
 cmp_function :: proc {
-    proc (a: rawptr, b: rawptr) -> bool { return a == b; },
-    proc (a: i32, b: i32) -> bool       { return a == b; },
-    proc (a: i64, b: i64) -> bool       { return a == b; },
+    (a: rawptr, b: rawptr) -> bool { return a == b; },
+    (a: i32, b: i32) -> bool       { return a == b; },
+    (a: i64, b: i64) -> bool       { return a == b; },
 
     string.equal,
 }
@@ -134,7 +135,7 @@ MapLookupResult :: struct {
 }
 
 #private_file
-lookup :: proc (use map: ^Map($K, $V), key: K) -> MapLookupResult {
+lookup :: (use map: ^Map($K, $V), key: K) -> MapLookupResult {
     lr := MapLookupResult.{};
 
     hash: u32 = hash_function(key); // You cannot use this type for the key, unless you add an overload.
index c205fe87a552812ad22bb85b7e23a2843c20ed9d..f77e60eabb7f0dc448beb361d1b2f846ae08f682 100644 (file)
@@ -11,7 +11,7 @@ PI  :: 3.14159265f;
 TAU :: 6.28318330f;
 
 // Simple taylor series approximation of sin(t)
-sin :: proc (t_: f32) -> f32 {
+sin :: (t_: f32) -> f32 {
     t := t_;
     while t >=  PI do t -= TAU;
     while t <= -PI do t += TAU;
@@ -34,7 +34,7 @@ sin :: proc (t_: f32) -> f32 {
 }
 
 // Simple taylor series approximation of cos(t)
-cos :: proc (t_: f32) -> f32 {
+cos :: (t_: f32) -> f32 {
     t := t_;
     while t >=  PI do t -= TAU;
     while t <= -PI do t += TAU;
@@ -55,33 +55,33 @@ cos :: proc (t_: f32) -> f32 {
     return res;
 }
 
-max :: proc (a: $T, b: T) -> T {
+max :: (a: $T, b: T) -> T {
     if a >= b do return a;
     return b;
 }
 
-min :: proc (a: $T, b: T) -> T {
+min :: (a: $T, b: T) -> T {
     if a <= b do return a;
     return b;
 }
 
-sqrt_i32 :: proc (x: i32) -> i32 do return ~~sqrt_f32(~~x);
-sqrt_i64 :: proc (x: i64) -> i64 do return ~~sqrt_f64(~~x);
+sqrt_i32 :: (x: i32) -> i32 do return ~~sqrt_f32(~~x);
+sqrt_i64 :: (x: i64) -> i64 do return ~~sqrt_f64(~~x);
 sqrt :: proc { sqrt_f32, sqrt_f64, sqrt_i32, sqrt_i64 }
 
 copysign :: proc { copysign_f32, copysign_f64 }
 
-abs_i32 :: proc (x: i32) -> i32 {
+abs_i32 :: (x: i32) -> i32 {
     if x >= 0 do return x;
     return -x;
 }
-abs_i64 :: proc (x: i64) -> i64 {
+abs_i64 :: (x: i64) -> i64 {
     if x >= 0 do return x;
     return -x;
 }
 abs :: proc { abs_i32, abs_i64, abs_f32, abs_f64 }
 
-pow_int :: proc (base: $T, p: i32) -> T {
+pow_int :: (base: $T, p: i32) -> T {
     if base == 0 do return 0;
     if p == 0    do return 1;
 
@@ -95,7 +95,7 @@ pow_int :: proc (base: $T, p: i32) -> T {
     return a;
 }
 
-pow_float :: proc (base: $T, p: T) -> T {
+pow_float :: (base: $T, p: T) -> T {
     if p == 0 do return 1;
     if p < 0  do return 1 / pow_float(base, -p);
 
@@ -129,12 +129,12 @@ pow_float :: proc (base: $T, p: T) -> T {
 }
 
 pow :: proc { pow_int, pow_float }
-exp :: proc (p: $T) -> T do return pow(base = cast(T) E, p = p);
+exp :: (p: $T) -> T do return pow(base = cast(T) E, p = p);
 
-ln :: proc (a: f32) -> f32 {
+ln :: (a: f32) -> f32 {
 
 }
 
-log :: proc (a: $T, b: $R) ->T {
+log :: (a: $T, b: $R) ->T {
 
 }
index cfa5eb5b9a56187b20b759f4684b7d328f8cf267..3ec079524c09252c3eab6975ffe0b4eafe455696 100644 (file)
@@ -1,22 +1,22 @@
 package core.memory
 
-copy :: proc (dst_: rawptr, src_: rawptr, len: u32) {
+copy :: (dst_: rawptr, src_: rawptr, len: u32) {
     dst := cast(^u8) dst_;
     src := cast(^u8) src_;
     for i: 0 .. len do dst[i] = src[i];
 }
 
-set :: proc (start: rawptr, length: u32, value: u8) {
+set :: (start: rawptr, length: u32, value: u8) {
     s := cast(^u8) start;
     for i: 0 .. length do s[i] = value;
 }
 
-alloc_slice :: proc (sl: ^[] $T, count: i32, allocator := context.allocator) {
+alloc_slice :: (sl: ^[] $T, count: i32, allocator := context.allocator) {
     sl.data  = raw_alloc(allocator, sizeof T * count);
     sl.count = count;
 }
 
-make_slice :: proc ($T: type_expr, count: i32, allocator := context.allocator) -> [] T {
+make_slice :: ($T: type_expr, count: i32, allocator := context.allocator) -> [] T {
     return <[] T>.{
         data = raw_alloc(allocator, sizeof T * count),
         count = count
index 41a17c510a98573998ffe6487fe831986846fea8..979948082c0af34591c47f5b135d6c9a7f3557da 100644 (file)
@@ -6,15 +6,15 @@ package core.random
 #private_file RANDOM_INCREMENT  :: 1013904223
 // #private_file RANDOM_MODULUS    :: 1 << 32
 
-set_seed :: proc (s: u32) do seed = s;
+set_seed :: (s: u32) do seed = s;
 
-int :: proc (s := ^seed) -> u32 {
+int :: (s := ^seed) -> u32 {
     *s = *s * RANDOM_MULTIPLIER + RANDOM_INCREMENT;
     return *s;
 }
 
-between :: proc (lo: i32, hi: i32) -> i32 do return int () % (hi + 1 - lo) + lo;
+between :: (lo: i32, hi: i32) -> i32 do return int () % (hi + 1 - lo) + lo;
 
-float :: proc (lo := 0.0f, hi := 1.0f) -> f32 {
+float :: (lo := 0.0f, hi := 1.0f) -> f32 {
     return (cast(f32) (int() % (1 << 20)) / cast(f32) (1 << 20)) * (hi - lo) + lo;
 }
index c0a235e77ad71b8de94e2b5a770f286418a3766b..39f0c4318bd65d9f336b88b8efca2e422c0ef049 100644 (file)
@@ -14,34 +14,34 @@ use package system as system
 #private_file print_stream : io.DynamicStringStream;
 #private_file print_writer : io.Writer;
 
-stdio_init :: proc () {
+stdio_init :: () {
     print_stream = io.dynamic_string_stream_make(2048, context.allocator);
     print_writer = io.writer_make(^print_stream);
 }
 
 print :: proc {
-    proc (x: str) {
+    (x: str) {
         io.write(^print_writer, x);
         if x[x.count - 1] == #char "\n" do print_stream_flush();
     },
 
-    proc (x: $T)        { io.write(^print_writer, x); },
-    proc (x: $T, y: $R) { io.write(^print_writer, x, y); },
+    (x: $T)        { io.write(^print_writer, x); },
+    (x: $T, y: $R) { io.write(^print_writer, x, y); },
 }
 
-println :: proc (x: $T) {
+println :: (x: $T) {
     print(x);
     print("\n");
 }
 
-printf :: proc (format: str, va: ...) {
+printf :: (format: str, va: ...) {
     buffer: [2048] u8;
     print(conv.str_format_va(format, buffer[0 .. 2048], va));
 }
 
 // This works on both slices and arrays
 print_array :: proc {
-    proc (arr: [$N] $T, sep := " ") {
+    (arr: [$N] $T, sep := " ") {
         for i: 0 .. N {
             print(arr[i]);
             if i != N - 1 do print(sep);
@@ -50,7 +50,7 @@ print_array :: proc {
         print("\n");
     },
 
-    proc (arr: $T, sep := " ") {
+    (arr: $T, sep := " ") {
         for i: 0 .. arr.count {
             print(arr.data[i]);
             if i != arr.count - 1 do print(sep);
@@ -60,7 +60,7 @@ print_array :: proc {
     }
 }
 
-print_stream_flush :: proc () {
+print_stream_flush :: () {
     if print_stream.data.count == 0 do return;
 
     ^print_stream
index 9f70b6fb41212af127346e51e4a524c7a7e98e73..ffbde7f3bf8a4a1665b7e8a643884eeb8f356c5d 100644 (file)
@@ -1,13 +1,13 @@
 package core.string
 
-make :: proc (s: cstr) -> str {
+make :: (s: cstr) -> str {
     len := length(s);
 
     return str.{ count = len, data = s };
 }
 
 length :: proc {
-    proc (s: cstr) -> u32 {
+    (s: cstr) -> u32 {
         len := 0;
         c := s;
         while *c != #char "\0" {
@@ -18,12 +18,12 @@ length :: proc {
         return len;
     },
 
-    proc (s: str) -> u32 {
+    (s: str) -> u32 {
         return s.count;
     },
 }
 
-alloc_copy :: proc (orig: str) -> str {
+alloc_copy :: (orig: str) -> str {
     new_str : str;
     new_str.data = calloc(sizeof u8 * orig.count);
     new_str.count = orig.count;
@@ -31,14 +31,14 @@ alloc_copy :: proc (orig: str) -> str {
     return new_str;
 }
 
-copy :: proc (orig: str, dest: str) {
+copy :: (orig: str, dest: str) {
     len := orig.count;
     if dest.count < len do len = dest.count;
 
     for i: 0 .. len do dest.data[i] = orig.data[i];
 }
 
-concat :: proc (s1: str, s2: str) -> str {
+concat :: (s1: str, s2: str) -> str {
     len1 := length(s1);
     len2 := length(s2);
 
@@ -49,12 +49,12 @@ concat :: proc (s1: str, s2: str) -> str {
     return str.{ data, len1 + len2 };
 }
 
-free :: proc (s: str) do cfree(s.data);
+free :: (s: str) do cfree(s.data);
 
 // This is an example doc str
 // You can have as many comments as you want
 // It documents the split function
-split :: proc (s: str, delim: u8) -> []str {
+split :: (s: str, delim: u8) -> []str {
     delim_count := 0;
     for i: 0 .. s.count do if s[i] == delim do delim_count += 1;
 
@@ -88,14 +88,14 @@ split :: proc (s: str, delim: u8) -> []str {
 //     return str.data[0 .. 0];
 // }
 
-contains :: proc (s: str, c: u8) -> bool {
+contains :: (s: str, c: u8) -> bool {
     for ch: s do if ch == c do return true;
     return false;
 }
 
-// TODO: Check this proc for edge cases and other bugs. I'm not confident
+// TODO: Check this for edge cases and other bugs. I'm not confident
 // it will work perfectly yet.                   - brendanfh 2020/12/21
-compare :: proc (str1: str, str2: str) -> i32 {
+compare :: (str1: str, str2: str) -> i32 {
     i := 0;
     while i < str1.count && i < str2.count && str1[i] == str2[i] do i += 1;
 
@@ -103,7 +103,7 @@ compare :: proc (str1: str, str2: str) -> i32 {
     return ~~(str1[i] - str2[i]);
 }
 
-equal :: proc (str1: str, str2: str) -> bool #operator== {
+equal :: (str1: str, str2: str) -> bool #operator== {
     if str1.count != str2.count do return false;
     while i := 0; i < str1.count {
         if str1[i] != str2[i] do return false;
@@ -112,7 +112,7 @@ equal :: proc (str1: str, str2: str) -> bool #operator== {
     return true;
 }
 
-starts_with :: proc (str1: str, str2: str) -> bool {
+starts_with :: (str1: str, str2: str) -> bool {
     if str1.count < str2.count do return false;
     while i := 0; i < str2.count {
         if str1[i] != str2[i] do return false;
@@ -121,7 +121,7 @@ starts_with :: proc (str1: str, str2: str) -> bool {
     return true;
 }
 
-strip_leading_whitespace :: proc (s: ^str) {
+strip_leading_whitespace :: (s: ^str) {
     while true do switch s.data[0] {
         case #char " ", #char "\t", #char "\n", #char "\r" {
             s.data += 1;
@@ -132,7 +132,7 @@ strip_leading_whitespace :: proc (s: ^str) {
     }
 }
 
-strip_trailing_whitespace :: proc (s: ^str) {
+strip_trailing_whitespace :: (s: ^str) {
     while true do switch s.data[s.count - 1] {
         case #char " ", #char "\t", #char "\n", #char "\r" {
             s.count -= 1;
@@ -143,7 +143,7 @@ strip_trailing_whitespace :: proc (s: ^str) {
 }
 
 
-read_u32 :: proc (s: ^str, out: ^u32) {
+read_u32 :: (s: ^str, out: ^u32) {
     n := 0;
 
     strip_leading_whitespace(s);
@@ -158,26 +158,26 @@ read_u32 :: proc (s: ^str, out: ^u32) {
     *out = n;
 }
 
-read_char :: proc (s: ^str, out: ^u8) {
+read_char :: (s: ^str, out: ^u8) {
     *out = s.data[0];
     s.data += 1;
     s.count -= 1;
 }
 
-read_chars :: proc (s: ^str, out: ^str, char_count := 1) {
+read_chars :: (s: ^str, out: ^str, char_count := 1) {
     out.data = s.data;
     out.count = char_count;
     s.data += char_count;
     s.count -= char_count;
 }
 
-discard_chars :: proc (s: ^str, char_count := 1) {
+discard_chars :: (s: ^str, char_count := 1) {
     s.data += char_count;
     s.count -= char_count;
 }
 
 // Goes up to but not including the closest newline or EOF
-read_line :: proc (s: ^str, out: ^str) {
+read_line :: (s: ^str, out: ^str) {
     out.data = s.data;
     out.count = 0;
 
@@ -195,7 +195,7 @@ read_line :: proc (s: ^str, out: ^str) {
     }
 }
 
-read_until :: proc (s: ^str, upto: u8, skip := 0) -> str {
+read_until :: (s: ^str, upto: u8, skip := 0) -> str {
     if s.count == 0 do return "";
 
     out : str;
@@ -218,7 +218,7 @@ read_until :: proc (s: ^str, upto: u8, skip := 0) -> str {
     return out;
 }
 
-read_until_either :: proc (s: ^str, skip: u32, uptos: ..u8) -> str {
+read_until_either :: (s: ^str, skip: u32, uptos: ..u8) -> str {
     if s.count == 0 do return "";
 
     out : str;
@@ -243,7 +243,7 @@ read_until_either :: proc (s: ^str, skip: u32, uptos: ..u8) -> str {
     return out;
 }
 
-advance_line :: proc (s: ^str) {
+advance_line :: (s: ^str) {
     if s.count == 0 do return;
 
     adv := 0;
index 35957198b8f3fe91ca9065475ec059d45612d571..f9b223c99978d794233fdbc43076e38047ed301a 100644 (file)
@@ -3,9 +3,9 @@ package system
 use package core
 use package main as main
 
-output_str :: proc (s: str) -> u32 #foreign "host" "print_str" ---
+output_str :: (s: str) -> u32 #foreign "host" "print_str" ---
 
-assert_handler :: proc (msg: str, file: str) {
+assert_handler :: (msg: str, file: str) {
     output_str("Assert failed: ");
     output_str(msg);
 
index 80ad80ce657b56c335afdaa4ff45c8e861414625..6fc9122d9d14a783066d48be3c15845aa5fc10fa 100644 (file)
@@ -8,7 +8,7 @@ use package main as main
 
 STDOUT_FILENO :: 1
 
-output_str :: proc (s: str) -> u32 {
+output_str :: (s: str) -> u32 {
     vec := IOVec.{ buf = cast(u32) s.data, len = s.count };
     tmp : Size;
     fd_write(STDOUT_FILENO, IOVecArray.{ cast(u32) ^vec, 1 }, ^tmp);
@@ -16,7 +16,7 @@ output_str :: proc (s: str) -> u32 {
     return tmp;
 }
 
-assert_handler :: proc (msg: str, file: str) {
+assert_handler :: (msg: str, file: str) {
     output_str("Assert failed: ");
     output_str(msg);
 
index a52e980df6a5f940d6de92d3b84cfcc6fc2b9739..1383f60d9c28ed7d20e0b3334d0b669664d55ccc 100644 (file)
@@ -364,44 +364,43 @@ IOVecArray :: struct {
 
 
 // FUNCTIONS
-args_get       :: proc (argv: ^^u8, argv_buf: ^u8) -> Errno #foreign "wasi_unstable" "args_get"---
-args_sizes_get :: proc (argc: ^Size, argv_buf_size: ^Size) -> Errno #foreign "wasi_unstable" "args_sizes_get" ---
-
-environ_get       :: proc (environ: ^^u8, environ_buf: ^u8) -> Errno #foreign "wasi_unstable" "environ_get" ---
-environ_sizes_get :: proc (environc: ^Size, environ_buf_size: ^Size) -> Errno #foreign "wasi_unstable" "environ_sizes_get" ---
-
-clock_res_get  :: proc (id: ClockID, resolution: ^Timestamp) -> Errno #foreign "wasi_unstable" "clock_res_get" ---
-clock_time_get :: proc (id: ClockID, precision: Timestamp, time: ^Timestamp) -> Errno #foreign "wasi_unstable" "clock_time_get" ---
-
-fd_advise             :: proc (fd: FileDescriptor, offset: Filesize, len: Filesize, advice: Advice) -> Errno #foreign "wasi_unstable" "fd_advise" ---
-fd_allocate           :: proc (fd: FileDescriptor, offset: Filesize, len: Filesize) -> Errno #foreign "wasi_unstable" "fd_allocate" ---
-fd_close              :: proc (fd: FileDescriptor) -> Errno #foreign "wasi_unstable" "fd_close" ---
-fd_datasync           :: proc (fd: FileDescriptor) -> Errno #foreign "wasi_unstable" "fd_datasync" ---
-fd_fdstat_get         :: proc (fd: FileDescriptor, stat: ^FDStat) -> Errno #foreign "wasi_unstable" "fd_fdstat_get" ---
-fd_fdstat_set_flags   :: proc (fd: FileDescriptor, flags: FDFlags) -> Errno #foreign "wasi_unstable" "fd_fdstat_set_flags" ---
-fd_fdstat_set_rights  :: proc (fd: FileDescriptor, rights_base: Rights, rights_inheriting: Rights) -> Errno #foreign "wasi_unstable" "fd_fdstat_set_rights" ---
-fd_filestat_get       :: proc (fd: FileDescriptor, buf: ^FileStat) -> Errno #foreign "wasi_unstable" "fd_filestat_get" ---
-fd_filestat_set_size  :: proc (fd: FileDescriptor, size: Filesize) -> Errno #foreign "wasi_unstable" "fd_filestat_set_size" ---
-fd_filestat_set_times :: proc (fd: FileDescriptor, atim: Timestamp, mtim: Timestamp, fst_flags: FSTFlags) -> Errno #foreign "wasi_unstable" "fd_filestat_set_times" ---
-fd_pread              :: proc (fd: FileDescriptor, iovs: IOVecArray, offset: Filesize, nread: ^Size) -> Errno #foreign "wasi_unstable" "fd_pread" ---
-fd_prestat_get        :: proc (fd: FileDescriptor, buf: ^PrestatTagged) -> Errno #foreign "wasi_unstable" "fd_prestat_get" ---
-fd_prestat_dir_name   :: proc (fd: FileDescriptor, path: str) -> Errno #foreign "wasi_unstable" "fd_prestat_dir_name" ---
-fd_pwrite             :: proc (fd: FileDescriptor, iovs: IOVecArray, offset: Filesize, nwritten: ^Size) -> Errno #foreign "wasi_unstable" "fd_pwrite" ---
-fd_read               :: proc (fd: FileDescriptor, iovs: IOVecArray, nread: ^Size) -> Errno #foreign "wasi_unstable" "fd_read" ---
-fd_readdir            :: proc (fd: FileDescriptor, buf: ^u8, buf_len: Size, cookie: DirCookie, bufused: ^Size) -> Errno #foreign "wasi_unstable" "fd_readdir" ---
-fd_renumber           :: proc (fd: FileDescriptor, to: FileDescriptor) -> Errno #foreign "wasi_unstable" "fd_renumber" ---
-fd_seek               :: proc (fd: FileDescriptor, offset: FileDelta, whence: Whence, newoffset: ^Filesize) -> Errno #foreign "wasi_unstable" "fd_seek" ---
-fd_sync               :: proc (fd: FileDescriptor) -> Errno #foreign "wasi_unstable" "fd_sync" ---
-fd_tell               :: proc (fd: FileDescriptor, offset: ^Filesize) -> Errno #foreign "wasi_unstable" "fd_tell" ---
-fd_write              :: proc (fd: FileDescriptor, iovs: IOVecArray, nwritten: ^Size) -> Errno #foreign "wasi_unstable" "fd_write" ---
-
-path_create_directory   :: proc (fd: FileDescriptor, path: str) -> Errno #foreign "wasi_unstable" "path_create_directory" ---
-path_filestat_get       :: proc (fd: FileDescriptor, flags: LookupFlags, path: str, buf: ^FileStat) -> Errno #foreign "wasi_unstable" "path_filestat_get" ---
-path_filestat_set_times :: proc (fd: FileDescriptor, flags: LookupFlags, path: str, atim: Timestamp, mtim: Timestamp, fst_flags: FSTFlags) -> Errno #foreign "wasi_unstable" "path_filestat_set_times" ---
-
-path_link :: proc (fd: FileDescriptor, old_flags: LookupFlags, old_path: str, new_fd: FileDescriptor, new_path: str) -> Errno #foreign "wasi_unstable" "path_link" ---
-path_open :: proc
-    ( fd: FileDescriptor
+args_get       :: (argv: ^^u8, argv_buf: ^u8) -> Errno #foreign "wasi_unstable" "args_get"---
+args_sizes_get :: (argc: ^Size, argv_buf_size: ^Size) -> Errno #foreign "wasi_unstable" "args_sizes_get" ---
+
+environ_get       :: (environ: ^^u8, environ_buf: ^u8) -> Errno #foreign "wasi_unstable" "environ_get" ---
+environ_sizes_get :: (environc: ^Size, environ_buf_size: ^Size) -> Errno #foreign "wasi_unstable" "environ_sizes_get" ---
+
+clock_res_get  :: (id: ClockID, resolution: ^Timestamp) -> Errno #foreign "wasi_unstable" "clock_res_get" ---
+clock_time_get :: (id: ClockID, precision: Timestamp, time: ^Timestamp) -> Errno #foreign "wasi_unstable" "clock_time_get" ---
+
+fd_advise             :: (fd: FileDescriptor, offset: Filesize, len: Filesize, advice: Advice) -> Errno #foreign "wasi_unstable" "fd_advise" ---
+fd_allocate           :: (fd: FileDescriptor, offset: Filesize, len: Filesize) -> Errno #foreign "wasi_unstable" "fd_allocate" ---
+fd_close              :: (fd: FileDescriptor) -> Errno #foreign "wasi_unstable" "fd_close" ---
+fd_datasync           :: (fd: FileDescriptor) -> Errno #foreign "wasi_unstable" "fd_datasync" ---
+fd_fdstat_get         :: (fd: FileDescriptor, stat: ^FDStat) -> Errno #foreign "wasi_unstable" "fd_fdstat_get" ---
+fd_fdstat_set_flags   :: (fd: FileDescriptor, flags: FDFlags) -> Errno #foreign "wasi_unstable" "fd_fdstat_set_flags" ---
+fd_fdstat_set_rights  :: (fd: FileDescriptor, rights_base: Rights, rights_inheriting: Rights) -> Errno #foreign "wasi_unstable" "fd_fdstat_set_rights" ---
+fd_filestat_get       :: (fd: FileDescriptor, buf: ^FileStat) -> Errno #foreign "wasi_unstable" "fd_filestat_get" ---
+fd_filestat_set_size  :: (fd: FileDescriptor, size: Filesize) -> Errno #foreign "wasi_unstable" "fd_filestat_set_size" ---
+fd_filestat_set_times :: (fd: FileDescriptor, atim: Timestamp, mtim: Timestamp, fst_flags: FSTFlags) -> Errno #foreign "wasi_unstable" "fd_filestat_set_times" ---
+fd_pread              :: (fd: FileDescriptor, iovs: IOVecArray, offset: Filesize, nread: ^Size) -> Errno #foreign "wasi_unstable" "fd_pread" ---
+fd_prestat_get        :: (fd: FileDescriptor, buf: ^PrestatTagged) -> Errno #foreign "wasi_unstable" "fd_prestat_get" ---
+fd_prestat_dir_name   :: (fd: FileDescriptor, path: str) -> Errno #foreign "wasi_unstable" "fd_prestat_dir_name" ---
+fd_pwrite             :: (fd: FileDescriptor, iovs: IOVecArray, offset: Filesize, nwritten: ^Size) -> Errno #foreign "wasi_unstable" "fd_pwrite" ---
+fd_read               :: (fd: FileDescriptor, iovs: IOVecArray, nread: ^Size) -> Errno #foreign "wasi_unstable" "fd_read" ---
+fd_readdir            :: (fd: FileDescriptor, buf: ^u8, buf_len: Size, cookie: DirCookie, bufused: ^Size) -> Errno #foreign "wasi_unstable" "fd_readdir" ---
+fd_renumber           :: (fd: FileDescriptor, to: FileDescriptor) -> Errno #foreign "wasi_unstable" "fd_renumber" ---
+fd_seek               :: (fd: FileDescriptor, offset: FileDelta, whence: Whence, newoffset: ^Filesize) -> Errno #foreign "wasi_unstable" "fd_seek" ---
+fd_sync               :: (fd: FileDescriptor) -> Errno #foreign "wasi_unstable" "fd_sync" ---
+fd_tell               :: (fd: FileDescriptor, offset: ^Filesize) -> Errno #foreign "wasi_unstable" "fd_tell" ---
+fd_write              :: (fd: FileDescriptor, iovs: IOVecArray, nwritten: ^Size) -> Errno #foreign "wasi_unstable" "fd_write" ---
+
+path_create_directory   :: (fd: FileDescriptor, path: str) -> Errno #foreign "wasi_unstable" "path_create_directory" ---
+path_filestat_get       :: (fd: FileDescriptor, flags: LookupFlags, path: str, buf: ^FileStat) -> Errno #foreign "wasi_unstable" "path_filestat_get" ---
+path_filestat_set_times :: (fd: FileDescriptor, flags: LookupFlags, path: str, atim: Timestamp, mtim: Timestamp, fst_flags: FSTFlags) -> Errno #foreign "wasi_unstable" "path_filestat_set_times" ---
+
+path_link :: (fd: FileDescriptor, old_flags: LookupFlags, old_path: str, new_fd: FileDescriptor, new_path: str) -> Errno #foreign "wasi_unstable" "path_link" ---
+path_open :: (fd: FileDescriptor
     , dirflags: LookupFlags
     , path: str
     , oflags: OFlags
@@ -412,24 +411,24 @@ path_open :: proc
     ) -> Errno
      #foreign "wasi_unstable" "path_open" ---
 
-path_readlink :: proc (fd: FileDescriptor, path: str, buf: ^u8, buf_len: Size, bufused: ^Size) -> Errno #foreign "wasi_unstable" "path_readlink" ---
-path_remove_directory :: proc (fd: FileDescriptor, path: str) -> Errno #foreign "wasi_unstable" "path_remove_directory" ---
-path_rename  :: proc (fd: FileDescriptor, old_path: str, new_fd: FileDescriptor, new_path: str) -> Errno #foreign "wasi_unstable" "path_rename" ---
-path_symlink :: proc (old_path: ^u8, old_path_len: Size, fd: FileDescriptor, new_path: str) -> Errno #foreign "wasi_unstable" "path_symlink" ---
-path_unlink_file :: proc (fd: FileDescriptor, path: str) -> Errno #foreign "wasi_unstable" "path_unlink_file" ---
+path_readlink :: (fd: FileDescriptor, path: str, buf: ^u8, buf_len: Size, bufused: ^Size) -> Errno #foreign "wasi_unstable" "path_readlink" ---
+path_remove_directory :: (fd: FileDescriptor, path: str) -> Errno #foreign "wasi_unstable" "path_remove_directory" ---
+path_rename  :: (fd: FileDescriptor, old_path: str, new_fd: FileDescriptor, new_path: str) -> Errno #foreign "wasi_unstable" "path_rename" ---
+path_symlink :: (old_path: ^u8, old_path_len: Size, fd: FileDescriptor, new_path: str) -> Errno #foreign "wasi_unstable" "path_symlink" ---
+path_unlink_file :: (fd: FileDescriptor, path: str) -> Errno #foreign "wasi_unstable" "path_unlink_file" ---
 
-poll_oneoff :: proc (in: ^Subscription, out: ^Event, nsubscriptions: Size, nevents: ^Size) -> Errno #foreign "wasi_unstable" "poll_oneoff" ---
+poll_oneoff :: (in: ^Subscription, out: ^Event, nsubscriptions: Size, nevents: ^Size) -> Errno #foreign "wasi_unstable" "poll_oneoff" ---
 
-proc_exit  :: proc (rval: ExitCode) #foreign "wasi_unstable" "proc_exit" ---
-proc_raise :: proc (sig: Signal) -> Errno #foreign "wasi_unstable" "proc_raise" ---
+proc_exit  :: (rval: ExitCode) -> void #foreign "wasi_unstable" "proc_exit" ---
+proc_raise :: (sig: Signal) -> Errno #foreign "wasi_unstable" "proc_raise" ---
 
-sched_yield :: proc () -> Errno #foreign "wasi_unstable" "sched_yield" ---
+sched_yield :: () -> Errno #foreign "wasi_unstable" "sched_yield" ---
 
-random_get :: proc (buf: ^u8, buf_len: Size) -> Errno #foreign "wasi_unstable" "random_get" ---
+random_get :: (buf: ^u8, buf_len: Size) -> Errno #foreign "wasi_unstable" "random_get" ---
 
-sock_recv     :: proc (fd: FileDescriptor, ri_data: IOVecArray, ri_flags: RIFlags, ro_datalen: ^Size, ro_flags: ^ROFlags) -> Errno #foreign "wasi_unstable" "sock_recv" ---
-sock_send     :: proc (fd: FileDescriptor, si_data: IOVecArray, si_flags: SIFlags, so_datalen: ^Size) -> Errno #foreign "wasi_unstable" "sock_send" ---
-sock_shutdown :: proc (fd: FileDescriptor, how: SDFlags) -> Errno #foreign "wasi_unstable" "sock_shutdown" ---
+sock_recv     :: (fd: FileDescriptor, ri_data: IOVecArray, ri_flags: RIFlags, ro_datalen: ^Size, ro_flags: ^ROFlags) -> Errno #foreign "wasi_unstable" "sock_recv" ---
+sock_send     :: (fd: FileDescriptor, si_data: IOVecArray, si_flags: SIFlags, so_datalen: ^Size) -> Errno #foreign "wasi_unstable" "sock_send" ---
+sock_shutdown :: (fd: FileDescriptor, how: SDFlags) -> Errno #foreign "wasi_unstable" "sock_shutdown" ---
 
 
 
index 1b282cb343bc366d1f9fa8ebda304ce148b7450a..9bc84678b94c7d2ac180d8b3c5adac9d7b729a2a 100644 (file)
--- a/docs/bugs
+++ b/docs/bugs
@@ -1,110 +1 @@
-List of known bugs:
-
-[X] Using an auto-cast on an argument when calling an overloaded proc leads
-    to an unexpected error. Take the following example:
-    ```
-    overloaded :: proc {
-        proc (x: f32, y: str) ---,
-        proc (x: i32, y: i32) ---,
-    }
-
-    foo :: proc () {
-        x: i32 = 1234;
-        overloaded(~~x, 4);
-    }
-    ```
-    Compiles with the following error:
-    ```
-    (/home/brendan/dev/c/onyx/a.onyx:8,15) unable to match overloaded function with provided argument types: (f32, unsized int)
-    8 |     overloaded(~~x, 4);
-    ```
-
-    This is because in trying the first overload, the auto-cast is consumed
-    and converted to a cast(f32). Then, when it doesn't match the first one
-    and it tries the second, the parameter types are f32 and unsized int,
-    which is doesn't match the second one, when the original parameters would
-    have matched correctly.
-
-[X] `defer` statements are not executed at the end of a loop if the loop is
-    exited using a `break` statement, or a `continue` statement. The semantics
-    of this need to change because it is not expected behaviour. Also it would
-    prevent the usefulness of this pattern:
-    ```
-    while i := 0; i < 10 {
-        defer i += 1;
-        ...
-    }
-    ```
-    Since `continue`ing or `break`ing would skip the deferred statement, causing
-    an infinite loop.
-
-[X] The following code causes an infinite loop somewhere.
-    ``` 
-    get_neighbor_count :: proc (grid: ^map.Map(Vec2, Cell), pos: Vec2) -> u32 {
-        count := 0;
-
-        for ^dir: Hex_Directions {
-            pos  := Vec2.{ x = pos.x + dir.x, y = pos.y + dir.y };
-            cell := map.get(grid, pos, Cell.{});
-            if cell.alive do count += 1;
-        }
-
-        return count;
-    }
-    ```
-
-[X] Polymorphic structs do not recognize default values for members.
-
-[X] `use` on struct members does not work correctly if the type is a union.
-    ```
-    BadUnion :: struct {
-        use container : struct #union {
-            int: i32;
-            float: f32;
-        };
-    }
-
-    test :: proc () do print(sizeof BadUnion == 4);
-    ```
-
-[X] `use` on struct members breaks struct literals.
-    ```
-    Vec2   :: struct { x: i32; y: i32; }
-    Entity :: struct { use pos: Vec2; }
-
-    e := Entity.{ pos = Vec2.{ 1, 2 } };
-
-    // This does work already.
-    e2 := Entity.{ x = 1, y = 2 };
-    ```
-
-[X] `TileData :: [TILE_DATA_WIDTH * TILE_DATA_HEIGHT] bool;` results in a
-    segfault because it is an invalid top level node, but that is not checked
-    before it is tried to be used.
-
-[X] `TileData :: #type [TILE_DATA_WIDTH * TILE_DATA_HEIGHT] bool;` produces the
-    following error:
-    ```
-    (/home/brendan/dev/onyx/aoc/day20.onyx:25,19) Array type expects type 'i32' for size, got 'unsized int'.
-     25 | TileData :: #type [TILE_DATA_WIDTH * TILE_DATA_HEIGHT] bool;
-    ```
-
-    This because the expression for the array size is not reducing and getting
-    converted to the fixed size integer. I suspect this is because for sizeof
-    and alignof expression, `fill_in_type` is not used, and that function has
-    the logic to handle the array subscript reduction and type resolution.
-
-[X] The following struct is causing a seg fault in the compiler. I believe it
-    is because of the duplicate struct member names and failing to get the position
-    in the file to report the error.
-    ```
-    Tile :: struct {
-        id          : u32;
-        orientation : TileOrientation;
-        data        : [] bool;
-        edges       : [] u32;
-
-        pos_x       : u32 = 0;
-        pos_x       : u32 = 0;
-    }
-    ```
+List of known bugs:
\ No newline at end of file
diff --git a/docs/new_hash_plan b/docs/new_hash_plan
deleted file mode 100644 (file)
index cf70624..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-The state of the hash implementation right now:
-
-                (allocator + 1021 ptrs = 8192 bytes (HUGE))
-               +---------------------------------------------------------
-table ---->    | allocator | ptr | ptr | ptr | ptr | ptr | ptr | ptr ...
-               +-------------||------------------------------------------
-                             \/
-              +--------------+------------------------------------------------------
-              | Array header | key (64-bytes) | value | key (64-bytes) | value | ...
-              +--------------+------------------------------------------------------
-
-There are a couple of issues with this implementation:
-  * The table of pointers is absolutely huge.
-    It takes up about 2 pages of memory and we are randomly accessing it
-    so it will not be cache efficient.
-  * The keys are always the same size.
-    They are normally way too large, but also they would cut off if you
-    needed a large key.
-
-
-
-THIS WORKED VERY WELL!
-Attempt 1 to fix these issues:
-
-                (user defined number of ptrs)
-               +-----------------------------------------------------------
-table ---->    | allocator | hash size | ptr | ptr | ptr | ptr | ptr | ...
-               +-------------------------||--------------------------------
-                                         \/
-                          +--------------+------------------------------------------------------------------------
-                          | Array header | length | value | key_length | key (null terminated) | v | kl | k | ...
-                          +--------------+------------------------------------------------------------------------
-
-GOOD:
-  * This implementation would allow for any size of key.
-    Initial thoughts:
-      - Alignment is going to be very important.
-      - Alignment will need to be by hand.
-      - Aligning to 8 bytes should be sufficient.
-      - The array would just be considered as a u8 array, since each element
-        wouldn't be the same size.
-      - Random access into the array would not be allowed for the same reason.
-      - Random access will not be needed however.
-  * This implementation still allows for easy iterator traversal, which is
-    important for the immediate use case.
-
-BAD:
-  * The fact that the number of pointers is user defined, the hashing algorithm could
-    be drastically slowed / crippled if they choose a bad number of pointers.
-  * This implementation still takes a very large number of allocations.
index 5d0dc4795a18d21f209f8ed9e19746c8a77068d2..cdbeaf3b03567f1a0c22f3f130145f49f52d5939 100644 (file)
--- a/docs/todo
+++ b/docs/todo
@@ -12,7 +12,6 @@ Command Line Interface:
     [X] Remove old code from CLI logic
     [X] Add statistic printing
     [ ] Fix documentation generation (broken since compiler architecture change) 
-    [ ] Fix AST printing (broken for a long time)
     [ ] Add automated running component
         - Store to temporary file (OS independent)
         - Detect / choose WASM backend
@@ -145,8 +144,10 @@ API Expansion:
           it conflicts with 'builtin.string'. These two should be switched. Type
           name should be 'str' and package name should be 'string'
 
-    [ ] Expand capabilities of file api on WASI.
+    [X] Expand capabilities of file api on WASI.
+    [ ] Add file capabilities to JS backend
     [ ] Add clock / time api for both backends
+    [ ] Environment variables for both backends
     [ ] Better random number api
     [ ] Better string formatting and parsing api
 
index 571b3ad504bc0e0cacd0c3866d44368f2468748f..accfe9dda878c3f4a0eee706d7d8f3e766f7d53b 100644 (file)
@@ -51,7 +51,7 @@ use package core
 // end it simply calls main.main, which is this procedure. By convention, main takes a slice
 // of cstr's, which were the arguments passed from the command line. We will talk about
 // slices later.
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
 
     // This is the actual call to print, which will print the message 'Hello World!\n' onto the screen.
     // It is not too important to know how this works, but if you are interested you can find the
index f2f20ab56e26ee37e48f538d60be6479bd6a7e1a..e0a83a755ca9377a83386a4946a83541b2e0e28e 100644 (file)
@@ -5,7 +5,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
 
     // This is the syntax for declaring a local variable in a procedure.
     foo: i32;
index 6e709572a9c1a871e79fc26e87ffe2120c4bc325..fa45ac56f22342e4838d2d7f2ad0d8a04ae71421 100644 (file)
@@ -4,7 +4,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
     // Here is a list of all the builtin types:
     //       void
     //       bool
index aa516a16d2befc107aec12359730f4f287f3b651..91bcace7c0d802d63356c15ed77428d157f966b0 100644 (file)
@@ -19,7 +19,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
     // The following declares a fixed-size array of 10 i32s on the stack. Currently,
     // it is not guaranteed that `arr` will be zero initialized, so we will do that
     // with a for loop. Note, the `^` after the for keyword means we are iterating by
@@ -42,7 +42,7 @@ main :: proc (args: [] cstr) {
     // Fixed-size arrays are passed to procedures by reference. In the following example,
     // the array `arr` is passed by reference so when the for loop changes the
     // contents of `array_param`, the contents of `arr` are changed as well.
-    array_proc :: proc (array_param: [10] i32) {
+    array_proc :: (array_param: [10] i32) {
         for i: 0 .. 10 {
             array_param[i] = 1000 + i;
         }
index 182052dbd2e29b2d4fb77dbd7e521c9359297b5d..ac9ef0203b3acff31979bc223eab7b2534a5d0cc 100644 (file)
@@ -9,7 +9,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
     // A dummy array to demonstrate.
     arr := i32.[ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ];
 
index 5738d5ff72c8dab5c3c4c2b5a30be77f05b1a798..16b953867d15e90058fe31aa5441b19db98f323b 100644 (file)
@@ -11,7 +11,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
     // Declaring dynamic arrays in Onyx looks like this. The
     // '..' makes it a dynamic array, as opposed to a slice
     // or fixed size array.
index bacf8d67b0a03b95a10c4b6692a7cf952c3daac5..9e9d59a640d1e420e001bc338b81ad256cc64a41 100644 (file)
@@ -9,7 +9,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
 
     // This is the basic struct syntax. Members are declared just like
     // local variables in procedures.
@@ -20,7 +20,7 @@ main :: proc (args: [] cstr) {
     }
 
     // Structs can be passed by value to procedures.
-    print_person :: proc (person: Person) {
+    print_person :: (person: Person) {
         printf("Person(%s, %i, %i)\n", person.name, person.age, person.height);
     }
 
@@ -59,7 +59,7 @@ main :: proc (args: [] cstr) {
         y : f32 = 34;
     }
 
-    print_vector2f :: proc (vec: Vector2f) {
+    print_vector2f :: (vec: Vector2f) {
         printf("Vector2f(%f, %f)", vec.x, vec.y);
     }
 
index 64fbd39defc3fcae1b9cc4e4a54710ed7e58b2bb..fcee0f50fcaf025a595f56d089a504f33df93610 100644 (file)
@@ -5,7 +5,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
     // To declare a simple, use the enum keyword.
     SimpleEnum :: enum {
         Value1; Value2; Value3;
index 17d495d5f4161746b5fe890690c50b2add199df1..a8911705978e903ed2d2e14174b4cc770a40a4a9 100644 (file)
@@ -8,7 +8,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
     // Currently, for loops can iterate over four kinds of data structures in Onyx:
     //      * Ranges
     //      * Fixed arrays
index c337300cb6c1e7f8ef2a106fb1197f9008ad9cb8..3336f44d23bf201be35335f0db4ac368050ed991 100644 (file)
@@ -2,7 +2,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
     x := 10 + 3 * 5;
 
     // The basic syntax of a switch statement:
index 02af59eefdbc475c56ce821d5c17c4eef6796a9c..064edf5ab8876568e7848a30f0ad742b6468c1bb 100644 (file)
@@ -2,7 +2,7 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main ::  (args: [] cstr) {
     // Onyx does not have map type built into the language semantics,
     // but using polymorphic structs and overloaded procedures, it does
     // provide an 'any-to-any' hash map in it's core libraries.
@@ -29,7 +29,7 @@ main :: proc (args: [] cstr) {
     map.put(^ages, "Pam", 24);
 
     // To retrieve an entry's value, use the map.get procedure.
-    print_age :: proc (ages: ^map.Map(str, u32), name: str) {
+    print_age :: (ages: ^map.Map(str, u32), name: str) {
         age := map.get(ages, name);
         printf("%s's age is %i.\n", name, age);
     }
index b8d94c49f13a1d6e23a8d7b55df96f6faa18fbf1..a2e4dea14d5f5daff25e0155dff1e6070cdb2f39 100644 (file)
@@ -2,5 +2,5 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
 }
index b8d94c49f13a1d6e23a8d7b55df96f6faa18fbf1..a2e4dea14d5f5daff25e0155dff1e6070cdb2f39 100644 (file)
@@ -2,5 +2,5 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
 }
index b8d94c49f13a1d6e23a8d7b55df96f6faa18fbf1..a2e4dea14d5f5daff25e0155dff1e6070cdb2f39 100644 (file)
@@ -2,5 +2,5 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
 }
index b8d94c49f13a1d6e23a8d7b55df96f6faa18fbf1..a2e4dea14d5f5daff25e0155dff1e6070cdb2f39 100644 (file)
@@ -2,5 +2,5 @@
 
 use package core
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
 }
index db30ce5f7756fc573b1a3c0f309ed5adbd3c1c53..5662fda6360ceb72719473546fccf8ebbaa86e94 100644 (file)
@@ -2,12 +2,12 @@
 
 use package core { println }
 
-main :: proc (args: [] cstr) {
+main :: (args: [] cstr) {
     // These functions will be used to demo the pipe operator.
     Num    :: #type i32;
-    double :: proc (v: Num)         -> Num do return v * 2;
-    add    :: proc (a: Num, b: Num) -> Num do return a + b;
-    square :: proc (v: Num)         -> Num do return v * v;
+    double :: (v: Num)         -> Num do return v * 2;
+    add    :: (a: Num, b: Num) -> Num do return a + b;
+    square :: (v: Num)         -> Num do return v * v;
 
     // Something you may find yourself doing often is changing function
     // calls together likes this:
index e582c54b51105dd7ecbc84208b3519bb295a500a..66fd4cda6b8bc35bf80049295f155f8877ef6808 100644 (file)
Binary files a/onyx.exe and b/onyx.exe differ