Why to send js code to MCU when you can send instruction or hex file to M.C.U like arduino. #4254
Replies: 1 comment
-
Posted at 2014-12-03 by @gfwilliams Hi, Websites like mbed already do that kind of thing (for C) - and yes, it's faster and you can get more inside. But...
I'm sure there's plenty more too - basically if you don't need any of that then compiled code is better. With Espruino you can actually dynamically add Assembler code functions right now, and it's a relatively small step to compile C code and use that instead. I have been seriously considering compiling JavaScript functions to ARM assembler in the Web IDE and using the same method to link them in - and when I get time I'll be looking into it more closely. While you won't get the same stack traces, it would increase execution speed dramatically. Posted at 2014-12-03 by Manxome I think many MCU's are very similar. Platform 1 has this amount of memory, that MHz, some digital pins, some analog pins, usarts, i2c's, spi's, etc. and you program it in C/C++. Platform 2 has more or less of each and you program it in C/C++. Espruino has some of all those things too, EXCEPT you get to program it in JavaScript (yes!) and you get to do it interactively (yes!) and that allows options that are not so easy for other platforms. So Expruino offers a niche which might or might not appeal to someone. But I really like having more options :) Posted at 2014-12-03 by DrAzzy If you want to compile code and flash it to the MCU, there are many many existing options for this. While you get more performance, and more storage, you'd also lose all the things about Espruino that make it unique. Being able to run arbitrary JS from text over serial, or in http request/response really opens up a lot of possibilities. Plus, the interactive debugging is huge. I find that the development process on Espruino is much faster than Arduino, largely because you can run test code interactively. When something doesn't work as expected, you can go in and look at and change variables, run code, and even modify functions interactively. On arduino (or other compile + flash platforms), unless you're prepared to do hardware debugging over jtag or something, all you can do is add logging, flash it, and hope you put the logging in the right place to give you need to know. Posted at 2014-12-08 by user50191 I just thought espruino was built only to bring js developers to embedded world but after viewing all your responses. I change my view. It is interesting to have interactive debugging in embedded systems rather than flashing it every time or using jtag. Thank you all! for clearing away misconceptions on espruino. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-12-02 by user50191
When I read kickstarter page. It says that espruino doesn't employ any Operating System but uses specialized firmware for interpreting, processing, and scheduling as the memory is so low that O.S can't sit inside.
https://www.kickstarter.com/projects/gfw/espruino-pico-javascript-on-a-usb-stick
Boards used by espruino come under stm32 family and below is the link to program them by assembly language.
http://www.st.com/web/en/resource/technical/document/programming_manual/CD00228163.pdf
My argument is that why not espruino webide (by espruino) convert the js code to instruction set and then flash the M.C.U, in that way we can save more memory and put more code inside.
Beta Was this translation helpful? Give feedback.
All reactions