Live data from Hacker News

JavaScript right on the hardware

technical.io

101–110 of 320 posts

Re: JavaScript right on the hardware

#101

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?

just to answer you: I Like Javascript.

I like my functions as first class citizens. I like my prototypes and my inheritance model. I like my callbacks and my closures. I like how I can move from client-side, to server-side, to my TV, all with the same language. I like how easy it is for beginners to produce something useful and for seasoned developers to produce something good.

There are many other languages that share such traits but Javascript is one of the few that can be picked up by beginners interested in any field (eg: games, web, apps) and keep surprising you. It is extremely powerful in the hands of those that devote time to learn how things work. Its one of the few languages that you can learn as a beginner and keep with you as you become a better programmer.

I don't think it should be the only language someone knows but it should be a language that everybody knows.

So yes, there are people who like javascript.

Re: JavaScript right on the hardware

#102
post #53
post #36

Earlier quoted context omitted.

No. I prefer C over JavaScript for embedded devices. And actually in most places, too. I know I'm weird, but I really like pointers, because I really like being able to manually setup data structures, and enjoy the power provided by pointers. Manual memory management isn't horribly fun, but for embedded devices I would rather be in charge of that over the chip having to do it for me. It means that if there's ever a m…

Not even for scripting them?

There's not really much need for scripting on an embedded device. Embedded systems are meant to do a single task and run continuously. If he is already comfortable with C, he clearly doesn't have much use for a language like Javascript when it comes to microcontrollers.

Re: JavaScript right on the hardware

#103

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

Re: JavaScript right on the hardware

#104
post #80

Earlier quoted context omitted.

Because a lot of people know Javascript and C/C++.

Okay, maybe Racket and OCaml are relatively obscure options, but quite a lot of people know Java and Python. And I can't say Lua's not popular, too.

I'd expect Javascript programmers dwarf Lua programmers by a couple of orders of magnitude. At least one OOM if you want to limit to people who only know the language "well."

Re: JavaScript right on the hardware

#105
Certainly an interesting concept ... and I'm sure that will be some cool things that come out of this project.

I'm not sure I like the idea of a high level language, trying to control low level hardware. (seems almost counter intuitive)... however, if you wanted such a thing ... Node seems to be the way to do it... from both an accessibility and speed perspective.

Re: JavaScript right on the hardware

#107
post #83

Earlier quoted context omitted.

I don't see a price yet for this one. I like the pi (and the beaglebone) because they've already got the network hardware, but the gpio isn't as robust as on the arduino (3.3v vs 5v, very low current capacity on the pi, and no analog io). I can't say I particularly want the javascript, but if they've got wifi and arduino compatible gpio for ~ $25, then I can find a use for it.

BeagleBone Black has a huge number of gpio pins, it's one of BeagleBoard's major selling points over RasPi at this point. I'm fairly certain the BeagleBone Black has more gpio pins than the Arduino.

BeagleBone Black also has a real-time module (effectively, a limited microcontroller on the same die as the CPU), which I expect could make for some sweet libraries.

Re: JavaScript right on the hardware

#108
post #26

Earlier quoted context omitted.

CoffeeScript is JS. And to be more honest and judgemental, CoffeeScript is the sweeter-but-poorly-documented Javascript. The reason people are attempting to put javascript everywhere is because they can and because others enjoy it. And those who do enjoy JS, know what parts of JS are to be avoided at all costs. And I actually like it compared to other modern scripting languages for two reasons:(1) I don't have to wor…

> poorly-documented what?

Who needs documentation when you can just pop open a REPL and copy-paste your functions to see how they compile?

Re: JavaScript right on the hardware

#109
post #54
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…

I 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?

Slightly off topic, but is it just me or has Lua gotten a lot of attention on HN in the past weekish? I haven't heard much of Lua before but recently it seems to have come up a lot more.

And even more off topic (sorry), what makes Lua better/different than other scripting languages?

EDIT: On jacobwcarlson suggestion, I Googled Lua vs Python, and found this Wiki, http://lua-users.org/wiki/LuaVersusPython Not a speed comparison, but gives a fair amount of difference in the actual languages. And yes it is on a Lua users site, so may be biased, but on my very light reading didn't seem too bad.

Re: JavaScript right on the hardware

#110
post #19

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?

Of all the great languages out there... we had to choose Javascript. It's a shame, would love to see more Smalltalk posts.

JS is great - it's so hackable, via simple straightforward syntax that's familiar to anyone who programmed in c,c++,c#,java,php and is similar in ease of use to python and ruby - why on earth would you think it's a bad thing... Javascript is easy - few constructs that together can build just about anything is a big plus IMO - to each is thier own right
Post reply on HN