Nicheloom

Market intelligence for builders — see what's gaining traction before it's crowded.

Copy-and-patch compiler for hard real-time Python

Details

External ID
46972392
Source
HN
Company
—
Product
Copy-and-patch compiler for hard real-time Python
Website domain
github.com
Launched
Feb. 11, 2026
Cohort
—
Upvotes
65
Upvotes percentile
0.8504043126684636
Tags
—
Fetched at
Sept. 7, 2026, 9:25 p.m.
Updated at
Sept. 7, 2026, 9:25 p.m.

Description

I built Copapy as an experiment: Can Python be used for hard real-time systems?Instead of an interpreter or JIT, Copapy builds a computation graph by tracing Python code and uses a custom copy-and-patch compiler. The result is very fast native code with no GC, no syscalls, and no memory allocations at runtime.The copy-and-patch compiler currently supports x86_64 as well as 32- and 64-bit ARM. It comes as small Python package with no other dependencies - no cross-compiler, nothing except Python.The current focus is on robotics and control systems in general. This project is early but already usable and easy to try out.Would love your feedback!

Enrichment

Theme
Claude integrations and coding agents
Vertical
Horizontal
Function
Dev tools
Audience
Developer
AI stance
Not AI
Project type
Hobby / open-source project
Normalized one-liner
copy-and-patch compiler for real-time python
Manually corrected
False

Could you build this?

No Developing a custom copy-and-patch compiler that eliminates dynamic allocations, syscalls, and garbage collection requires deep compiler engineering and low-level systems expertise.

What it would actually take: A production version requires an AST or bytecode tracer that lowers Python code into a deterministic computation graph, paired with a library of precompiled binary stubs. The runtime must dynamically resolve relocations and stitch machine code into executable memory pages without relying on standard CPython runtime features, garbage collection, or OS allocations. This demands specialized knowledge of compiler construction, CPU instruction sets, binary ABIs, and deterministic real-time systems.

Discussion

10 comments analyzed.

Competitors mentioned: CasADi (interpreted/compiled C-code approach), NumPy, Numba, Cython, Nanobind (for Python C API binding)

Concerns raised: Proof of concept status with limited direct use not stated upfront, Only achievable for code already designed with hard real-time in mind, Complex state machines become hard to comprehend and maintain, Unclear how approach scales beyond deterministic control applications

Feature requests: Benchmarks against compiled CasADi C-code, Support for imperative state machine patterns via AST-parsing decorator, Documentation of approach limitations and use case boundaries

Competitors

Other products that read as similar to this one — 82 launches clear the similarity bar, closest 8 shown.

Attention rank: #15 of 83 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).

Launched 100 days after the earliest competitor.

Other launches for this product

Same idea, different domain

Nobody's really built a dev tools tool for Sales yet.