Bubbler-4 / TryInBrowser

Online interpreter that works even if you go offline
https://try-in-browser.netlify.app/
MIT License
4 stars 0 forks source link
online-interpreter rust wasm webassembly

TryInBrowser

Online interpreter that works even if you go offline

Why Try In Browser?

Most online interpreters require a server to run the submitted programs. And making different runs not interfere with each other (security concerns aside) is difficult.

Try In Browser attempts to solve this problem by moving all the interpreters into the browser. No need to isolate runs. No need to run a dedicated server; a simple file server (such as GitHub Pages) is enough. An added benefit is that, once everything is loaded, you can disconnect from the Internet and still use it.

Most parts of Try In Browser are written in Rust, using Seed web app framework. This means the UI and interpreters will be fast and reliable in general. Due to the fact that the interpreters don't have the OS to back them up, this approach is not generally applicable to most practical, general-purpose languages. On the other hand, many esolangs don't need more than stdin/stdout, and most are quite simplistic and easily run in steps, which makes TIB an ideal form of esolang showcase.

What's new in TIB 2.0

TIB 2.0 is a major rewrite of the initial TIB. The biggest difference is that the interpreter is run inside a Web Worker, so it can run at near-native speeds without blocking the UI. This removes the "run-in-steps" requirement, which is pretty hard to achieve for many languages, and opens up the possibility to include Rust-based runtimes such as RustPython. Also, the interpreter can be stopped externally if it hangs (via Worker.terminate()), and a panic does not break the UI either.

Distinctive features vs. other Try Online sites

Convenience features


Development instructions

Required tools: Rust, Cargo, cargo-make.

If you're using Linux and getting errors related to openssl and/or pkg-config, install the necessary packages via the package manager (e.g. sudo apt-get install libssl-dev pkg-config for Ubuntu).

Provided cargo make commands: