__doc__ for functions, classes, objects etc.
brendan at mozilla.com
Sat Sep 3 13:31:19 PDT 2011
On Sep 6, 2011, at 12:36 AM, Dmitry Soshnikov wrote:
> So, IMO we can't build a "library on hacks" which we then standardize. If to implement, then the best approach at the lower level, as Python did (with processing at compilation time).
I see no reason why we can't build up a library or competing libraries first, then standardize. Sure, it would be easier for the library implementors if there were standard low-level doc-string or doc-comment (or doc-data as Allen just posted) plumbing.
But JS can host all sorts of hacks to front a uniform cross-browser/version API -- this has been going on at least since the "Ajax" days.
The hard thing about standardizing first is that TC39 won't do as good a job as competing library authors contending for users, but TC39 de-jure standardization will result in everyone being stuck with whatever we invent.
Did you have a concrete lower-level suggestion that does not depend on normative language prohibiting dead code elimination combined with Function.prototype.toString() standardization?
More information about the es-discuss