Skip to content
HN On Hacker News ↗

GitHub - fugue-labs/monty-go: Pure-Go wrapper for Pydantic Monty Python interpreter via WASM + wazero

▲ 55 points 12 comments by networked 1w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this text is a mix of AI and human-written content.

78 %

AI likelihood · overall

Mixed
22% human-written 78% AI-generated
SEGMENTS · HUMAN 0 of 2
SEGMENTS · AI 1 of 2
WORD COUNT 251
PEAK AI % 88% · §1
Analyzed
Aug 30
backend: pangram/v3.3
Segments scanned
2 windows
avg 126 words each
Distribution
22 / 78%
human / AI fraction
Verdict
Mixed
Pangram v3.3

Article text · 251 words · 2 segments analyzed

Human AI-generated
§1 AI · 88%

Run LLM-generated Python safely from Go — no containers, no CGO, no subprocess. A pure-Go wrapper around Pydantic's Monty Python interpreter, compiled to WebAssembly and loaded via wazero. Your Go agent writes Python code, monty-go executes it in a sandboxed WASM instance with sub-millisecond startup, and pauses whenever the code calls an external function so your Go code can handle it. go get github.com/fugue-labs/monty-go Why? LLMs work faster, cheaper, and more reliably when they write code instead of making sequential tool calls. Instead of: Agent → tool_call("search", {query: "weather london"}) → result Agent → tool_call("search", {query: "weather tokyo"}) → result Agent → tool_call("compare", {a: result1, b: result2}) → result The LLM writes: london = search(query="weather london") tokyo = search(query="weather tokyo") compare(a=london, b=tokyo) One model call instead of three. The Python code calls your Go functions, Monty pauses at each call, your Go code executes it, and Monty resumes. No containers. No sandbox services. No exec(). Just a 2.9MB WASM binary embedded in your Go binary.

§2 Mixed · 31%

For motivation, see: Programmatic Tool Calling from Anthropic Code Execution with MCP from Anthropic Code Mode from Cloudflare Smol Agents from Hugging Face Quick Start package main import ( "context" "fmt" "log" montygo "github.com/fugue-labs/monty-go" ) func main() { runner, err := montygo.New() if err != nil { log.Fatal(err) } defer runner.Close() result, err := runner.Execute(context.Background(), "x * 2 + y", map[string]any{"x": 10, "y": 5}, ) if err != nil { log.Fatal(err) } fmt.Println(result) // 25 } External Functions (Pause/Resume) The real power is external function calls.