Pi in Go - https://xitter.cf/t.co/lkRQw8Ir2c & https://xitter.cf/t.co/xPrMImvCAb

Joined December 2018
PiG is MIT licensed, and it is free forever. Here just for the love of the game and going ham. Big thanks to the @pidotdev team for building the thing we get to follow, to Pi-Bolt for its open benchmark suite that showed us our slowest paths, to durable-bench, and to everyone who contributes their work to open source. 🐷
1
4
517
Some numbers from Buffon (michaelkinsy.github.io/buffo…) which is the repository I made to benchmark harnesses related to Pi use cases. All the numbers are CPU milliseconds on the same machine, and lower is better. The command pig --version takes 5 ms in PiG. In Pi on Node, the same command takes 282 ms. One prompt with tools takes 29 ms in PiG and 518 ms in Pi. Streaming a long answer in the TUI took 2,451 ms in PiG 0.4.1. In 0.5.0, it takes 403 ms. PiG also loses in some places. Pi-Bolt is a little ahead on interactive start and on resuming a long session. TypeScript extensions add a fixed startup cost, because PiG starts a separate Node host for them. With 10 TypeScript extensions, one prompt takes 934 ms in PiG, 676 ms in Pi and 109 ms in Pi-Bolt. If you port your extensions to Go, most of that cost goes away. In our own run (not buffon), the same 10 extensions as a Go Piglet took 67 ms in print mode, which is less than Pi-Bolt's 109 ms. In RPC mode the Go Piglet took 521 ms and Pi-Bolt took 194 ms, so Pi-Bolt is still ahead there. The Go and TypeScript extensions were checked to behave the same, and the run is labelled provisional. Scripts and raw data are in go-ext-comparison.tar.gz. You can rerun the buffon numbers yourself 🐷
1
1
7
724
The part I am most excited about is Piglets. A Piglet is a named PiG configuration that you can build into its own binary. In 0.5.0, almost every built-in part of PiG is a slot. For each slot, a Piglet keeps the part, replaces it with your own Go code, or strips it out of the binary. Stripping is where the binary and opinions can shrink/conform. Stock PiG is the normal pig binary with everything built in. pig-core is a Piglet from Pigpen that keeps Pi's four default tools (read, bash, edit and write) and strips the rest. Only the stripped parts are gone, and it is still a working coding agent. The stripped parts include MCP, code mode, tool search, llama.cpp, the Bedrock, Vertex and Mistral APIs, HTML export, self-update, syntax highlighting, and the Go, Python and Rust extension SDKs. Stock PiG is 70.3 MB. pig-core is 39.4 MB. You can also strip select extension runtimes. The snake-go Piglet in the demo strips the TypeScript, Python and Rust extension runtimes and keeps Go. It is 61.4 MB, and it still runs a Go extension, a snake game, fused into the binary. Slots also let a Piglet replace a part instead of removing it. This one is just cool. pig-tern fills the frontend slot, so the same PiG draws natively in the Tern terminal. Tool calls show as cards, edits show as diffs, and answers render as Markdown. Outside Tern, PiG draws as usual 🐷
1
1
14
1,190
🚨 PiG 0.5.0 is out 🐷 This release took a while, and I am very happy with it. Version 0.5.0 covers all of Pi's interfaces on Pi 1.3.0. Out performs PiG 0.4.1 in every measurement. Piglets can now change PiG itself and you choose how lean PiG is. pi-in-go.dev
15
19
1
221
17,211
Pigpen holds 11 piglets with packages, all in Go, @zed & others support via a2a/acp/ahp, @herdrdev status, games, and a porter to help turn Pi extensions into Go. @stencil_labs tern piglet underway along side "pig strip" and more. Contributions welcome! 🐷
🤖 Made with AI
9
251
As always shout out da herd, you're amazing 🐷 🐷 🐷
1
1
11
679
🐷 PiG 0.4.1 is out, following Pi 1.0.3 🐷 (1.0.4 coming) github.com/MichaelKinsy/PiG/… Piglets are getting an official home including the gem that is this demo (sound on), pig-music 🪕🐖🪇 github.com/MichaelKinsy/pigp…
3
2
61
4,127