Skip to content

Commit

Permalink
Deploy website - based on 7c7e92f2208e16b8479187a52318fc4a8cde4bf6
Browse files Browse the repository at this point in the history
  • Loading branch information
cbebe committed Sep 24, 2024
1 parent c64bb14 commit d0d9bb9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!doctype html><html lang=en-us dir=ltr><head><meta name=generator content="Hugo 0.123.8"><meta charset=utf-8><meta name=viewport content="width=device-width;initial-scale=1"><link rel="shortcut icon" href=/favicon.png type=image/png><title>Fysh</title>
<link rel=stylesheet href=/css/main.min.fb5973a03a12a1a594439851f07cc687cb1ba323abfdce8f54ba23272c352c2c.css integrity="sha256-+1lzoDoSoaWUQ5hR8HzGh8sboyOr/c6PVLojJyw1LCw=" crossorigin=anonymous><link rel=stylesheet href=/css/opening.min.9e5f92a3326f3009b51c786d5c4e9a3fa51c39a7b0e9d6b8acf07d6ed5b6b7a1.css integrity="sha256-nl+SozJvMAm1HHhtXE6aP6UcOaew6da4rPB9btW2t6E=" crossorigin=anonymous><script src=/js/wasm_exec.min.5a67bddb6e2702f1cd8b8718528b2cd3e07b9f43ff75c297752f5064701f4c50.js integrity="sha256-Wme9224nAvHNi4cYUoss0+B7n0P/dcKXdS9QZHAfTFA=" crossorigin=anonymous defer></script><script src=/js/interpreter.min.886df999e12b1dded5997fb8f20952d5f791431a1ac41251149e8ecbd3a83c1c.js integrity="sha256-iG35meErHd7VmX+48glS1feRQxoaxBJRFJ6Oy9OoPBw=" crossorigin=anonymous defer></script></head><body><nav class=corner-nav><code>>&lt;fysh></code></nav><div class=opening id=opening><a class=og-fysh href=#main><code>>&lt;></code></a><div class=wave-container><div class=ocean><div class=wave></div><div class=wave></div></div></div><div class=bottom-fysh><a class=fysh-container href=#main><code class=fysh>>&lt;<code class="c c-1">f</code><code class="c c-2">y</code><code class="c c-3">s</code><code class="c c-4">h</code><code class=blinking>&#9647;</code>><code class=blinking-after>&#9647;</code></code></a></div></div><main id=main>The Programming Language of the sea!<p><a href=/docs/installation>Installation</a></p><p><a href=/docs/manual>Manual</a></p><p><a href=#opening>Back to top</a></p><web-interpreter><button class=play>Play</button>
<link rel=stylesheet href=/css/main.min.fb5973a03a12a1a594439851f07cc687cb1ba323abfdce8f54ba23272c352c2c.css integrity="sha256-+1lzoDoSoaWUQ5hR8HzGh8sboyOr/c6PVLojJyw1LCw=" crossorigin=anonymous><link rel=stylesheet href=/css/opening.min.9e5f92a3326f3009b51c786d5c4e9a3fa51c39a7b0e9d6b8acf07d6ed5b6b7a1.css integrity="sha256-nl+SozJvMAm1HHhtXE6aP6UcOaew6da4rPB9btW2t6E=" crossorigin=anonymous><script src=/js/wasm_exec.min.5a67bddb6e2702f1cd8b8718528b2cd3e07b9f43ff75c297752f5064701f4c50.js integrity="sha256-Wme9224nAvHNi4cYUoss0+B7n0P/dcKXdS9QZHAfTFA=" crossorigin=anonymous defer></script><script src=/js/interpreter.min.27d8251c0be49b0d0b03902f3a352e54adc8cf2aaf9560d3dffd7863ec444f9f.js integrity="sha256-J9glHAvkmw0LA5AvOjUuVK3IzyqvlWDT3/14Y+xET58=" crossorigin=anonymous defer></script></head><body><nav class=corner-nav><code>>&lt;fysh></code></nav><div class=opening id=opening><a class=og-fysh href=#main><code>>&lt;></code></a><div class=wave-container><div class=ocean><div class=wave></div><div class=wave></div></div></div><div class=bottom-fysh><a class=fysh-container href=#main><code class=fysh>>&lt;<code class="c c-1">f</code><code class="c c-2">y</code><code class="c c-3">s</code><code class="c c-4">h</code><code class=blinking>&#9647;</code>><code class=blinking-after>&#9647;</code></code></a></div></div><main id=main>The Programming Language of the sea!<p><a href=/docs/installation>Installation</a></p><p><a href=/docs/manual>Manual</a></p><p><a href=#opening>Back to top</a></p><web-interpreter><button class=play>Play</button>
<textarea class=input></textarea></web-interpreter></main></body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";const WASM_URL="web-interpreter-opt.wasm";class WebInterpreter extends HTMLElement{#wasm;#insertText(e){const s=new TextEncoder,t=s.encode(e),n=this.#wasm.exports.getBuffer(),o=this.#wasm.exports.memory.buffer,i=new Int8Array(o),a=i.subarray(n,n+t.length);for(let e=0;e<t.length;e++)a[e]=t[e];return[n,t.length]}#logText(e,t){const n=this.#wasm.exports.memory,s=n.buffer.slice(e,e+t),o=new TextDecoder("UTF-8"),i=o.decode(new Int8Array(s));return i}#newRunner(){const e=new Go;return e.importObject["main.go.printError"]=(e,t)=>{console.error(this.#logText(e,t))},e.importObject["main.go.printOut"]=(e,t)=>{console.log(this.#logText(e,t))},e.importObject.env={printError:e.importObject["main.go.printError"],printOut:e.importObject["main.go.printOut"]},e}connectedCallback(){this.querySelector("textarea.input").value=`><//> Calculate 5!
><number> ≈ ><{({°> ~ ><//> b101 = 5
><factorial> ≈ ><(({°> ~ ><//> b001 = 1
><//> while number > 1
><(((@> [><number> o~ ><(({°>]
><>
><//> factorial = factorial * number
><factorial> ≈ ><factorial> ♡ ><number> ~
><//> number -= 1
<number><< ~
<><
(+o ><factorial> ~ ><//> Should be 120
`;const e=this.#newRunner();"instantiateStreaming"in WebAssembly?WebAssembly.instantiateStreaming(fetch(WASM_URL),e.importObject).then(t=>{this.#wasm=t.instance,e.run(this.#wasm)}):fetch(WASM_URL).then(e=>e.arrayBuffer()).then(t=>WebAssembly.instantiate(t,e.importObject).then(t=>{this.#wasm=t.instance,e.run(this.#wasm)})),this.querySelector("button.play")?.addEventListener("click",()=>{if(!this.#wasm)return;const e=this.querySelector("textarea.input").value,[t,n]=this.#insertText(e);this.#wasm.exports.goFysh(t,n)})}}customElements.define("web-interpreter",WebInterpreter)

This file was deleted.

0 comments on commit d0d9bb9

Please sign in to comment.