Show HN: Pyproc – Call Python from Go Without CGO or Microservices

Hacker News (score: 16)
Found: September 16, 2025
ID: 1415

Description

API/SDK
Show HN: Pyproc – Call Python from Go Without CGO or Microservices Hi HN!I built *pyproc* to let Go services call Python like a local function — *no CGO and no separate microservice*. It runs a pool of Python worker processes and talks over *Unix Domain Sockets* on the same host/pod, so you get low overhead, process isolation, and parallelism beyond the GIL.

*Why this exists*

* Keep your Go service, reuse Python/NumPy/pandas/PyTorch/scikit-learn. * Avoid network hops, service discovery, and ops burden of a separate Python service.

*Quick try (\~5 minutes)*

Go (app):

``` go get github.com/YuminosukeSato/pyproc@latest ```

Python (worker):

``` pip install pyproc-worker ```

Minimal worker (Python):

``` from pyproc_worker import expose, run_worker @expose def predict(req): return {"result": req["value"] * 2} if __name__ == "__main__": run_worker() ```

Call from Go:

``` import ( "context" "fmt" "github.com/YuminosukeSato/pyproc/pkg/pyproc" ) func main() { pool, _ := pyproc.NewPool(pyproc.PoolOptions{ Config: pyproc.PoolConfig{Workers: 4, MaxInFlight: 10}, WorkerConfig: pyproc.WorkerConfig{SocketPath: "/tmp/pyproc.sock", PythonExec: "python3", WorkerScript: "worker.py"}, }, nil) _ = pool.Start(context.Background()) defer pool.Shutdown(context.Background()) var out map[string]any _ = pool.Call(context.Background(), "predict", map[string]any{"value": 42}, &out) fmt.Println(out["result"]) // 84 } ```

*Scope / limits*

* Same-host/pod only (UDS). Linux/macOS supported; Windows named pipes not yet. * Best for request/response payloads ≲ \~100 KB JSON; GPU orchestration and cross-host serving are out of scope.

*Benchmarks (indicative)*

* Local M1, simple JSON: \~*45µs p50* and *\~200k req/s* with 8 workers. Your numbers will vary.

*What’s included*

* Pure Go client (no CGO), Python worker lib, pool, health checks, graceful restarts, and examples.

*Docs & code*

* README, design/ops/security docs, pkg.go.dev: [https://github.com/YuminosukeSato/pyproc](https://github.com/YuminosukeSato/pyproc)

*License*

* Apache-2.0. Current release: v0.2.x.

*Feedback welcome*

* API ergonomics, failure modes under load, and priorities for codecs/transports (e.g., Arrow IPC, gRPC-over-UDS).

---

Source for details: project README and docs. ([github.com][1])

[1]: https://github.com/YuminosukeSato/pyproc "GitHub - YuminosukeSato/pyproc: Call Python from Go without CGO or microservices - Unix domain socket based IPC for ML inference and data processin"

More from Hacker

Show HN: I built a tool to assist AI agents to know when a PR is good to go

Show HN: I built a tool to assist AI agents to know when a PR is good to go I&#x27;ve been using Claude Code heavily, and kept hitting the same issue: the agent would push changes, respond to reviews, wait for CI... but never really know when it was done.<p>It would poll CI in loops. Miss actionable comments buried among 15 CodeRabbit suggestions. Or declare victory while threads were still unresolved.<p>The core problem: no deterministic way for an agent to know a PR is ready to merge.<p>So I built gtg (Good To Go). One command, one answer:<p>$ gtg 123 OK PR #123: READY CI: success (5&#x2F;5 passed) Threads: 3&#x2F;3 resolved<p>It aggregates CI status, classifies review comments (actionable vs. noise), and tracks thread resolution. Returns JSON for agents or human-readable text.<p>The comment classification is the interesting part — it understands CodeRabbit severity markers, Greptile patterns, Claude&#x27;s blocking&#x2F;approval language. &quot;Critical: SQL injection&quot; gets flagged; &quot;Nice refactor!&quot; doesn&#x27;t.<p>MIT licensed, pure Python. I use this daily in a larger agent orchestration system — would love feedback from others building similar workflows.

Generate QR Codes with Pure SQL in PostgreSQL

Generate QR Codes with Pure SQL in PostgreSQL

Obelisk 0.32: Cancellation, WebAPI, Postgres

Obelisk 0.32: Cancellation, WebAPI, Postgres

Show HN: A Claude Code plugin that catch destructive Git and filesystem commands

Show HN: A Claude Code plugin that catch destructive Git and filesystem commands

No other tools from this source yet.