HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Saloc

no profile record

Submissions

Show HN: Reproducible experiments without committing every tweak

github.com
3 points·by Saloc·last month·0 comments

Show HN: Copy-and-patch compiler for hard real-time Python

github.com
65 points·by Saloc·5 months ago·10 comments

Show HN: High deterministic real time in Python with copy and patch compiler

copapy.nonan.net
2 points·by Saloc·6 months ago·0 comments

comments

Saloc
·21 days ago·discuss
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.
Saloc
·5 months ago·discuss
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.
Saloc
·5 months ago·discuss
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.
Saloc
·5 months ago·discuss
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.
Saloc
·8 months ago·discuss
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.