Python in Dart, live in your browser
dart_monty_core 0.120.0 · upstream Monty 1.2.0
Edit multiline Python and run it in a persistent worker session. Reset starts a fresh session.
Native source examples
Download and run these Dart programs in a native checkout. 19 native examples are available in the repository.
native example
15 · host_module
Hands Python one ExternalModule and walks every edge of its exposure boundary: import and dotted calls, the module id round trip, public attributes with private ones withheld, assignment to the module refused, the module itself not callable, missing and private attributes, unknown modules and submodules, forged names reaching nothing, a host exception raised by name, and hidden members never called. Prints one PASS line per check, then DEMO OK host_module.
dart run example/15_host_module.dart
Download 15_host_module.dart
native example
16 · step_debugger
Runs a short script one step at a time and inspects every step event the debugger surfaces: value steps (kind, name, bytes, slice, and a UTF-16 off-by-one), call steps (function and argument), a pending step, and the completing step with its output. Prints one PASS line per check, then DEMO OK step_debugger.
dart run example/16_step_debugger.dart
Download 16_step_debugger.dart
native example
17 · restore_limits
Dumps a session under each resource policy -- recursion depth, suspension count, memory, feed deadline, turn deadline, sleep budget and GC interval -- at the main, omitted, looser and tighter settings, then restores every dump, from an idle worker and from a snapshot, and shows the restored job keeps the stricter limits. Prints one PASS line per check plus OBS dump/restore/carry observations, then DEMO OK restore_limits.
dart run example/17_restore_limits.dart
Download 17_restore_limits.dart
native example
18 · durable_agent
A durable agent that survives a host restart: search fan-out over module stubs, parking at an approval, the worker released, the host restarted, the worker restarted, the approval restored, the journal played back with effects applied exactly once, a restored tool error, a matching final report, and the dump limit retained against a loose-limit control. Prints one PASS line per check, then DEMO OK durable_agent.
dart run example/18_durable_agent.dart
Download 18_durable_agent.dart