DeCaffeinate Converts CoffeeScript To JavaScript |
Written by Kay Ewbank |
Thursday, 22 June 2017 |
A new tool lets you automatically convert your CoffeeScript source to modern JavaScript. Decaffeinate is available now on GitHub. CoffeeScript has been relatively successful because its code compiles one-to-one into JavaScript. Compiled output remains readable, passes through JavaScript Lint without warnings, will work in every JavaScript runtime. However, with JavaScript ES6 many of the things that CoffeeScript supplied are standard in JavaScript. The advantage offered by ECMAScript 2015 (ES6) is that it defines the standard for the JavaScript implementation used in web browsers, is supported natively, and as it is an official standard it overcomes the need to rely on a project such as CoffeeScript that lacks such global definition and support. CoffeeScript still has a lot of supporters, even taking ES6 into account. Developers praise its conciseness, and point out that CoffeeScript can compile to ES6 as a separate build step. Its supporters argue that CoffeeScript programs have fewer lines of code, and avoided contentious issues such as problems with undeclared vars, and JavaScript's distinction between == and ===. Those backing decaffeinate and ES6 say that despite such reservations, the momentum is with ES6. They credit many of ES6's good points as having been derived from CoffeeScript. The strongest argument for conversion, and for using decaffeinate, is that as a redundant technology, CoffeeScript will eventually become defunct.
The decaffeinate project can be used to convert a single file or a whole project as a batch operation. The bulk conversion tool can check a codebase for decaffeinate-readiness, and once the code (or a part of it) is ready, will run the conversion and do some of the cleaning up necessary after the conversion. There's a fork of the CoffeeScript implementation with some small patches that are useful to the decaffeinate project.
More InformationDecaffeinate Fork Of CoffeeScript Related ArticlesThe Weekly Top 10: More JavaScript Development Resources CoffeeScript Supports Literate Programming CoffeeScript in Action (Manning) (book review) Programming in CoffeeScript (book review) CoffeeScript: Accelerated JavaScript Development (book review)
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
Last Updated ( Thursday, 22 June 2017 ) |