5 ms·
I've never worked with embedded systems, so forgive my ignorance. Why is this any more useful than just writing c code, if all the code that actually interacts
by jdormit 10y ago
I've never worked with embedded systems, so forgive my ignorance. Why is this any more useful than just writing c code, if all the code that actually interacts with the hardware has to be written in c anyway?
- devty 10y agoI'm wondering the same thing. What does having a JS syntax bring to embedded programming?
- steego 10y agoScripting is rarely about syntax. It's about being able to load code dynamically, being able to create ad-hoc data structures, quick changes and distributing executables as source rather than binaries.
- GFK_of_xmaspast 10y agoNone of which are particularly appropriate for embedded programming.
- jononor 10y agoAgreed that on-a-whole JS is not appropriate for embedded devices. However allowing scripting may be useful in particular pieces of the code, to allow easy extension / customization.
- drozd 10y agoI recall that very much the same opinions were expressed about the JS and backend programming, until node.js appeared. Now the reality is different. To be honest, we do not think that JS is a good language for embedded. Like any other existing popular scripting language. Perhaps scripted Go would be a better choice. The point is that in many, many cases scripting brings a lot of benefits to the embedded environment. It all depends on a specific tasks - for some tasks, scripting will never be appropriate.
- steego 10y agoI would prefer to see a scripted Go over JS for embedded environments.
- steego 10y agoAll of these which are very appropriate for a company who wants to sell hobbyist kits to kids who already know JavaScript, so they can built IoT toys quickly. I understand your point. These tools aren't appropriate for serious embedded systems, but they're also not meant for them. They're meant for people who want to have fun and want to play with things quickly.
- carussell 10y agoI've adopted a rule where I try to replace a sentence, thought, or expression with, "That's different from how we do things right now," and then try to see if it changes the meaning of what was actually said. Mostly, this is useful when the comment serves to justify shooting down another idea. "We can't do things that way, because we do things a different way", is something that many people will automatically recognize as a bad argument if you put it that way. (It's in the same bucket as, "Well, nobody has ever complained before.") But anyone—even by accident—can end up using this argument while saying different words. The effect is that it comes in a different package that's more difficult to spot. In the end, though, it's the same invalid discussion killer. Anyway, that's a lot of exposition. What I came here to say is that your comment is tripping the filter for me right now. What's inappropriate about a fast development feedback cycle when doing embedded programming?
- Thrillington 10y agoThe answer is nothing is wrong. Some form of shell, stack or scripting language is a super useful tool in the prototyping stages. It might not meet timing requirements for a final system, but at the beginning of a project it's great.
- zokier 10y agoOne possible use top of my head would be vendor customization. For example Foo Inc is manufacturing some hot IoT widget which is then sold and branded by Bar Ltd. Foo can take care of all the nitty gritty low level details and provide nice high level SDK for Bar to make their customizations.
- rwj 10y agoThe low-level hardware access is handled using C, but presumably people want to write higher-level code on top of that. It doesn't seem that unusual.
- drozd 10y agoThe ability to script without the need of rebuilding/reflashing the whole firmware is often fairly useful. The most value is not in JS per se, but in the ability to script.
- jdormit 10y agoAh, I can see how that is useful. Way up in the web dev world I don't often have to think of things like that :)
- bryanlarsen 10y ago1) A lot of embedded projects have HTTP interfaces for command & control. So that means you usually have somebody on the team who knows HTML & CSS & the giant pile of tech that is web dev these days. Which means they probably are more familiar with JS than C or any other more typical embedded scripting language like Lua. 2) C needs to be compiled and often flashed onto the device to run, sending new JS over the wire to execute is a lot more convenient, especially if you want customers to be able to customize their devices.
- GFK_of_xmaspast 10y agoHaven't you heard that when you want to get close to the metal you drop down to node.js?
- poseid 10y agoa nice graphic on the layers of an embedded software is this: http://www.limifrog.io/wordpress/wp-content/uploads/2015/07/LimiFrog_SW_Organization.jpg http://www.limifrog.io/wordpress/wp-content/uploads/2015/07/... - getting the toolchain running to blink a LED takes some efforts. With scripting, you could save time in the context of prototyping a connected experience (networking, hardware, network protocols)