Saloc
Saloc on Hacker News
Nice project! Im curious, did you had a look on performance vs. a baseline tensor framework? With Copapy I was initially surprised that in many non ANN applications for vector and matrix operations such a scalar approach can be (due to sparcity) much faster than a tensor based implementation like numpy.
Posted by
Saloc on Thursday June 04, 2026 @08:37AM
from the show-hn dept.
https://github.com/DLR-Institute-of-Future-Fuels/rair
I hate keeping extensive notes of experiments. When iterating fast, it feels to break the flow. However when keeping all adjustments in mind - its only a question of time until valuable info gets lost.Therefore I build Rair to track results, inputs and code with minimal overhead. Putting "rair" in front of the command without any config is often sufficient.For code tracking, Rair references...
In some fields its quite common to implement state machines in an imperative style with if-blocks and flags. That should be possible with Copapy by having decorated functions where the decorator parses the AST and replaces if-blocks with cp.iif() to end up with branchless code.
However, from my experience this programming style is ok for simple state machines, but it’s definitely not great, and if things get more complex, it’s getting really hard to keep it comprehensible and correct.
I think the main challenge is the design of an API that fits state machines. Concerning the WCET, branchless code should be on average not worse than branched code.
Casadi uses either an interpreter or emits c-code, where Copapy directly runs machine code. Would be very interesting to benchmark Copapy against compiled Casadi c-code – looking into it.
Thanks for your comment, I'll give a full write up a try.
I think for deterministic control applications this concept has a sweet spot. While in conventional code the number of branch combinations can blow up easely, here you need to be able to guarantee worst case execution time which forces you anyway to be very carefull with branching.
On https://copapy.nonan.net/compiler.html is the how-it-works readme section extended with the generated machine code for stencils and a simple example.
Posted by
Saloc on Wednesday February 11, 2026 @03:34AM
from the show-hn dept.
https://github.com/Nonannet/copapy
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....
Posted by
Saloc on Thursday January 08, 2026 @08:24AM
from the show-hn dept.
https://copapy.nonan.net
Copapy is an experiment in making Python usable for hard real-time systems by removing almost everything that makes Python non-deterministic.Instead of an interpreter or JIT, Copapy builds a computation graph by tracing Python code and uses a copy-and-patch compiler to assemble machine code from precompiled templates, patched at compile time. The result is static native code with no GC, no...
What about correlating transmitted wireless frames with a LED flashing pattern? If the glasses stream video with a variable bitrate codec over wireless, flashing vs. non-flashing should change bandwidth and therefore frame frequency. However, with searching over all channels this might be quite slow in practice.
For non-professional application it’s not the cheapest option, however on the used marked I payed 82 € for my last ethernet bus cupper plus 3 digital IO terminals. Often used Beckhoff variants of the functional identical terminal are a little bit cheaper than WAGO – might have to do with the different market segment they targeting. In a professional setting the hardware costs compensate often easily for saved working hours in debugging flimsy screw terminal connections and dubious firmware flaws. Also, the cheap options often need more than 5 times the control cabinet real estate per IO, witch alone can compensate for the higher price.
Posted by
Saloc on Wednesday July 09, 2025 @07:33AM
from the show-hn dept.
https://github.com/Nonannet/pyhoff
Built this Python package because I wanted to run hardware controlling ML stuff and other control algorithms directly connected to industrial I/O hardware without jumping into annoying PLC toolchains (Windows only, licensing hassle, no editor choice, proprietary version control - you name it). For sure its not for ms‑cycle loops, or uptime critical production stuff, but in applications with...
To avoid the discussion where around the critical point it is a gas or not a gas ;) Sure, for ideal gases it’s quite clear; however I’m looking for adding real gas behavior to capture high density supercritical fluids - being able to model high pressure processes. For example for the synthesis of hydrocarbons and chemical compound made from nitrogen and hydrogen.
I would say it depends on the application: For energy stuff, ideal gas + water/steam might be sufficient. Rolling a lightweight process simulation framework (e.g. on top of gaspype and pint) easily competes with the costs for an aspen license. For other applications, that requires solving multiple phases of mixtures, the tradeoff shift quite allot.
That looks like a valuable resource, thank you! I already mostly stuck to a subset supported by NumPy and JAX (because that's the array libraries I'm familiar with). I hope the other are not to far off...
Posted by
Saloc on Friday July 04, 2025 @07:48AM
from the show-hn dept.
https://dlr-institute-of-future-fuels.github.io/gaspype/
I built gaspype, a Python library for fast thermodynamic calculations, like equilibrium reactions. It's lightweight, written in typed Python/Numpy, and comes with a large species database.Gaspype operates on multidimensional arrays for composition, temperature and pressure. It is designed for a flat learning curve and compact syntax for pocket calculator-like use in Jupyter Notebooks, as well...
Posted by
Saloc on Monday April 14, 2025 @03:25PM
from the show-hn dept.
https://github.com/Nonannet/pyladoc
I've been working on Pyladoc, a Python package designed for web apps that generate data rich documents from code. It outputs HTML and LaTeX/PDF with Pandas tables and Matplotlib figures. No fancy interactive js - simple solid static outputs with all figures and formulas embedded in a single piece of HTML or LaTeX code.