Live data from Hacker News

JavaScript right on the hardware

technical.io

111–120 of 320 posts

Re: JavaScript right on the hardware

#111
post #28

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 universa…

>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).

Re: JavaScript right on the hardware

#112

Forgive me for not being hip but why try so hard to put JS in new places? It seems to be just an unfortunate historical accident that JS is one of the most popular languages in the world - does anyone actually like it compared to other modern scripting languages? Could we invest in CoffeeScript instead, at the very least?

JavaScript certainly has it's quirks, but if you get to know it it's not a bad language. And since CoffeeScript compiles to JavaScript you can use it anywhere JS runs...

It's not a bad language as long as you know it well enough to know which parts of it are the bad parts so you can avoid them.

...and that's what makes it a bad language.

Re: JavaScript right on the hardware

#114

Forgive me for not being hip but why try so hard to put JS in new places? It seems to be just an unfortunate historical accident that JS is one of the most popular languages in the world - does anyone actually like it compared to other modern scripting languages? Could we invest in CoffeeScript instead, at the very least?

Because everyone* knows JavaScript. I'd wager that the vast majority of professional software engineers work on the web, or very close to the web, and JavaScript is the lingua franca of the web. I mean just look at the front page of Hacker News on any given week. It's full of talk of JavaScript and new JavaScript libraries and new things to do in JavaScript. When you think about how many more people this can reach wi…

Everybody thinks they know javascript, but on the contrary nobody actually knows it. It's a very twisted and powerful language. It has many quirks and many unknowns.

Most of the time if one thinks s/he knows javascript, actually s/he knows a higher level abstraction library and DOM built on javascript like Jquery.

Re: JavaScript right on the hardware

#115

Forgive me for not being hip but why try so hard to put JS in new places? It seems to be just an unfortunate historical accident that JS is one of the most popular languages in the world - does anyone actually like it compared to other modern scripting languages? Could we invest in CoffeeScript instead, at the very least?

CoffeeScript is JavaScript. There should be nothing stopping anyone from doing everything with CoffeeScript on this device, or anything that supports JS.

Re: JavaScript right on the hardware

#116

Earlier quoted context omitted.

I 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-powe...

I suspect Arduino (at least the ones I've used, Uno?) are a bit underpowered for higher level managed languages like JavaScript.

Absolutely. 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.

Re: JavaScript right on the hardware

#117
post #92
post #73

Earlier quoted context omitted.

Sure if you write very low level stuff, C is probably more suitable. I wonder how much today's "embedded devices" still have in common with traditional embedded devices, though? If it is capable of running JavaScript, it probably is a lot more powerful than some microprocessor with just 2KB RAM where you have to squeeze every bit out of your code. On the PI you can run a complete Linux installation. I don't think the…

JavaScript, and scripting languages in general (and, to be more specific, dynamically typed languages, too, but those tend to be scripting languages, anyways) tend to have a lot of gotchas, and when it comes to controlling physical things, I think that less gotchas are better. Yes, statically typed languages just put a bunch of metadata in the code, but I think it's useful to have the guarantees provided by a static…

Then just write more unit tests and you'll be fine.

Re: JavaScript right on the hardware

#118
JavaScript is the most deployed dynamic embedded programming language in the world (consider all the web browsers on desktop computers and mobile devices). If we expland this environment to customer hardware, we also expand our view of UI/UX to a different level. We should thank Moore's law.
Post reply on HN