aboutsummaryrefslogtreecommitdiff
path: root/src/zilch/App/load.js
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-10-26 16:00:59 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2026-10-26 16:00:59 +0100
commit8dd8f96b24710dc4f2d29065928244a40a432379 (patch)
tree192fcdbef2373a983673e929835bff64ad8edb48 /src/zilch/App/load.js
parentfeeedb0bf31314b182e7bbc135182f6e0bc859b2 (diff)
zilch: update App structure and split-up document and wasm logic
Diffstat (limited to 'src/zilch/App/load.js')
-rw-r--r--src/zilch/App/load.js37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/zilch/App/load.js b/src/zilch/App/load.js
deleted file mode 100644
index e93a4a6..0000000
--- a/src/zilch/App/load.js
+++ /dev/null
@@ -1,37 +0,0 @@
-const imports = {
- object_store: {
- process: ObjectStore.processWasm,
- },
- console: {
- log(buffer, length) {
- console.log(ObjectStore.decodeString(buffer, length))
- },
- warn(buffer, length) {
- console.warn(ObjectStore.decodeString(buffer, length))
- },
- err(buffer, length) {
- console.error(ObjectStore.decodeString(buffer, length))
- },
- debug(buffer, length) {
- console.debug(ObjectStore.decodeString(buffer, length))
- },
- }
-}
-
-const wasm_ready = WebAssembly.instantiateStreaming(fetch("index.wasm"), imports).then(
- ({ instance, module }) => {
- const view = new DataView(instance.exports.memory.buffer);
- const type_names = [ 'Call', 'Value', 'Ptr' ];
- const size_of = {};
-
- for (const type of type_names) {
- size_of[type] = view.getUint16(instance.exports[`type::size::${type}`], true);
- }
-
- wasm = {
- exports: instance.exports,
- memory: instance.exports.memory,
- size_of: size_of,
- }
- },
-);