News for hackers. Stuff that matters.
Re:Understanding every byte in a WASM module by lioeters on Saturday December 23, 2023 @11:55AM (#38745657)
Ah yes, I'd love to get more familiar with AssemblyScript too. One thing I like about the afore-mentioned WAT compiler though, is that it's simple to run in the browser, which the AssemblyScript compiler doesn't support, if I understand correctly. That characteristic of the compiler would be useful if I want to build a higher-level language on top of it, for example with a web playground (code editor and runtime).
Re:Understanding every byte in a WASM module by circuit10 on Monday December 25, 2023 @01:50AM (#38760422)
The AssemblyScript compiler runs in a browser too, that’s how the demo on the homepage works
Re:Understanding every byte in a WASM module by lioeters on Monday December 25, 2023 @01:41PM (#38764924)
Thanks for mentioning it, I dug into the website of AssemblyScript and found that the compiler does indeed run in the browser. The demo loads a web-build like:

  <script src="https://cdn.jsdelivr.net/npm/assemblyscript@latest/dist/web.js"></script>
  <script type="module">
  
  import asc from "assemblyscript/asc";
And how they compile AssemblyScript to WAT/WASM/JS:

https://github.com/AssemblyScript/website/blob/main/src/.vue...

Here's how the compiler is built to target the web.

https://github.com/AssemblyScript/assemblyscript/blob/main/s...

How fun! This inspires me to explore further what I could build with it.