Live data from Hacker News

JavaScript right on the hardware

technical.io

41–50 of 320 posts

Re: JavaScript right on the hardware

#41
post #23
post #4

From the title I expected the CPU to actually run JavaScript, like a certain decades old computer (of which name I can't recall).

ARM tried this with Java, it was called Jazelle and was (is?) a complete disaster.

Various smartcards use subset of Java 2 bytecode (search for "Java Card") although I'm not sure if it's particularly better or worse than running some other kind of instruction set.

Re: JavaScript right on the hardware

#42
I'm curious about performance on this, compared to something like the Arduino YUN, which is basically a OpenWRT MIPS system (which uses a Lua UI by default) and an Arduino tacked on the side:

http://arduino.cc/en/Main/ArduinoYUN

The CPU in particular seems quite underpowered assuming that they're clockspeed comparable, but I'm not familiar enough with the M-series ARM cores to give a proper opinion.

Re: JavaScript right on the hardware

#43
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…

As it was spoken: Javascript shall conquer all- Atwood's Law:

http://www.codinghorror.com/blog/2007/07/the-principle-of-le...

Re: JavaScript right on the hardware

#44
post #21

Nifty! I presume this is running on a Linux kernel? How much memory does node use? I would think that kernel + JS VM would chew up quite a bit of your 32 MB of RAM.

> I presume this is running on a Linux kernel? I doubt that. It has M-series ARM microcontroller, Linux is usually used with A-series ARM CPUs.

How would you run Node on it otherwise? If it's not running an operating system that Node already supports, it means they've done the very large amount of work needed to port a Javascript interpreter to a bare-metal environment. I'd be highly impressed if they had actually managed to do that, but I'm doubtful. More likely they are using some stripped-down Linux kernel and userspace. A combination of uCLinux and BusyBox should work rather nicely.

Re: JavaScript right on the hardware

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

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 part, since there is one "Pythonic" way to do everything. But at least with JS there are only a few different standard ways to implement, for example, OOP. So once you've gotten used to it, when you read someone's code, you can quickly notice what style they use and contribute your code to match it.

My biggest remaining gripe with Javascript is the lack of a good base set of libraries for container and string manipulation. Sure there are packages (like Underscore) you can use, but it would be nice to have them as a standard part of JS.

Re: JavaScript right on the hardware

#47
Javascript doesn't support integers, so it doesn't seem like a good language for programming low level hardware. What about bit manipulation (XOR, AND, Shifting, etc)? This is critical for a lot of serial data communications and I/O controls.

Re: JavaScript right on the hardware

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

Re: JavaScript right on the hardware

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

It's extremely simple - basically everything is a hash. It has full lambda, not just crippled lambda like Python. It's very fast (I think it is the fastest scripting language except for Lua, and getting faster because of the browser wars).

It usually doesn't require a lot of boilerplate code.

What is not to like?

The one thing I worry about is the limited range of integers.

Post reply on HN