Get the latest tech news

Show HN: Jaws – a JavaScript to WASM ahead-of-time compiler


JavaScript to WASM compiler. Contribute to drogus/jaws development by creating an account on GitHub.

You have to either include an interpreter, which automatically makes the binary at least a few MBs in size and the memory usage even bigger, or use a variation of the language you're targetting (like TinyGo instead of Go, or AssemblyScript instead of TypeScript/JavaScript). In order to make it easier to develop before the runtimes catch up with standardized proposals, I decided to use V8 (through Chromium or Node) with a Javascript polyfill for WASIp2 features that I need. Ideally I would use the stack-switching proposal for both await and generators, but alas it's only in Phase 2 and it has minimal runtime support (I could find some mentions in Chromium development groups, but I couldn't get it to work).

Get the Android app

Or read this on Hacker News

Read more on:

Photo of javascript

javascript

Photo of jaws

jaws

Photo of wasm

wasm

Related news:

News photo

Hacking cars in JavaScript (Replay attacks in the browser with the HackRF)

News photo

Generating Lever-Door Puzzles with JavaScript

News photo

Python dethrones JavaScript as the most-used language on GitHub