Has there been any discussions around standardizing socket or file io usage?

David Bruant bruant.d at gmail.com
Fri Jun 17 09:35:53 UTC 2016

Hi Kris,

Le 17/06/2016 06:44, Kris Siegel a écrit :
> I didn't see this in the archives but I was curious if any 
> consideration has been given for standardizing on features more 
> commonly found in most other language's standard library.
> For example reading and writing to sockets in JavaScript requires 
> platform specific libraries and works very differently between them. 
> The same goes for file io (which would obviously need restrictions 
> when run in, say, a web browser).
> Building these in would make JavaScript more universal and easier to 
> learn (you learn one way to access a resource instead of 2 or 3 very 
> different ways).
> I would be happy to work on a proposal for such changes if they were 
> desired by the community. Thoughts?
I understand your motivation, but I believe standardisation isn't the 
right avenue for the problem you describe to be solved.

Specifically, even if there was a standard why would Node or browser 
makers implement it given they already have an API for the job and lots 
of code is already written on top of these APIs?

Writing a standard is not a guarantee for implementation. Implementing 
something is lots of work for browser vendors and Node.js (and they're 
not in shortage of things to do), so they usually need some confidence 
that the new thing adds enough value to be worth the cost.
One way to convey such confidence can be to start the work, implement it 
as a library on top of current APIs, show that there is adoption by lots 
of people. Adoption is usually is an excellent proxy for value. That's 
how we got document.querySelectorAll (via jQuery) and Promise (via the 
gazillion promise libraries and Promise/A+ spec) for instance.

In this case, from experience reading proposals on standards 
mailing-list come and go, I doubt this will be of interest to enough 
people to be worth it. But that's just my own opinion and I would love 
to be proven wrong.

One more thing to regret, maybe https://www.youtube.com/watch?v=7eNFQqMSxtU


More information about the es-discuss mailing list