From 8dd8f96b24710dc4f2d29065928244a40a432379 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Mon, 26 Oct 2026 16:00:59 +0100 Subject: zilch: update App structure and split-up document and wasm logic --- src/zilch/App/load.js | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/zilch/App/load.js (limited to 'src/zilch/App/load.js') 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, - } - }, -); -- cgit v1.2.3-70-g09d2