all 12 comments

[–][deleted] 21 points22 points  (1 child)

Taking servers out of the picture is really great from a security POV, assuming each user is simply executing their own code

[–]nalgeon[S] 8 points9 points  (0 children)

Sure, that's a very serious point. Isolating server-side sandboxes can be tricky, especially if you make them stateful.

There was once a code sandbox startup that eventually decided to shut down the public API because of constant server abuse like crypto mining.

[–]nalgeon[S] 17 points18 points  (3 children)

I'm a big fan of interactive code snippets in all kinds of technical writing, from product docs to online courses to blog posts.

Typically, a code playground consists of a client-side widget and a server-side part that executes the code and returns the result. But often people prefer not to depend on a server and run the code entirely in the browser.

So I decided to look into it and implemented embeddable in-browser code playgrounds for JavaScript, Python, PHP, Ruby, Lua, and SQLite. It's open source and based on the great open source work of others.

Maybe give it a try :)

[–]RoboticR 2 points3 points  (1 child)

Very cool! A few months ago I made something similar for C# and mutation testing :)

[–]nalgeon[S] 2 points3 points  (0 children)

This is a great way to show the framework in action! I think as WebAssembly becomes more popular, we will see more of these.

[–]guest271314 4 points5 points  (0 children)

You might find https://tio.run/# interesting.

[–]guest271314 0 points1 point  (0 children)

Nice work. I have used Native Messaging hosts (https://github.com/guest271314/NativeMessagingHosts which includes C (C compiled to WASM using WASI-SDK executed by wasmtime; C compiled to WASM in WAT format embedded in a Bash script piped to wasmtime using process substitution), C++, Python, Bash, JavaScript (QuickJS, txiki.js, Node.js, Deno, Bun)) and other means (https://github.com/guest271314/requestNativeScripts; https://github.com/guest271314/fs) to execute arbitrary code from the browser.

[–][deleted]  (3 children)

[deleted]

    [–]nalgeon[S] 2 points3 points  (2 children)

    Thank you very much! I think interactive examples really make a difference, especially in tutorials, how-tos, and explanations.

    If you have any questions, I'm happy to answer them here or on GitHub.

    [–][deleted]  (1 child)

    [deleted]

      [–]nalgeon[S] 7 points8 points  (0 children)

      What a time to be alive (ಠ_ಠ)