News for hackers. Stuff that matters.
Re:mJS – A new approach to embedded scripting by drozd on Wednesday January 25, 2017 @01:57PM (#13484668)
Currently, mJS FFI is limited to functions only. And, to simple enough functions.

On how to access memory from mJS: write an accessor function!

    // C
    void setmem(uint8_t *ptr, int index, int value) {
      ptr[index] = value;
    }

    // mJS
    let setmem = ffi('void setmem(void *, int, int)');
    let malloc = ffi('void *malloc(int)');
    let mem = malloc(10);
    setmem(mem, 3, 5);

There are no comments on this comment yet.