iotjs icon indicating copy to clipboard operation
iotjs copied to clipboard

question about node.js compatibility

Open brendanashworth opened this issue 11 years ago • 10 comments

Hi there!

I took a look at the project and it looks pretty cool. I saw that you were looking for some sort of compatibility with node.js - is this right? If so, y'all might want to take a look at nodejs/api. It is an effort by the nodejs foundation to move towards a standardized API that allows platforms like this to have a real standard.

Maybe you're interested :smile:

brendanashworth avatar Jul 28 '15 05:07 brendanashworth

@brendanashworth Hi, thank you for information. As you mentioned, supporting node.js API is one of main task in IoT.js. Currently, we are referencing https://nodejs.org/api/ as base.

We think that we can't cover the whole set of node.js APIs, because of limited memory in IoT devices. So we are trying to define several subsets of node.js API. One for mandatory, others are optionally loaded on demand as *.npm like module.

As of now, our 1st candidate of mandatory API for IoT.js are as follow. (Listed in module resolution) Your comments always welcome. Thanks!

1st candidate of IoT.js mandatory module

  • ~~Assertion Testing~~
  • Buffer
  • ~~C/C++ Addons~~
  • ~~Child Processes~~
  • ~~Cluster~~
  • Console
  • ~~Crypto~~
  • ~~Debugger~~
  • ~~DNS~~
  • ~~Domain~~
  • Events
  • File System
  • Globals
  • ~~HTTP~~
  • ~~HTTPS~~
  • Modules
  • ~~Net~~
  • ~~OS~~
  • ~~Path~~
  • Process
  • ~~Punycode~~
  • ~~Query Strings~~
  • ~~Readline~~
  • ~~REPL~~
  • ~~Smalloc~~
  • Stream
  • ~~String Decoder~~
  • Timers
  • ~~TLS/SSL~~
  • ~~TTY~~
  • ~~UDP/Datagram~~
  • ~~URL~~
  • Utilities
  • ~~VM~~
  • ~~ZLIB~~

lemmaa avatar Jul 28 '15 06:07 lemmaa

Sounds like a good set of modules - no native addons?

As a side comment, maybe this list will interest y'all. :smile:

brendanashworth avatar Jul 29 '15 20:07 brendanashworth

@brendanashworth Yes, I think we'll eventually support native addon. It seems like the link you are referring is for standardizing kind of embeding API for native addon. right? I think it's cool. Once that kind of standard was established, any native addon developed base on it could run on any platform supporting it (ex. node.js, iot.js and something more). We surely interested and will keep watch on it.

ILyoan avatar Aug 03 '15 05:08 ILyoan

It would be nice to see UDP/Datagram sockets, as they are superb to use in HTTP and WebSockets later. But I have no clue how to implement them myself...

cookiengineer avatar Aug 07 '15 08:08 cookiengineer

UDP sockets are also important in implemeting CoAP and similar protocols.

drasko avatar Aug 07 '15 08:08 drasko

FYI, a significant goal of the node API working group is to standardize a lower-level API that the existing JS files in lib/ would sit on top of. (Rather than the implementation-specific process.bindings(...) interface)

I think it would be worthwhile to coordinate and communicate your needs to the node API working group to work towards full compatibility with the lower-level API and only differing on the scope of what the JS files on top of it do. The lower-level API is still very open for discussion, so the influence of vendors with platform limitation concerns would be very valuable to shaping a highly portable and performant API.

Qard avatar Aug 17 '15 19:08 Qard

Updated candidate for IoT.js API. https://github.com/Samsung/iotjs/wiki/IoT.js%20API%20Reference @martensms @drasko UDP and CoAP is classified as 'Extended API' at this time.

Please check the milestone for progress. https://github.com/Samsung/iotjs/milestones

Thanks!

lemmaa avatar Aug 24 '15 02:08 lemmaa

Is there any plan to support websockets on iot.js?

aquaherd avatar Mar 28 '17 15:03 aquaherd

@aquaherd iot.js already supports the http and the net stack. So you can implement websockets on your own, as everything underlying is ready for it.

cookiengineer avatar Mar 28 '17 16:03 cookiengineer

Thanks, I will try that.

aquaherd avatar Mar 28 '17 16:03 aquaherd