{"by":"Saloc","descendants":10,"id":46972392,"kids":[47023558,47023233,47027805,47027675,47033803,47026457,47029476,47023960],"score":65,"text":"I built Copapy as an experiment: Can Python be used for hard real-time systems?<p>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.<p>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.<p>The current focus is on robotics and control systems in general. This project is early but already usable and easy to try out.<p>Would love your feedback!","time":1770798891,"title":"Show HN: Copy-and-patch compiler for hard real-time Python","type":"story","url":"https://github.com/Nonannet/copapy"}