OK, can you show whole method you are trying to compile? it is worth to restructuring it so only the computational part is inside "compiled" and the code mostly looks like pure C. You may also consider Inline C which produces much smaller and faster code and is easier to distribute.
InlineC is not easy when you need to call into JS methods or use JS variables but for passing data in/out there are workarounds with passing flat array pointers. Recently I tried to use "compiled" code and basically I only took the result of the compiler as inspiration and used it directly inside Inline C. Also I needed to hack the compiler to not to hardcode value of EXPTR inside the binary so it can work across different build versions.
© Espruino, powered by microcosm.
Report a problem