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.

 

decaff

 

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.

 

coffeescript

 

More Information

Decaffeinate Project 

Decaffeinate Fork Of CoffeeScript

Related Articles

CoffeeScript 1.9 Released

CoffeeScript Update

The Weekly Top 10: More JavaScript Development Resources

TypeScript 1.7

CoffeeScript Gets Regrind

CoffeeScript Supports Literate Programming

CoffeeScript in Action (Manning) (book review)

Programming in CoffeeScript (book review)

CoffeeScript: Accelerated JavaScript Development (book review)

 

Nodejs v6 Released 

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.

 

Banner


Ai-Da's Portrait of Alan Turing At Auction
01/11/2024

Sotheby's Digital Art Day Action, now underway, features a large-scale portrait of  Alan Turing created by Ai-Da, the humanoid robot artist whose work, including this canvas, was exhibited at the [ ... ]



Lightbend Announces Akka 3
15/11/2024

Lightbend, the company that developed Akka, has announced Akka 3, and has changed its name to Akka. The company produces cloud-native microservices frameworks, and Akka is used for building distribute [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Thursday, 22 June 2017 )