CoffeeScript brewing as variation on JavaScript

The open source project, still in the alpha stage, reflects what JavaScript could look like with a syntax to match its features

CoffeeScript, billed by its creator as "unfancy JavaScript," is in development as a language that compiles into JavaScript but offers a different sense of style.

Still in an alpha stage of development, CoffeeScript offers array comprehensions similar to Python and makes JavaScript statements viable as expressions, said Jeremy Ashkenas, who recently began developing CoffeeScript and put out an updated version designated as release 0.2.0 on Monday evening.  Documentation on the 0.2.0 releasee can be found at this Web page. But CoffeeScript, which is open source, is not recommended now for use in deploying applications, given its newness.

[ Also in the software development realm, a beta release of Ruby on Rails 3 is anticipated later this month. ]

"I'm not suggested that anyone use it for real projects at this point," Ashkenas said. "The language is still changing a good deal."  Potential uses, though, could include Web development or server-side JavaScript development.

"The basic idea is that JavaScript has a really nice sort of core object model and a really nice object-oriented model and functional nature," Ashkenas said. "But a lot of that is hidden behind its syntax, which it gets from Java, mostly."

"The problem with that is the syntax doesn't match the core concepts in the language," and is not as elegant or useful as the concepts are, he said.  CoffeeScript reflects what JavaScript could look like with a syntax to match its features, said Ashkenas, who, aside from working on CoffeeScript,  is lead developer at DocumentCloud.

Featuring a compiler written in Ruby, CoffeeScript does not add any special methods or objects but compiles directly into vanilla JavaScript, he said.

The language tries to make JavaScript capabilities, such as function literals, for describing a function, easier. Lexical scoping, for handling local variables, is featured as well.

"Basically, in CoffeeScript you can't accidentally great a variable," Ashkenas said. This feature provides for stronger security.

A Python-style whitespace capability is featured in version 0.2.0 for closing spaces. Version 0.2.0 also features object comprehensions, for looping over properties of an array or object and deriving a comprehension based on them.

This story, "CoffeeScript brewing as variation on JavaScript," was originally published at InfoWorld.com. Follow the latest developments in application development at InfoWorld.com.

Join the newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection

Tags javascript

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Paul Krill

InfoWorld
Show Comments

Cool Tech

SanDisk MicroSDXC™ for Nintendo® Switch™

Learn more >

Breitling Superocean Heritage Chronographe 44

Learn more >

Toys for Boys

Family Friendly

Panasonic 4K UHD Blu-Ray Player and Full HD Recorder with Netflix - UBT1GL-K

Learn more >

Stocking Stuffer

Razer DeathAdder Expert Ergonomic Gaming Mouse

Learn more >

Christmas Gift Guide

Click for more ›

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Walid Mikhael

Brother QL-820NWB Professional Label Printer

It’s easy to set up, it’s compact and quiet when printing and to top if off, the print quality is excellent. This is hands down the best printer I’ve used for printing labels.

Ben Ramsden

Sharp PN-40TC1 Huddle Board

Brainstorming, innovation, problem solving, and negotiation have all become much more productive and valuable if people can easily collaborate in real time with minimal friction.

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?