Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
DeviceJS is Javascript for the Physical World (devicejs.org)
41 points by sebg on July 21, 2013 | hide | past | favorite | 23 comments


"DeviceJS is a JavaScript based development platform for reacting to sensors and controlling devices. It’s built on top of Google’s V8 JavaScript engine, Node.js and a real-time JSON database."

Fascinating. JavaScript really is slowly becoming the lingua franca of everything.


Atwood's law keeps on showing itself to be more and more prescient.


Just looked that up, but it seems like more of an argument for "most universally executable language" rather than "least powerful".

The problem with Javascript ironically is that in some ways it is too powerful. People want a simple scripting language with a basic type system but instead get a psuedo-functional/psuedo-OO language with a type system construction kit.

JS programmers and library designers seem to expend a lot of effort beating JS into the sort of language they want to use, the result is that many JS programs may as well have been written in entirely different languages.


Maybe due to that flexibility, it becomes the language they want. Where as other languages don't offer what they need/want.

Many people look at JavaScript's flexibility as a bad trait, but to skilled programmers, it becomes a great tool.


That may be true, but the principle of least power is all about picking low powered languages so that the programs become extensible to people with lower skill.


From the Kickstarter Page:

"DeviceJS ties Javascript to the physical world, by providing hooks for protocols like IP, 6loWPAN, Bluetooth™, Zigbee™, RS-232, and devices such as the Belkin WeMo™ and Phillips Hue™ light bulbs. Because the system is centered on Javascript, it is very easy for anyone to extend."


Interesting concept but weird choice of language. Yes, JS is popular, but that's because it's the only language supported universally by all browsers. And now people are moving away from it (CoffeeScript, Dart, etc), this project embraces JS. Or maybe JS is now the new JVM?


Javascript appears to be a language that everyone knows or has used at some point of time. It is ubiquitous because of the web. As opposed to Lua, Scheme, Scala, Python, etc., this will expose it to all programmers.

It is one of the best languages for scripting and event based management of objects.

Also as LLVM is maturing, it will be easy to build a layer on top of it for most popular languages - if at all needed - though that need would only be for comfort and previous exposure to that language than anything else.

May be that is why Javascript was chosen.


Is JavaScript so bad that someone shouldn't create a platform that uses it? Just because someone makes an alternative to JavaScript doesn't mean everyone is moving away from it.

JavaScript isn't the new JVM, it is more likely that V8 fills that role. Node.js which is built on top of V8 and uses JavaScript has robust support for multiple platforms and a robust module system built in. It makes sense to use it as a foundation for a device programming platform.


My curiosity is piqued but I'm at a loss. Where's the code? I read the page a couple of times but I don't see any links to code or anything.


Besides the argument about JS, the thing that is holding me back the most is their "cloud service".

"The Relay connects WigWag and third party devices to our cloud service, which allows your stuff to interact with many Internet services, such as email, Dropbox and Twitter. It also makes your sensors work together, so they and the rules they activate are smarter."

I can't really understand why this cloud connectivity is required? But personally I feel quite some reservation towards storing this kind of data remote.


We've ufortunately DDoSed the site.

From Google cache: http://webcache.googleusercontent.com/search?q=cache:mr8RddZ...

This is not available yet, and appears it will only run after the developing company, WigWag, completes their Kickstarter campaign and start shipping products.

The nice thing though is that besides being able to run on their proprietary device, it will also run on Raspberry Pi.


Do this today with Johnny-Five: https://github.com/rwldrn/johnny-five


Johnny 5 is a great project with some realy smart people, but I don't like how it abstracts arduino so much. I prefer just messaging with node-serial.


The abstraction is the whole point, so I guess you either love it or you don't ;)


No kudos for picking the worst language around to run on hardware which may have mission critical requirements. When a device sensor heart rate stops reporting data, will your JS code return undefined, null, NaN, 0 or something else? Who needs mature error handling? Low memory requirements? No problem, v8 will have a reasonable memory footprint by 2024.


Because as we all know, code written in C can't ever crash or suffer from memory leaks.

I don't think anyone's advocating JS for life-and-death use cases. It's all about the right tool for the job, there's no reason to write off any particular language or environment a priori.


Where does it say its for mission critical applications on constrained hardware? Who has ever advocated JS for such an application?


How do you deal with numbers that cannot be precisely represented by a 64-bit float? There are many sensors that require much higher precision. If Javascript's extremely idiotic number issue ever gets fixed, then I think this is a great. But until then, I don't see the point of using Javascript for sensors.


While it's not a great solution, and is rather clunky, this can be overcome by buffers/typed arrays.


What's a practical example where you may need to deal with higher precision than 10^(-15)?


Is there a project like this, but Lua instead of JavaScript?


I agree. Lua is the perfect language for this.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: