News for hackers. Stuff that matters.
Re:JavaScript right on the hardware by proee on Wednesday August 14, 2013 @07:09PM (#6215044)
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 by AntiRush on Wednesday August 14, 2013 @07:39PM (#6215213)
Javascript has the normal (C syntax) set of bitwise operations that operate on 32 bit numbers.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re:JavaScript right on the hardware by teebrz on Wednesday August 14, 2013 @08:24PM (#6215401)
JS supports integers; it just doesn't have an integer type so you can't always store, operate, etc on them efficiently (though a smart engine can do some of that for you). It has bitwise manipulation operations which treat the Number as a 32 bit int. There are also Typed Arrays which make it easier to work on raw binary data. Though yes, it can occasionally get a little finicky trying to interface a high level dynamic language with lower level stuff.

Anyway, for this I'm sure there will be a lot of libraries that handle that for you and expose a fairly high level api; like the blinking led in the example.

Re:JavaScript right on the hardware by esailija on Thursday August 15, 2013 @09:17AM (#6217550)
And when the engine cannot do that for you, there is always Math.imul
Re:JavaScript right on the hardware by rwaldron on Wednesday August 14, 2013 @09:28PM (#6215626)
Is this a joke?