Live data from Hacker News

monty-go: Pure-Go wrapper for Pydantic's Monty Python Interpreter

github.com

1–10 of 15 posts

Re: monty-go: Pure-Go wrapper for Pydantic's Monty Python Interpreter

#6
post #5

If you're going to run Python code inside a WebAssembly container anyway why go with the Monty subset when you could use full CPython (or MicroPython) compiled to WASM instead?

I've implemented and shipped a version of this that uses full CPython with a custom filesystem implementation in userspace. I think this is a bit more interesting if a bit more low level.

Re: monty-go: Pure-Go wrapper for Pydantic's Monty Python Interpreter

#8
Funny -- I just built a pure go wrapper myself because this one is super out of date!

https://github.com/CamdenClark/monty-go

It implements the new subprocess model for spawning Monty VMs that help keep your main thread isolated if one of the VMs crashes.

Because Monty is packaged as a binary now, you don't need to do the WASM embedding stuff, you just need to make sure you have the binary. (Similar to how you would run playwright in Go, for example)

Re: monty-go: Pure-Go wrapper for Pydantic's Monty Python Interpreter

#10
post #5

If you're going to run Python code inside a WebAssembly container anyway why go with the Monty subset when you could use full CPython (or MicroPython) compiled to WASM instead?

1. Control and guardrails. I want agent-authored code to be able to express itself in code but I want to own the external tools that are available to the agent.

2. Suspension and resumption. Monty's VM state is fully serializable so I can run the VM until it gets to a tool call and persist the VM state. I could resume it days later with the results of the tool call with no issues. Doing that guaranteed with CPython is really tricky (tools like Pickle can get you close but if you have open sockets or other weird stuff you're in a world of hurt).

Post reply on HN