7 ms·
First off, this is cool. It is tremendously exciting to see the bar for hardware hacking getting lower and lower. To the people complaining "Why JS? C is fine!"
by eob 13y ago
First off, this is cool. It is tremendously exciting to see the bar for hardware hacking getting lower and lower. To the people complaining "Why JS? C is fine!", remember that once the complaint was "Why C? ASM is fine!".
At the same time, I can't help but grin that we on the CS side find a way to erase all the gains in performance and efficiency as soon as the EE guys make them.
There has to be come kind of universal constant: the limit, as technology proceeds into the future, of the execution time of "Hello World" is some fixed number. Because as soon as we get better hardware, we invent an even weightier runtime environment to slap on it. ;)
- CompelTechnic 13y agoAs it was spoken: Javascript shall conquer all- Atwood's Law: http://www.codinghorror.com/blog/2007/07/the-principle-of-least-power.html http://www.codinghorror.com/blog/2007/07/the-principle-of-le...
- jkscm 13y agoI don't think the language has been the problem. Just look at the Arduino. For me, the main challenges always were getting the program onto a chip and wiring everthing so that is does not break or shortcut.
- zhemao 13y agoErrrrm, if you ever look at the AVR C library that Arduino was based off of, you would probably not be so quick to say that it isn't a language issue. Not having to know the weird unpronounceable mnemonic for a certain register as well as the specific bit in that register that you set in order to trigger the ADC is a huge plus. Greater abstraction is always welcome if the hardware can handle it. Although I agree with you that Arduino C is simple enough for most microcontroller programs and Javascript is a bit overkill.
- WalterSear 13y agoFor now...
- 10098 13y agoI don't have much problem with programming an embedded device in a high-level language, but why JS specifically? Why not Lua, which just as fast, and is better than javascript in many respects?
- seldo 13y agoI would have thought this was obvious, but orders of magnitude more developers know Javascript than Lua[1], thanks largely to the popularity of browsers as a programming environment. According to some recent research[2], the three primary factors affecting the adoption of a programming language by developers are, in this order: 1. Libraries available 2. Familiarity 3. Performance And per the paper, this order of preference is extremely strong. Which means, because of the huge mass of Javascript developers out there, that as soon as a library becomes available to do something in Javascript, Javascript will rapidly become the most popular way to do that thing, regardless of the performance hit. [1] http://redmonk.com/sogrady/2012/09/12/language-rankings-9-12/ http://redmonk.com/sogrady/2012/09/12/language-rankings-9-12... [2] http://www.eecs.berkeley.edu/~lmeyerov/projects/socioplt/papers/adoptquant.pdf http://www.eecs.berkeley.edu/~lmeyerov/projects/socioplt/pap...
- taylorbuley 13y agoI think JavaScript might be most successful on Arduino for the same reason - it's a platform with which most tinkerers are familiar. http://blog.safaribooksonline.com/2013/07/16/javascript-powered-arduino-with-johnny-five/ http://blog.safaribooksonline.com/2013/07/16/javascript-powe...
- tlrobinson 13y agoI suspect Arduino (at least the ones I've used, Uno?) are a bit underpowered for higher level managed languages like JavaScript.
- wyager 13y agoAbsolutely. On AVRs, `new` and `malloc` work, but just barely. RAII/stack-only programming is basically a necessity. That is simply not possible with languages like Python or Javascript.
- ucarion 13y agohttp://en.wikipedia.org/wiki/Wirth's_law http://en.wikipedia.org/wiki/Wirth's_law
- coldtea 13y ago>At the same time, I can't help but grin that we on the CS side find a way to erase all the gains in performance and efficiency as soon as the EE guys make them. That's one way to see it. Another is that we don't erase them: we put them to use so programming can be more widespread, easier and more ambitious in scope. (E.g. you cannot practically write a 10.000.000 line program in ASM, whereas you can in C. Or you cannot have everyone be able to write a 200 line high level program that does something complex in C, but you can in Python).
- 14113 13y agoYou can. Rollercoaster tycoon was originally written in pure ASM. Allowing programming to be more widespread is a noble cause, but there comes a point (and I think it is approaching rapidly) where you layer so much abstration between the machine and the programmer, that they're guaranteed to write poor, or at least slow code. We need to find a middle ground, and I think javascript pulls in the wrong direction to this.
- pjmlp 13y agoLike Lotus 1-2-3 as well, and lots of other software back in the 8 and 16 bit days.
- lmm 13y agoYeah, but writing a large, maintainable program in Javascript is if anything even harder than in C.
- btilly 13y agoAt the same time, I can't help but grin that we on the CS side find a way to erase all the gains in performance and efficiency as soon as the EE guys make them. This is a long-noted phenomena. The old saying that summed it up was, "Andy giveth, Bill taketh away." (Referring to Andy Grove of Intel and Bill Gates of Microsoft.)
- knz42 13y agoIn its most extreme form it's also known as "Wirth's law" https://en.wikipedia.org/wiki/Wirth%27s_law https://en.wikipedia.org/wiki/Wirth%27s_law
- aufreak3 13y agoAt the same time, I can't help but grin that we on the CS side find a way to erase all the gains in performance and efficiency as soon as the EE guys make them. Here is one way I can think of - add a layer to run a subset of Scheme on this :)
- cpeterso 13y agoThe joke I've heard is that software is a gas and expands to fill the available space.