If you are a veteran programmer it may seem dumb but there are plenty of people who only know JavaScript (& HTML). Some of those people will be utterly blown away that they can control actual, physical "stuff" with those skills.
JavaScript right on the hardware
81–90 of 320 posts
Re: JavaScript right on the hardware
#82Earlier quoted context omitted.
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.
As someone who has come around to Javascript after many years avoiding it, I think I can answer you: people like Javascript for a similar reason to why people like Python. As long as you stick to a strict set of conventions, Javascript is a very compact and manageable language, with a bit of extra flexibility to spice things up due to its prototypal nature. With Python, you don't have to worry about the conventions p…
Re: JavaScript right on the hardware
#83This 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
#84Earlier quoted context omitted.
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…
Which ones, though?
Re: JavaScript right on the hardware
#85Earlier quoted context omitted.
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?"
JVM has threads. Akka adds actors (those seem quite nice when used with Scala). Does Lua/LuaJIT offer something simple-looking-yet-powerful in that area?
Re: JavaScript right on the hardware
#86Forgive 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…
Re: JavaScript right on the hardware
#87Earlier quoted context omitted.
I personally don't like that everything's a hash. It's nifty, and it means you don't really need objects, but I kinda like objects, even if I don't use them frequently in Python. Your preference makes sense, it's just not the same one I have. More on topic for this thread, I'm still not convinced that it's a good thing for an embedded system.
You can use objects in JS if you want to - but fair enough, different tastes and preferences.
Re: JavaScript right on the hardware
#88Earlier quoted context omitted.
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…
Correction - everyone thinks that they know Javascript. It's a more twisted language than it appears.
Re: JavaScript right on the hardware
#89Earlier quoted context omitted.
"True. When your hammer is C++, everything begins to look like a thumb." [1] [1] http://www.anvari.org/fortune/Quotations_-_Random/3041_quote...
Why it's always C/C++ (not even Pascal or Oberon) in another corner of the ring? If hardware is powerful enough to sustain Node.JS, why not use OCaml, Racket or, maybe, some JVM-based language? Or, if the scripting is a requirement, Lua, Tcl or maybe Python.
That said, if I don't strictly have to run C/C++, I'd much rather run Haskell or Python. And you'd be surprised where you can run high-level languages like Python; one project I work on runs Python in the GRUB2 bootloader to test BIOS and hardware, giving Python full ring0 privileges, raw memory access, ACPI method invocation, and SMP support. Some of the Python standard library is missing (an HTTP server, for instance), but quite a bit of it is available. See http://biosbits.org/ for that project.
Re: JavaScript right on the hardware
#90First 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?