Recent submissions

Comment · 3 years ago
The linker script specifies that .data section starts where 192k RAM region starts - in other words, addresses of all variables, etc, are in the RAM memory range.

But the firmware image (that resides on flash), which has .text and .data concatenated, has that .data section in Flash region, obviously. So we have .data section residing in Flash region, but all its addresses in the RAM memory range. That's why it is necessary to copy it over manually.

Hope this is clear... Let me know if not!

Comment · 9 years ago
Fast prototyping is the answer. If you or some others are skilled in C/C++, you don't need JS.

For others, having a simple way to prototype fast on the target hardware is a big benefit.

Comment · 9 years ago
mJS allows you to use C/C++ SDK functions directly without writing a glue code - basically, you can prototype things quite fast with the libraries/drivers that do not have any scripting support yet.
Comment · 9 years ago
That's right, cause Linux cannot run on the large class of microcontrollers - particularly, those with less than 4M of RAM. Mongoose OS is targeting that category.
Comment · 9 years ago
JS is for prototyping.
Comment · 9 years ago
Sure, try to run those on e.g. TI CC3200 microcontroller.
Comment · 9 years ago
Comment · 9 years ago
Ah, thanks, wrong about flash footprint. Neil has done a great job adopting Duktape on ESP32.
Comment · 9 years ago
Hi Gordon! Nice to meet you :) I am the author of the article, and I am quite fond of Espruino, it's a great project. Wasn't aware that Espruino has FFI API!
Comment · 9 years ago
Yes. Closures add quite a bit of complexity and footprint. Anticipated use case was a short script that orchestrates the device logic, calling existing SDK functions.
Comment · 9 years ago
Nice! I wasn't aware of lua ffi api, thank you!
Comment · 9 years ago
Nope. It's similar though, cause some of the concepts, and the code, were reused. mJS does not need an embedding API, really. The intent is that FFI is used.
Comment · 9 years ago
Embedded environment in this context means hardware low on resources, e.g. microcontrollers. Your perception of that word is "embedded into the C/C++ program". These are two different things. I agree that Lua (like some other languages) were designed to be embedded into C/C++ apps.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton