Hash style comments

Rick Waldron waldron.rick at gmail.com
Wed Aug 8 09:38:26 PDT 2012

On Wed, Aug 8, 2012 at 11:58 AM, Trans <transfire at gmail.com> wrote:

> Hi. First time posting to the list, so please forgive if I am not
> following proper approach.
> I'd like to make one proposal for future of EMCAScript. I would like
> to see support for `#` comment notation.

The # is already on hold for several potential syntax additions:

- sealed object initializers
- Tuples http://wiki.ecmascript.org/doku.php?id=strawman:tuples
- Records http://wiki.ecmascript.org/doku.php?id=strawman:records


> The reasons for this are more interesting than one might think.
> First, of course, is the simple fact that `#` is a very common
> notation among programming languages. It is used by Shell scripts,
> Ruby, Python, even Coffeescript, and many others.
> Secondly, `#` is preferable to `//` in that it is only one character
> instead of two, and albeit subjective (IMHO) it just seems a little
> bit more aesthetic.
> But another reason, that few will at first consider, is the
> relationship between JSON and YAML. Their respective development teams
> made an effort to ensure JSON was a perfect subset of YAML. Now there
> is consideration of JSON5 (https://github.com/aseemk/json5). JSON5
> adds support for comments, however it is Javascript style comments,
> where as YAML supports `#` style comments. This causes the
> superset-subset relationship to break. To help remedy this going
> forward, it would be very helpful if EMCAScript also supported `#`
> comments. The YAML spec could in turn add support for `//` style
> comments.
> To be clear, I am not suggesting that `//` be deprecated. That would
> simply break far too much old code for no good reason! I am just
> seeking for `#` to be supported too.
> Thanks for consideration,
> trans
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120808/c8840b96/attachment.html>

More information about the es-discuss mailing list