In association with heise online

25 February 2013, 15:01

CoffeeScript 1.5.0 adds "Literate Programming" mode

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

CoffeeScript The latest version of CoffeeScript, version 1.5.0, has added a new "literate" mode to the language to allow developers to create Markdown documents which are also executable. CoffeeScript is a small language which compiles into JavaScript while trying to expose the better nature of JavaScript.

The new "literate" mode, which is entirely optional, is another step into creating readable code. The compiler spots ".litcoffee" files and, when compiling them to JavaScript, discards everything that isn't indented and compiles only the indented text. In Markdown, it just so happens that indented text is the markup language's way of denoting source code. This means that a raw .litcoffee file can be compiled, or used to create formatted documents, and can even display in editors with syntax highlighting. The developers are seeking feedback on the "literate" mode and looking for ideas on how it can be improved.

Other changes in CoffeeScript 1.5 include switching CoffeeScript's REPL (Read-eval-print-loop) to be based on Node.js's REPL, banning the return of values from constructors, and a syntax to loop over arrays backwards (for item in list by -1).

CoffeeScript can be installed via Node.js's npm package manager; the command-line version of coffee, the CoffeeScript compiler is, itself a Node.js utility. The core compiler does not have a dependency on any environment and can even be run in a browser; the MIT-licensed code is available to downloadDirect download and can viewed in the project's GitHub repository.

(djwm)

Print Version | Send by email | Permalink: http://h-online.com/-1810422
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit