16 ms·
I think you are misunderstanding; robotjs is written in C but it is a module for Node.js which means you implement it using Javascript. Node.js modules can be
by tjallingt 11y ago
I think you are misunderstanding; robotjs is written in C but it is a module for Node.js which means you implement it using Javascript.
Node.js modules can be written in C or Javascript but implementing new features like this requires you to use C so there is no "making this available for other languages".
- anon3_ 11y agoI stand corrected. I looked closer. I never knew node modules could be written in C.
- deckar01 11y agoI was searching around for a js wrapper, but found that even the JS API was implemented in C [1]. I would only implement the low level "hardware" primitives in C, then implement the high level API in JS like Chromium's Blink-in-JS initiative [2]. Once they start expanding the high level functionality, they will lose potential contributors by sticking with pure C. [1] https://github.com/octalmage/robotjs/blob/master/src/robotjs.cc https://github.com/octalmage/robotjs/blob/master/src/robotjs... [2] http://www.chromium.org/blink/blink-in-js http://www.chromium.org/blink/blink-in-js
- octalmage 11y agoYou'd be surprised by how many C/C++ programmers there are out there! I've already been surprised by the number of contributions. But yeah, using C wasn't a choice, it was the only option. Luckily we already have all planned features implemented in C.
- pjc50 11y agoWell, you could take the API it presents and fit it to another language's FFI. Maybe someone who wants it for their language will do that.