Simon Willison’s Weblog

Subscribe

A WebAssembly compiler that fits in a tweet (via) Here's that compiler:

let c=(b,l)=>WebAssembly.instantiate(new Int8Array( [,97,115,109,1,,,,1,5,1,96,,1,127,3,2,1,,7,4,1,,,,10, l=(b=b.split .flatMap(t=>t>-1?[65,t]:107+'-*/'.indexOf(t))) .length+4,1,l-2,,...b,11]))

This article then does a great job of de-obfuscating that code, and uses it to explain a whole bunch of interesting concepts about how WebAssembly actually works.