Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

JavaScript API docs disappeared?

I realize you guys decided to not support it anymore and even to have JavaScript disabled by default in the firmware, but now I am not seeing the API documentation being shown on your website anywhere? I need to refer to it at times, can you at least host it on your website somewhere and provide a link to it?

Comments

  • SergeySergey Dublin, Ireland

    Bill,
    We're not sunsetting JavaScript. We're doing a major refactoring of it, so for the time being, we hid it.
    The docs sources are here: https://github.com/cesanta/mongoose-iot/tree/master/docs
    JS docs: https://github.com/cesanta/mongoose-iot/tree/master/docs/javascript-api

  • CapstanCapstan Texas, USA

    Not sunsetting JavaScript? That is news to me, but very glad to hear it. Do you have a post somewhere (blog etc?) that describes your current plan for JavaScript? What is the expected timeframe and what will be new about the revised implementation?

    Thanks for the link to the docs!

  • SergeySergey Dublin, Ireland

    We have only a general plan: greatly simplify the engine, reduce complexity and footprint, and improve C/JS glue. Ideally, one should be able to import C functions from JS with no C coding - directly from JS, and use them. This way the support for many libraries, like Neopixel, could be done trivially. We want our JS engine to be the one which rules in embedded.
    No timeline for that yet, we're doing research and experimenting.

  • CapstanCapstan Texas, USA

    It sounds excellent, I hope you can make it happen. Better memory management for strings would be a welcome improvement of course. And some way to debug would be a game changer, ideally with the Chrome debugger similar to what can be done with Node.js.

    What about the ESP32? Seeing as how it has much more memory and horsepower at a price that is just slightly higher, seems like it would be a great candidate for a port.

  • SergeySergey Dublin, Ireland
    edited November 2016

    Implementing a good debugging support is tricky. We don't have cycles for that at this moment, but have that in mind.
    ESP32 is in the works already!

  • Do you have any news about JavaScript support?
    Currently mgos builds some firmware if I try to enable JS but the built firmware enters reboot loop.

  • SergeySergey Dublin, Ireland
    edited January 2017

    JS support is gradually coming back.
    Now, it is functional for some basic stuff.
    Try this firmware: https://github.com/cesanta/mongoose-os/tree/master/fw/examples/mjs_hello

    Make sure to download the latest mgos tool. Use mgos put examples/... init.js && mgos console to try different example JS scripts.
    Currently, GPIO operations, some system stats, and some MQTT functionality is supported.

    JS engine has almost zero built-in API, everything it needs, it loads directly from C.

Sign In or Register to comment.