From e2e287079c270c0c0e35f23676ce284d48ee4029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Sat, 18 Jul 2026 02:50:09 -0600 Subject: [PATCH] deyuck --- index.html | 20 ------------- runtime/t.wat | 6 ---- t.js | 18 ------------ t.wat | 61 --------------------------------------- t2.wat | 65 ----------------------------------------- u.wasm | Bin 384 -> 0 bytes u.wat | 78 -------------------------------------------------- 7 files changed, 248 deletions(-) delete mode 100644 index.html delete mode 100644 runtime/t.wat delete mode 100644 t.js delete mode 100644 t.wat delete mode 100644 t2.wat delete mode 100644 u.wasm delete mode 100644 u.wat diff --git a/index.html b/index.html deleted file mode 100644 index 06a376a..0000000 --- a/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - diff --git a/runtime/t.wat b/runtime/t.wat deleted file mode 100644 index c189168..0000000 --- a/runtime/t.wat +++ /dev/null @@ -1,6 +0,0 @@ -(module - (import "gyehoek" "say-hi" (func $say-hi)) - (func (export "main") - (call $say-hi) - (call $say-hi) - (call $say-hi))) diff --git a/t.js b/t.js deleted file mode 100644 index a3d8ac2..0000000 --- a/t.js +++ /dev/null @@ -1,18 +0,0 @@ -const imports = { - guppy: { - print: (arg) => console.log (arg) - } -} - -// Assume add.wasm file exists that contains a single function adding 2 provided arguments -const fs = require('node:fs'); - -// Use the readFileSync function to read the contents of the "add.wasm" file -const wasmBuffer = fs.readFileSync('u.wasm'); - -// Use the WebAssembly.instantiate method to instantiate the WebAssembly module -WebAssembly.instantiate(wasmBuffer, imports).then(wasmModule => { - // Exported function lives under instance.exports object - const { main } = wasmModule.instance.exports; - main () -}); diff --git a/t.wat b/t.wat deleted file mode 100644 index 972cff1..0000000 --- a/t.wat +++ /dev/null @@ -1,61 +0,0 @@ -(module - (import - "gyehoek" - "write" - (func $gh-write (param (ref eq)))) - (import - "gyehoek" - "to-bool" - (func $gh-to-bool (param (ref eq)) (result i32))) - (type $heap-object (sub (struct (field $hash (mut i32))))) - (type $cont-type (func (param i32))) - (type $cont-stack-type (array (mut (ref null $cont-type)))) - (global $cont-stack-top (mut i32) (i32.const 0)) - (global - $cont-stack - (ref $cont-stack-type) - (array.new_default $cont-stack-type (i32.const 128))) - (type $arg-array-type (array (mut (ref null eq)))) - (global - $arg-array - (ref $arg-array-type) - (array.new_default $arg-array-type (i32.const 32))) - (global $result (mut (ref null eq)) (ref.null eq)) - (func - $halt - (param i32) - (global.get $arg-array) - (i32.const 0) - (array.get $arg-array-type) - ref.as_non_null - (global.set $result)) - (func - $scm-entry - (param i32) - (local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq)) - (i32.const 3) - ref.i31 - (call $gh-to-bool) - (if - (then - (global.get $arg-array) - (global.get 0) - (i32.const 777) - (i32.const 1) - i32.shl - ref.i31 - (array.set $arg-array-type) - (return_call $halt (i32.const 1))) - (else - (global.get $arg-array) - (global.get 0) - (i32.const 555) - (i32.const 1) - i32.shl - ref.i31 - (array.set $arg-array-type) - (return_call $halt (i32.const 1))))) - (func - (export "main") - (call $scm-entry (i32.const 0)) - (call $gh-write (ref.as_non_null (global.get $result))))) diff --git a/t2.wat b/t2.wat deleted file mode 100644 index bd27cf8..0000000 --- a/t2.wat +++ /dev/null @@ -1,65 +0,0 @@ -(module - (type $heap-object (sub (struct (field (mut i32))))) - (type $open-procedure (func (param i32))) - (type $closure (sub $heap-object - (struct (field (mut i32)) - (field (ref $open-procedure))))) - (type $cont-stack-type (array (mut (ref null $open-procedure)))) - (type $arg-array-type (array (mut eqref))) - (type (func (result (ref eq)))) - (global $cont-stack-top (mut i32) (i32.const 0)) - (global $cont-stack (ref $cont-stack-type) - (array.new_default $cont-stack-type (i32.const 128))) - (global $arg-array (ref $arg-array-type) - (array.new_default $arg-array-type (i32.const 32))) - (global (mut eqref) (ref.null eq)) - (elem declare funcref (ref.func 1)) - (func $halt (param i32) - (local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq)) - (global.set 3 - (ref.as_non_null - (array.get $arg-array-type - (global.get $arg-array) - (i32.const 0))))) - (func $f1 (param i32) - (local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq)) - ;; pop arg 0 - (local.set - 1 - (ref.as_non_null - (array.get $arg-array-type - (global.get $arg-array) - (i32.const 0)))) - ;; push arg 0 - (array.set $arg-array-type - (global.get $arg-array) - (i32.const 0) - (local.get 1)) - ;; pop continuation - (return_call_ref - $open-procedure - (i32.const 1) - (ref.as_non_null (array.get $cont-stack-type - (global.get $cont-stack) - (global.get $cont-stack-top))) - (global.set $cont-stack-top - (i32.sub - (global.get $cont-stack-top) - (i32.const 1))))) - (func $f2 (type $open-procedure) (param i32) - (local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq)) - (local.set 1 - (struct.new $closure - (i32.const 0) - (ref.func $f1))) - (array.set $arg-array-type - (global.get $arg-array) - (i32.const 0) - (local.get 1)) - (i32.const 1) - (return_call $f1)) - (func $main (export "main") (result (ref eq)) - (local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq)) - (call $f2 (i32.const 0)) - (ref.as_non_null - (global.get 3)))) diff --git a/u.wasm b/u.wasm deleted file mode 100644 index 702623c133f40f35bb0d4f951a20fd744ac53409..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 384 zcmZQbEY4+QU|?Y6XGvhJXNXH?V2sOUOkiMO;%8({FD)pjWGyJl%qwAFU}j+k5iE=a z3`}g2%qffvjtz{z*%`U(866q8Q@FN zA|p#)Vs0v