Skip to content

Add Zig + Python C-API demo with FlatAgents integration#2

Draft
memgrafter wants to merge 8 commits into
mainfrom
claude/zig-python-capi-rWNAd
Draft

Add Zig + Python C-API demo with FlatAgents integration#2
memgrafter wants to merge 8 commits into
mainfrom
claude/zig-python-capi-rWNAd

Conversation

@memgrafter

Copy link
Copy Markdown
Owner

This demo showcases direct integration between Zig and Python using
the Python C-API, with zero wrapper overhead. Key features:

  • Zig code using @cImport to ingest Python.h directly
  • Native Python extension module (not ctypes)
  • Prime number computation with native C performance
  • FlatMachine orchestration with LLM task generation and analysis
  • Complete build system with Makefile and build.zig

The demo includes:

  • Zig source with proper Python C-API integration
  • FlatAgent configs for task generation and analysis
  • FlatMachine state machine for orchestration
  • Custom hooks for Zig compute execution
  • Comprehensive documentation and quick-start script

This demonstrates the "Zig loves Python C-API" concept with a
production-ready example that's much better than simple ctypes usage.

memgrafter and others added 8 commits January 6, 2026 09:13
This demo showcases direct integration between Zig and Python using
the Python C-API, with zero wrapper overhead. Key features:

- Zig code using @cImport to ingest Python.h directly
- Native Python extension module (not ctypes)
- Prime number computation with native C performance
- FlatMachine orchestration with LLM task generation and analysis
- Complete build system with Makefile and build.zig

The demo includes:
- Zig source with proper Python C-API integration
- FlatAgent configs for task generation and analysis
- FlatMachine state machine for orchestration
- Custom hooks for Zig compute execution
- Comprehensive documentation and quick-start script

This demonstrates the "Zig loves Python C-API" concept with a
production-ready example that's much better than simple ctypes usage.
@memgrafter memgrafter force-pushed the main branch 2 times, most recently from f5983f3 to d4468db Compare January 22, 2026 12:18
@memgrafter memgrafter marked this pull request as draft March 4, 2026 20:20
@memgrafter memgrafter added the invalid This doesn't seem right label Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants