Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stdlib)!: Move Power to runtime and add Operator #1538

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ arrays › array_access
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/exception\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32)))
(global $x_1129 (mut i32) (i32.const 0))
(global $x_1132 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -44,7 +44,7 @@ arrays › array_access
(local.set $0
(block $compile_block.10 (result i32)
(block $compile_store.3
(global.set $x_1129
(global.set $x_1132
(tuple.extract 0
(tuple.make
(block $allocate_array.1 (result i32)
Expand Down Expand Up @@ -77,7 +77,7 @@ arrays › array_access
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $x_1129)
(global.get $x_1132)
)
)
)
Expand All @@ -90,7 +90,7 @@ arrays › array_access
(i32.const 1)
)
(local.set $2
(global.get $x_1129)
(global.get $x_1132)
)
(block $resolve_idx.8
(if
Expand Down
8 changes: 4 additions & 4 deletions compiler/test/__snapshots__/arrays.28fcc534.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ arrays › array_access4
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/exception\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32)))
(global $x_1129 (mut i32) (i32.const 0))
(global $x_1132 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -44,7 +44,7 @@ arrays › array_access4
(local.set $0
(block $compile_block.10 (result i32)
(block $compile_store.3
(global.set $x_1129
(global.set $x_1132
(tuple.extract 0
(tuple.make
(block $allocate_array.1 (result i32)
Expand Down Expand Up @@ -77,7 +77,7 @@ arrays › array_access4
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $x_1129)
(global.get $x_1132)
)
)
)
Expand All @@ -90,7 +90,7 @@ arrays › array_access4
(i32.const -3)
)
(local.set $2
(global.get $x_1129)
(global.get $x_1132)
)
(block $resolve_idx.8
(if
Expand Down
8 changes: 4 additions & 4 deletions compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ arrays › array_access2
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/exception\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32)))
(global $x_1129 (mut i32) (i32.const 0))
(global $x_1132 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -44,7 +44,7 @@ arrays › array_access2
(local.set $0
(block $compile_block.10 (result i32)
(block $compile_store.3
(global.set $x_1129
(global.set $x_1132
(tuple.extract 0
(tuple.make
(block $allocate_array.1 (result i32)
Expand Down Expand Up @@ -77,7 +77,7 @@ arrays › array_access2
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $x_1129)
(global.get $x_1132)
)
)
)
Expand All @@ -90,7 +90,7 @@ arrays › array_access2
(i32.const 3)
)
(local.set $2
(global.get $x_1129)
(global.get $x_1132)
)
(block $resolve_idx.8
(if
Expand Down
8 changes: 4 additions & 4 deletions compiler/test/__snapshots__/arrays.6eac4e1f.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ arrays › array_access3
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/exception\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32)))
(global $x_1129 (mut i32) (i32.const 0))
(global $x_1132 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -44,7 +44,7 @@ arrays › array_access3
(local.set $0
(block $compile_block.10 (result i32)
(block $compile_store.3
(global.set $x_1129
(global.set $x_1132
(tuple.extract 0
(tuple.make
(block $allocate_array.1 (result i32)
Expand Down Expand Up @@ -77,7 +77,7 @@ arrays › array_access3
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $x_1129)
(global.get $x_1132)
)
)
)
Expand All @@ -90,7 +90,7 @@ arrays › array_access3
(i32.const 5)
)
(local.set $2
(global.get $x_1129)
(global.get $x_1132)
)
(block $resolve_idx.8
(if
Expand Down
8 changes: 4 additions & 4 deletions compiler/test/__snapshots__/arrays.74d79181.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ arrays › array_access5
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/exception\" \"panicWithException\" (func $panicWithException_0 (param i32 i32) (result i32)))
(global $x_1129 (mut i32) (i32.const 0))
(global $x_1132 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -44,7 +44,7 @@ arrays › array_access5
(local.set $0
(block $compile_block.10 (result i32)
(block $compile_store.3
(global.set $x_1129
(global.set $x_1132
(tuple.extract 0
(tuple.make
(block $allocate_array.1 (result i32)
Expand Down Expand Up @@ -77,7 +77,7 @@ arrays › array_access5
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $x_1129)
(global.get $x_1132)
)
)
)
Expand All @@ -90,7 +90,7 @@ arrays › array_access5
(i32.const -5)
)
(local.set $2
(global.get $x_1129)
(global.get $x_1132)
)
(block $resolve_idx.8
(if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ basic functionality › modulo4
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$%\" (global $%_1129 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$%\" (global $%_1132 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"%\" (func $%_1129 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"%\" (func $%_1132 (param i32 i32 i32) (result i32)))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -39,10 +39,10 @@ basic functionality › modulo4
(block $cleanup_locals.2 (result i32)
(local.set $0
(block $compile_block.1 (result i32)
(call $%_1129
(call $%_1132
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $%_1129)
(global.get $%_1132)
)
(i32.const -33)
(i32.const 35)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ basic functionality › land4
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$&\" (global $&_1129 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$&\" (global $&_1132 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"&\" (func $&_1129 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"&\" (func $&_1132 (param i32 i32 i32) (result i32)))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -39,10 +39,10 @@ basic functionality › land4
(block $cleanup_locals.2 (result i32)
(local.set $0
(block $compile_block.1 (result i32)
(call $&_1129
(call $&_1132
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $&_1129)
(global.get $&_1132)
)
(i32.const 1)
(i32.const 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ basic functionality › lxor1
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$^\" (global $^_1129 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$^\" (global $^_1132 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"^\" (func $^_1129 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"^\" (func $^_1132 (param i32 i32 i32) (result i32)))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -39,10 +39,10 @@ basic functionality › lxor1
(block $cleanup_locals.2 (result i32)
(local.set $0
(block $compile_block.1 (result i32)
(call $^_1129
(call $^_1132
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $^_1129)
(global.get $^_1132)
)
(i32.const 3)
(i32.const 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ basic functionality › lor1
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$|\" (global $|_1129 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$|\" (global $|_1132 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"|\" (func $|_1129 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"|\" (func $|_1132 (param i32 i32 i32) (result i32)))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -39,10 +39,10 @@ basic functionality › lor1
(block $cleanup_locals.2 (result i32)
(local.set $0
(block $compile_block.1 (result i32)
(call $|_1129
(call $|_1132
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $|_1129)
(global.get $|_1132)
)
(i32.const 3)
(i32.const 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ basic functionality › modulo6
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$%\" (global $%_1129 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$%\" (global $%_1132 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"%\" (func $%_1129 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"%\" (func $%_1132 (param i32 i32 i32) (result i32)))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -39,10 +39,10 @@ basic functionality › modulo6
(block $cleanup_locals.2 (result i32)
(local.set $0
(block $compile_block.1 (result i32)
(call $%_1129
(call $%_1132
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $%_1129)
(global.get $%_1132)
)
(i32.const 35)
(i32.const 35)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ basic functionality › precedence3
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$%\" (global $%_1132 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$+\" (global $+_1129 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$%\" (global $%_1135 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$+\" (global $+_1132 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"%\" (func $%_1132 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"+\" (func $+_1129 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"%\" (func $%_1135 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"+\" (func $+_1132 (param i32 i32 i32) (result i32)))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -48,10 +48,10 @@ basic functionality › precedence3
(local.set $6
(tuple.extract 0
(tuple.make
(call $%_1132
(call $%_1135
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $%_1132)
(global.get $%_1135)
)
(i32.const 9)
(i32.const 13)
Expand All @@ -66,10 +66,10 @@ basic functionality › precedence3
(block $do_backpatches.1
)
)
(call $+_1129
(call $+_1132
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $+_1129)
(global.get $+_1132)
)
(i32.const 7)
(call $incRef_0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ basic functionality › lsl1
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$<<\" (global $<<_1129 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$<<\" (global $<<_1132 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"<<\" (func $<<_1129 (param i32 i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"<<\" (func $<<_1132 (param i32 i32 i32) (result i32)))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
Expand Down Expand Up @@ -39,10 +39,10 @@ basic functionality › lsl1
(block $cleanup_locals.2 (result i32)
(local.set $0
(block $compile_block.1 (result i32)
(call $<<_1129
(call $<<_1132
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $<<_1129)
(global.get $<<_1132)
)
(i32.const 15)
(i32.const 3)
Expand Down
Loading