I hear they use embedded systems on airplanes, rockets and space vehicles. Javascript on embedded systems makes it so that your average front end developer can now make the software that controls auto pilot or Nuclear Power Plants!
> Javascript on embedded systems makes it so that your average front end developer can now make the software that controls auto pilot or Nuclear Power Plants!
You must be kidding, or you want to see everyone dies, right? JS does meet realtime constraints. Maybe someday when nodejs has event priorities, it would be much more interesting to use in that field.
I mean software development skill is only a small part of embedded system development used in autopilot and power plants. You need related engineering expertise (e.g Math) much more than writing C or JS.
I think GUIs and touch screens are the future of all embedded systems. No more buttons. Imagine the cockpit of a boeing 747 with all levers buttons and knobs removed. Just a giant LCD touch screen GUI coded by a bootcamp graduate in React + redux.
The plane would be more useable by the pilot as touchscreens are more versatile than old fashioned buttons. Also you would be more safe because if a lever or button fails on a flight you are pretty much screwed but if a touchscreen fails you can just reboot the touchscreen and you're good.
Come on, I also use JS for web, it doesn't mean I have to love it. Even it's creator admits low quality of his creation - it was made in a hurry.
Try to be objective - if not monopoly in web browsers, JS would never exist or gain popularity.
Modern TS is usable, agree. But I'm talking about non-browsers world, where we have not just "usable" languages, but languages with much better characteristics, much better suited for the Embedded Systems. And they have even bigger ecosystems.
Embedded spans a lot of different usecases and requirements. For lots of things a garbage collector is a non-issue.
Not everything has hard realtime requirements.
Neat stuff. What's all the hate is about. Not every embedded system is running real-time sensitive industrial machinery or medical equipment.
Many things like general consumer electronics can run fine with Node. The runtime is incredibly well-tested at this point, JS is easily learned and scriptable for extensibility, the single-threaded nature is easy to work with and fast enough, and managed memory makes it easy to crash and recover from failures.
Is it though? I'd prefer many other languages that are more convenient to code in that dealing with the quirks of JS, but I don't see why Node must be unreliable either. I think for simple devices this works just fine.
Most of the 'hate' has to do with the fact that the language isn't suited to platforms with memory constraints. Specifically there's semantics around closure capture that make it pretty easy to leak variables.
I've worked on platforms where we wrote the same logical code in JS and Lua, closures and all. The JS version leaked like a sieve while the Lua version was memory steady.
You can totally use gc'd, interpreted languages in the embedded space. I've used Lua on a product with 8mb of system ram in a 400kb block and it worked like a charm.
I think it is somewhat related to the hate around Electron.
You can develop great Eletron apps like VSCode but people hate most of Eletectron apps taking much memory and CPU load. This is mainly because of the developers who don't care about rhe differences between the desktop environment and the broswer environment e.g. users can click the refresh button in the browser when it's slow while it's not the case in the desktop environment.
I think the hate is not about JS language itself but about some offensive people who believe JS enough to develop everything and who are not willing to learn appropriate knowledges/languages in the field.
28 comments
[ 3.3 ms ] story [ 64.7 ms ] threadJavascript is taking over!
You must be kidding, or you want to see everyone dies, right? JS does meet realtime constraints. Maybe someday when nodejs has event priorities, it would be much more interesting to use in that field.
I mean software development skill is only a small part of embedded system development used in autopilot and power plants. You need related engineering expertise (e.g Math) much more than writing C or JS.
The plane would be more useable by the pilot as touchscreens are more versatile than old fashioned buttons. Also you would be more safe because if a lever or button fails on a flight you are pretty much screwed but if a touchscreen fails you can just reboot the touchscreen and you're good.
This isn't about C++.
ECMAScript has garbage collection.
So tell me... is predictable latency worse than a hard crash?
Hard real time stuff also is, by definition, broken code if you can't reason about worse case latency.
It's great for use on the web, just please keep it there!
Many things like general consumer electronics can run fine with Node. The runtime is incredibly well-tested at this point, JS is easily learned and scriptable for extensibility, the single-threaded nature is easy to work with and fast enough, and managed memory makes it easy to crash and recover from failures.
The end user does not care about developer convenience, cares about a working product that is reliable.
I've worked on platforms where we wrote the same logical code in JS and Lua, closures and all. The JS version leaked like a sieve while the Lua version was memory steady.
You can totally use gc'd, interpreted languages in the embedded space. I've used Lua on a product with 8mb of system ram in a 400kb block and it worked like a charm.
I think the hate is not about JS language itself but about some offensive people who believe JS enough to develop everything and who are not willing to learn appropriate knowledges/languages in the field.