dart_monty_wasm 0.3.3 copy "dart_monty_wasm: ^0.3.3" to clipboard
dart_monty_wasm: ^0.3.3 copied to clipboard

WASM backend for dart_monty — Dart/Flutter bindings for Monty, a Rust-built embeddable sandbox running a restricted subset of Python.

dart_monty_wasm #

Pure Dart web WASM implementation of dart_monty using dart:js_interop and @pydantic/monty. Runs the Monty Python interpreter in a Web Worker to avoid Chrome's synchronous WASM compile-size limit.

This package has no Flutter dependency and can be used in any Dart web project.

  • Flutter apps should import dart_monty instead — the federated plugin selects the correct backend automatically.
  • Pure Dart web projects can depend on this package directly to run Python via WASM in the browser.

Architecture #

Dart (compiled to JS) -> MontyWasm (dart:js_interop)
  -> DartMontyBridge (monty_glue.js)
    -> Web Worker (dart_monty_worker.js)
      -> @pydantic/monty WASM (NAPI-RS)

Key Classes #

Class Description
WasmBindings Abstract async interface for WASM operations
WasmBindingsJs Concrete JS interop implementation via Web Worker
MontyWasm MontyPlatform implementation using WasmBindings

Requirements #

The web server must send COOP/COEP headers for SharedArrayBuffer support:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

See the main dart_monty repository for full documentation.

0
likes
0
points
1.23k
downloads

Publisher

unverified uploader

Weekly Downloads

WASM backend for dart_monty — Dart/Flutter bindings for Monty, a Rust-built embeddable sandbox running a restricted subset of Python.

Repository (GitHub)
View/report issues

Topics

#python #sandbox #wasm #interpreter

License

unknown (license)

Dependencies

dart_monty_platform_interface

More

Packages that depend on dart_monty_wasm