CoffeeScript 1.9 Released
Written by Alex Denham   
Monday, 09 February 2015

The latest version of CoffeeScript has been released with more robust parsing and support for ES6 generators.


 

CoffeeScript code compiles one-to-one into JavaScript and this is its claimed big advantage.

The official CoffeeScript website (http://coffeescript.org/) says the language aims to expose the good parts of JavaScript in a simple way. You can use any existing JavaScript library seamlessly from CoffeeScript, and the compiled output remains readable, passes through JavaScript Lint without warnings, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript.

However with the soon to be announced next version of JavaScript ES6 many of the things that CoffeeScript supplied are going to be standard in JavaScript. Many think that the time has come for this improved scripting language - but  not in a good way. Perhaps making the move back to JavaScript easier is indeed its best feature for the future.

The support for ES6 generators in CoffeeScript 1.9 is welcome news, as this is a feature the developers have been keen to add.

A generator is simply a function that yields.

An example of a generator in use in CoffeeScript is:

perfectSquares = ->
num = 0
loop
 num += 1
 yield num * num
return
window.ps or= perfectSquares()

Parsing has also been made more robust, and error messages have been improved for strings and regexes — especially with respect to interpolation.

The developers have also changed the strategy for the generation of internal compiler variable names. The release notes say that that this means that ‘@example’ function parameters are no longer available as naked ‘example’ variables within the function body.

The final main change to this release is to the REPL. This is now compatible with the latest versions of Node and Io.js.

 

Banner


JavaZone - The Conference We Missed
25/10/2024

Amongst the many Java related conferences, this one flew under the radar. A real shame because it had many great sessions.
JavaZone might not be that famous internationally, but it still is the bi [ ... ]



Azul Outperforms OpenJDK By Up To 37%
23/10/2024

Azul has announced that its Azul Platform Prime outperforms comparable OpenJDK distributions by as much as 37%. The company has also launched the Azul Java Performance Engineering Lab (JPEL) aimed at  [ ... ]


More News

 

espbook

 

Comments




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

Last Updated ( Monday, 09 February 2015 )