dart_monty_wasm 0.4.3
dart_monty_wasm: ^0.4.3 copied to clipboard
WASM backend for dart_monty, pure Dart bindings for Monty — a restricted sandboxed Python interpreter built in Rust.
// Printing to stdout is expected in an example.
// ignore_for_file: avoid_print
import 'package:dart_monty_wasm/dart_monty_wasm.dart';
/// Demonstrates direct use of the WASM bindings.
///
/// Most apps should import `dart_monty` instead — the federated plugin
/// selects the correct backend automatically. This package is intended
/// for browser environments only.
Future<void> main() async {
final monty = MontyWasm(bindings: WasmBindingsJs());
final result = await monty.run('2 + 2');
print('Result: ${result.value}'); // 4
await monty.dispose();
}