• Not sure. But I know the converse is possible: you can write libraries in C, and expose methods as JavaScript objects and functions.

    When you build Espruino, the build scripts scan your C code for /*JSON{… comments, in which you describe the mapping between C and JavaScript.

    Some of that is documented here:
    https://github.com/espruino/Espruino/blob/master/libs/README.md

    I'd also suggest taking a look at the C source of Espruino's built-in libraries, like Math, to see actually working examples.

About

Avatar for oesterle @oesterle started