3 ms·
I have seen analyses of ECM software; and I think they could benefit greatly from a new language. The priority seems to be reliable real-time computation, and
by microcolonel 11y ago
I have seen analyses of ECM software; and I think they could benefit greatly from a new language.
The priority seems to be reliable real-time computation, and the solution is to calculate everything as a continuous function. Anything that would be a branch is instead a binary mix of the conditions, triggered with a threshold function.
I can think of many ways of structuring programs which are spaghettiish in C, but would yield the desired results in an automotive ECM.
- woodman 11y agoI've tackled some problems that would have ideally, from a performance perspective, been implemented with very deeply nested if()'s. I've found a truth table like layout of bool evaluations to be a nice compromise between maintainability and performance: void doit(const tststructptr* in) { assert(in); /* Because we test our code, for safety */ const tststructptr t = *in; if ( t.t1 && t.t2 && t.t3) { f1(); } else if ( t.t1 && !t.t2 && t.t3) { f2(); } else if ( t.t1 && t.t2 && !t.t3) { f3(); } else /* TODO: Fix, this should never happen */ releasenerveagent(SLEEPINGQUARTERS); } A long sequence of ternary operators allow for a prettier layout, but is more error prone.