common-workflow-language / common-workflow-language

Repository for the CWL standards. Use https://cwl.discourse.group/ for support 😊
https://www.commonwl.org
Apache License 2.0
1.45k stars 198 forks source link

Adding support for ECMAScript 2015 (ES6) #329

Open mayacoda opened 7 years ago

mayacoda commented 7 years ago

Hello all!

Would it be possible to bump the ECMAScript version specified for Expressions from 5.1 to 6.0? ES6 offers many new features that are becoming common knowledge and are widely available in modern browsers. Considering that JavaScript is not "native" to most CWL authors, they tend to find solutions for expressions without regard (or knowledge) about the version of the language they're using.

For example, I've seen features like Set, Array.from() or backticks for template strings used in expressions, because they are the most elegant way to solve the problem. Of course, these tools fail during execution because these features aren't in ES5.

Is there any particular reason why only ES5 is supported? Is there any plan to update the version in the future?

kmhernan commented 7 years ago

Would the use strict issue come up? https://www.nczonline.net/blog/2016/10/the-ecmascript-2016-change-you-probably-dont-know/

ivanbatic commented 7 years ago

It would technically be a backwards incompatibility, but I think it is extremely unlikely to come up as a problem. Even if somebody has an issue, it can easily be parsed and auto-fixed.

tetron commented 5 years ago

Discussion from 27 Nov 2018:

For cwl v1.0 documents, introduce a cwltool requiremement, something like:

requirements:
  cwltool:ECMAScriptVersionRequirement:
    ecmascriptVersion: 6

For cwl v1.1 documents: ECMAScript 6 is the default for all expressions.

mr-c commented 4 years ago

Which versions of ECMAScript will we require engines to support?

Also, should we allow them to support additional version beyond that?

https://en.wikipedia.org/wiki/ECMAScript