News for hackers. Stuff that matters.
Re:mJS – A new approach to embedded scripting by hackcasual on Wednesday January 25, 2017 @03:42PM (#13485842)
I'd wager a large amount of that is handling symbol lookup for calling through the FFI.
Re:mJS – A new approach to embedded scripting by nneonneo on Wednesday January 25, 2017 @04:15PM (#13486188)
I quote the mJS readme from the repo:

> In order to make FFI work, mJS must be able to get the address of a C function by its name. On POSIX systems, dlsym() API can do that. On Windows, GetProcAddress(). On embedded systems, a system resolver should be either manually written, or be implemented with some aid from a firmware linker script.

So I guess they don't provide any implementation for their FFI linking on embedded platforms? It's not clear if the 25k size figure includes any dlsym support, but if it requires instrumenting your firmware image on-disk then the size costs could balloon significantly.

Re:mJS – A new approach to embedded scripting by drozd on Wednesday January 25, 2017 @04:48PM (#13486538)
Currently we use mJS in our Mongoose OS firmware framework. There, a symbol resolver is generated automatically from the configuration file which tells which symbols you'd like to use.

https://github.com/cesanta/mongoose-os/blob/master/fw/exampl...