• Hi Gunther,

    It's probably best if I answer in order:

    1. Yes - just look at targets/linux/main.c to see how this works.

    2. That's more difficult I'm afraid - you can dynamically read the values of variables but you can't yet write them. Of course you could always add getMyVar() and setMyVar(123) functions. The other option is to read the value of the JavaScript variable whenever you want it.

    3. It's probably best to just define your functions with the specially formatted comments in the header, and they'll be added at compile time. See jswrap_*.c to see how it works.

    Having said all that, it might be worth looking at something like duktape instead. Espruino is designed for chips with 8-128kB RAM. As such it's really efficient for them, but if you start to use it for bigger things then it will probably start to show some weaknesses (like in the handling of big arrays).


Avatar for Gordon @Gordon started