I want a JavaScript interpreter written in wasm but I don't know how to convince anyone reading this that this isn't a joke
@mcc I wonder if something like this will run on .NET WASM https://github.com/sebastienros/jint
GitHub - sebastienros/jint: Javascript Interpreter for .NET

Javascript Interpreter for .NET. Contribute to sebastienros/jint development by creating an account on GitHub.

GitHub
wasmbo

@lambdageek Oh wowww

Just out of curiosity, how large is this, disk-space-wise

@mcc 9.8 megs without really doing anything to optimize for size. (it does run the IL trimmer with some default settings, but I don't remember if it's super-aggressive or if it just keeps any referenced assemblies)

@lambdageek That's actually not so bad. The C# web-izer has come a long way.

So what I was originally hoping to do, just so the original prompt doesn't seem weird, was the possibility of running js "sandboxed" inside of a web page, like imagine mastodon allowing user scripts within posts…

@mcc Yea that makes a lot of sense actually.

up-thread @zemlanin suggested compiling QuickJS with Emscripten by hand, and that probably makes more sense if you're doing this seriously and don't have other .NET dependencies in play.

And apparently someone already did the compiling part https://www.npmjs.com/package/quickjs-emscripten

quickjs-emscripten

Javascript/Typescript bindings for QuickJS, a modern Javascript interpreter, compiled to WebAssembly.. Latest version: 0.22.0, last published: 2 months ago. Start using quickjs-emscripten in your project by running `npm i quickjs-emscripten`. There are 14 other projects in the npm registry using quickjs-emscripten.

npm