Live data from Hacker News

JavaScript right on the hardware

technical.io

51–60 of 320 posts

Re: JavaScript right on the hardware

#51

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?

When all you know how to use is a hammer, everything looks like a nail...

"True. When your hammer is C++, everything begins to look like a thumb." [1]

[1] http://www.anvari.org/fortune/Quotations_-_Random/3041_quote...

Re: JavaScript right on the hardware

#52
post #36
post #24

Earlier quoted context omitted.

You prefer C over JavaScript? Header files? Pointer arithmetic hell? Precompiler Macros? Manual Memory Management? Seriously? To each their own, though.

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…

I also prefer C and C++ over every other high level languages when performance is essential.

Re: JavaScript right on the hardware

#53
post #36
post #24

Earlier quoted context omitted.

You prefer C over JavaScript? Header files? Pointer arithmetic hell? Precompiler Macros? Manual Memory Management? Seriously? To each their own, though.

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?

Re: JavaScript right on the hardware

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

Re: JavaScript right on the hardware

#55
post #24
post #12

Earlier quoted context omitted.

Why? Because it uses JavaScript? I'd rather stick with my Arduino and use C. I don't get the whole "JavaScript Everywhere" meme, I'd rather use almost any other modern language (note the almost).

You prefer C over JavaScript? Header files? Pointer arithmetic hell? Precompiler Macros? Manual Memory Management? Seriously? To each their own, though.

Like Java, C is deterministic. Try adding a string and an integer in JS, what happens when JS is controlling real hardware, directly, and the coder said do this but the code (JS) does something else? I can't imagine coding medical devices with JS and hoping they always do exactly what their coders thought the JS they wrote would do.

Re: JavaScript right on the hardware

#56

Earlier quoted context omitted.

Because JavaScript runtimes are the best dynamic language VMs by a long shot.

The JVM would like to have a word with you.

LuaJIT would like to have a word with JVM.

Plus, Lua isn't controlled by a creepy asshole who thinks the NSA is essential and says stupid shit like "Who's ever heard of government misusing information?"

Re: JavaScript right on the hardware

#57
post #24
post #12

Earlier quoted context omitted.

Why? Because it uses JavaScript? I'd rather stick with my Arduino and use C. I don't get the whole "JavaScript Everywhere" meme, I'd rather use almost any other modern language (note the almost).

You prefer C over JavaScript? Header files? Pointer arithmetic hell? Precompiler Macros? Manual Memory Management? Seriously? To each their own, though.

On an embedded microcontroller, pointers and manual memory management tend to be less of an issue, as you're doing most of the stuff on the stack. I don't think I've ever had a reason to call malloc in an embedded C application before. If you were doing networking, however, it would probably be much more complicated. In that case, Javascript might be useful. But on the other hand, there are high-level languages that I would greatly prefer over Javascript.

Re: JavaScript right on the hardware

#58

This is very cool, but I don't see how it can compete with boards like the BeagleBone Black. The BleagleBone Black is $45 for a 1GHz CPU and 512 MB of memory, yet the access to low-level hardware is just as good.

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.

Re: JavaScript right on the hardware

#59

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?

I enjoy JS a lot, and will frequently choose it over Ruby or Python. A functional style plays nicely with a lot of the problems I'm solving, it's nearing ubiquity, and there's lots of big names and smart people working on optimizing it even more. In my day job, we write mostly Coffee - which is little more than a preprocessor to JS, IMHO. It's definitely nice to have, but I don't consider it an independent language u…

Python, okay, but how are you prevented from using a "functional style" in Ruby?

Re: JavaScript right on the hardware

#60
post #30
post #14

Earlier quoted context omitted.

JavaScript is my favorite programming language. It's not perfect, but still. (Other languages I know: Ruby, Python, Java, Go, Scheme, C, Erlang).

Why? I really would like to understand, because I see JS as a necessary evil, and would rather use something else if given the option.

@eob - same problem, couldn't reply directly to you.

My main reason for liking Python isn't that it's compact and manageable (unless by compact, you mean the code one writes), but because I like the elegance of the language.

You're saying you have to stick to strict conventions for JavaScript to be any good? That would imply that it isn't any good to me. I use it, frequently, I just prefer not using it.

Post reply on HN