THE ALTAR OF DART
PYTHON IN THE BROWSER — NO SERVER, NO BINARY, JUST DART
"And 'Bob' spake from within the WASM, and Dart carried the word unto the DOM." — Book of Monty 3:14
pydantic/monty
pub.dev/dart_monty
runyaga/dart_monty
HOST API ▸
DOM Elements
dom_create
(tag)
→ handle
dom_text
(h, text)
dom_get_text
(h)
→ str
dom_append
(parent, child)
dom_query
(selector)
→ handle
dom_style
(h, prop, val)
dom_attr
(h, attr, val)
dom_html
(h, html)
dom_remove
(h)
DOM Input & Events
dom_set_value
(h, val)
dom_get_value
(h)
→ str
dom_on_click
(h)
BLOCKS
dom_await_click_any
([h, ...])
→ handle
BLOCKS
Storage & JSON
storage_get
(key)
→ str
storage_set
(key, val)
json_dumps
(obj)
→ str
json_loads
(s)
→ obj
Network & I/O
fetch_text
(url)
→ str
fetch_json
(url)
→ obj
download_file
(name, b64)
upload_file
()
→ b64
BLOCKS
Interpreter
interpreter_snapshot
()
→ b64
interpreter_restore
(b64)
→ str
Utility
log
(msg)
alert
(msg)
now
()
→ iso8601
All functions are globals — no import needed. Handles are ints.
BLOCKS
= Python suspends until event fires.
INVOKE
PURGE
Ctrl+Enter to invoke
DOM Sandbox
Python → Dart → Browser
Loading the sacred interpreter...
Dart is the way. Slack off.