From:  Dylan Oliver <doliver@mozilla.com>
Date:  16 Sep 2016 07:45:37 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.sensorweb
Subject:  

Re: Rust and C/C++ vs Node

NNTP-Posting-Host:  63.245.214.181

Thanks for starting the conversation Aus. Let's have the discussion and make our choice by next Wednesday along with our hardware selection.

For me, our familiarity with javascript and the maturity of the node ecosystem would make me feel more comfortable going that direction. We did use Rust on the metrics team earlier this year and ran into a number of speedbumps along the way due to the learning curve and frequent language updates. There is going to be time pressure on this project -- other things being equal we should use the tools which enable the team to be most productive.

On Thu, Sep 15, 2016 at 11:20 AM, Aus Lacroix <aus@mozilla.com> wrote:
Hi All,

It would seem that the major options that we are considering as far as language are Rust and C/C++ but I think that it would be ideal to use node.js on device, especially if we're already running linux.

* Node provides TLS support (including TLS sockets!).
* There is a very robust Hawk module available. (https://github.com/hueniverse/hawk)
* Node LTS v6 is scheduled for October 1st which would get us a lot of the latest and greatest JavaScript features. Will be supported for a minimum of 3 years (https://github.com/nodejs/LTS#lts_schedule).
* Enables seamless updates of our software package. The sensor could check for updates with little to no effort. (https://kjur.github.io/jsrsasign/ can provide signing and authentication of the source, we could also use this library in lieu of Hawk, we could also use the built in crypto api -- https://nodejs.org/dist/latest-v6.x/docs/api/crypto.html)
* Has i2c libraries available (https://github.com/kelly/node-i2c)
* We all know JavaScript already which will definitely speed up development and iterating.
* It's stable, unlike Rust which changes weekly.
* If we were hoping for strong type checking, for example, as a motivation for Rust, we can use Flow (https://flowtype.org/) to provide this in JavaScript. We also have TypeScript (https://www.typescriptlang.org/) as an option there.
I could list more but I feel I may sounds like a broken record. ;) What are the actual, real world advantages, of using rust? Seeing as this isn't a high performance device and our hardware options are fairly beefy I'm really having trouble convincing myself that it makes sense. It think we would not be stacking the odds in our favor for a successful launch of this product by using Rust.

--aus

_______________________________________________
mozilla-dev-sensorweb mailing list
mozilla-dev-sensorweb@lists.mozilla.org
https://lists.mozilla.org/listinfo/mozilla-dev-sensorweb