Litttlefoot for DSP

Hi Jules,

is it possible to use Littlefoot for protoyping DSP algorithms? I am currently using a combination of the Javascript Engine and the TInyC compiler but if could replace the TCC with Littlefoot, it would be great (I expect the performance to be similar).

From what I could read about Littlefoot, these things are not implemented:

  • native float type
  • native arrays with pointer arithmetics
  • ability to add C-functions with a low overhead (so I can provide wrapper functions for eg. vector operations or common math functions)

Would it be hard to add these features? Using Littlefoot for the most inner loop with almost native performance and gluing it together with Javascript would make an awesome DSP development platform.

It does have floats, but doesn’t have arrays yet… TBH I think it’d probably run slower than the javascript interpreter, because it’s designed for a different use-case, though I can’t be sure of that.

I see. I skimmed through the code and eg. the LiteralValue also uses var as internal data type so it has to convert it to double / float for each operation too - this (and the virtual function calls for getResult and perform) are the bottlenecks on the Javascript engine too - aside from not being magically optimized by a “real” C++ compiler.

I’ll stick with TCC then. I just looked the ADC video where you considered TCC as alternative before writing Littlefoot and hoped it also works the other way round. Thanks for clarification!