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

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 allocation…

- **Page:** https://magpie.gallery/i/copy-and-patch-compiler-for-hard-real-time-python-4rk5
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Runs on:** linux
- **Tags:** compiler, python, real-time, robotics, embedded

## Source

Web · Saloc: Copy-and-patch compiler for hard real-time Python

- **Original:** https://news.ycombinator.com/item?id=46972392

> 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! https://github.com/Nonannet/copapy

## GitHub projects

- https://github.com/Nonannet/copapy

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
