tc39 / proposal-built-in-modules

BSD 2-Clause "Simplified" License
892 stars 25 forks source link

Should this effort be split into two specs? #47

Open dead-claudia opened 5 years ago

dead-claudia commented 5 years ago

A standard library for JS would be nice, and I do feel this effort could have an incredible impact upon the community. However, I feel this effort should be divided into two specs, the ES core spec and a separate runtime standard library spec, specifically informed by the intersection of what developers need from Node, browsers, browser extensions, and other similar hosts:

Of course, each of these would have appropriate hooks for permissions checking and not all of them have to be supported by the host.


This is in part spurred by this bug as well as recent ES Discuss discussion, but I also see it as a chance to bring some consistency to environments, something greatly beneficial to users at large.

I don't see this as critical, but I do see the use in defining what the line is between what should be in the core spec and what should be required of the host (as opposed to the implementation), and I do feel that line needs held to strongly so people understand why certain things aren't going to make it into the spec.

Having this TC39-side also means it's easier to design language features around this core, and WHATWG can focus more on HTML semantics. It's fewer concerns to integrate, and it makes for an easier time figuring out how JS features operate concretely. (In particular, requests, timers, and file streaming could make for a nice case study on how cancellation works out in the real world and it'd make it easier to work that out in more than toy examples.)

littledan commented 5 years ago

I agree that we should focus, in this repository, on your first bullet point above, and that we can leave I/O and event loop stuff to host environment specifications. Maybe we can clarify this in the README.

kaizhu256 commented 5 years ago

i agree standardizing conversion APIs are a priority and common painpoint in UX-workflow programming.