
CoffeeScript hits 1.0 -- Happy Holidays, HN - jashkenas
http://jashkenas.github.com/coffee-script/#top
======
jashkenas
Things have come a long way in the past year, since this conversation:

<http://news.ycombinator.com/item?id=1014080>

Some of the interesting recent features include executable class bodies,
extended regular expressions, functions with default arguments, and YAML-style
object literals.

Thanks for all the great suggestions and patches (almost a thousand Github
issues, with many thousands of comments). The language has been very much a
community driven project, and hopefully it reflects some significant part of
the hard-earned wisdom of JavaScripters.

~~~
zackola
This rules! And thanks to everyone in #coffeescript for answering my stupid
questions as they come up :)

------
Kilimanjaro
The war on curlies is over, curlies lost.

Good to see new languages improving upon syntax, readability is key and a
great way to gain adoption. As Norvig said, it is easier for him to explain an
algorithm in python than any other language. Well, now CoffeeScript has just
passed that test too.

Brendan Eich is also adapting many good things from CoffeeScript to JS.next,
validating the point that coffee, in its short life, has been able to
influence other great language designers.

And that says a lot about CoffeeScript and its potential.

~~~
jamesbritt
The page says, "Objects may be created using indentation instead of explicit
braces, similar to YAML. "

 _Similar_ to YAML? What exactly does that mean? Is there someplace that
explains the specific indentation rules?

The indentation rules of YAML are massively borked; it's not enough that
something be indented, it has to be indented a very specific number of spaces.
As opposed to, say, Haskell's more sane off-side rules.

~~~
TomasSedovic
I'm afraid that's not correct. You can use arbitrary number of spaces to
indent a block in YAML[1]. It does't matter if it's 2 of 4 or 17.

The only limitations are that it must be greater than the indentation of the
parent node (obviously), that all siblings must have the same indentation and
that tabs are not allowed.

Are you sure you're not mistaking this with HAML? It's a bit stricter with the
indentation requirements.

[1]: <http://www.yaml.org/spec/1.2/spec.html#id2777534>

~~~
jamesbritt
"I'm afraid that's not correct. You can use arbitrary number of spaces to
indent a block in YAML[1]."

Well, shit.

Thanks; how did I miss that?

"Are you sure you're not mistaking this with HAML? It's a bit stricter with
the indentation requirements."

Oh, that I know. One reason I avoid it.

------
pyrotechnique
Congratulations Jeremy et al.

CoffeeScript has been and will continue to be a tremendously powerful catalyst
for change in the JavaScript community.

CoffeeScript has successfully: advanced our organisations attitude towards
JavaScript on both the server and client; rendered working with complex
systems -- such as node.js and WebGL -- a breeze and allowed us to focus
solely on the real problems at hand rather than quirks in a language.

Everyone who has contributed in any way whatsoever, or even only just toyed
with CoffeeScript should feel privileged to be part of the fantastic community
surrounding the language.

Thankyou for the great gift that is CoffeeScript 1.0 this Christmas.

------
jackfoxy
Has anyone written a reverse CoffeeScript compiler that compiles legacy js
into cs? Seems like it would be a great tool for starting off refactoring of
big js files, or if you simply wanted to adopt cs as your standard.

~~~
pyrotechnique
<http://mindynamics.github.com/js2cs/>

It is not without its cavets, though, with a little work it could be
brilliant.

Alot of things that are in CoffeeScript simply are not possible in JavaScript;
given there is no 1-1 relationship between CoffeeScript and JavaScript
constructs.

~~~
jsilver
thanks! it means a lot to me. :)

i made this a couple of months ago as an experiment on someone's suggestion
and ended up getting REALLY far. only current caveats are that some hacks are
used (of course).. and CoffeeScript 1.0 is not supported. I have been busy and
I don't know what kind of updates that will take right now. I have been
meaning to get around to it of course, but for the mean time I put the demo up
there. The source is of course open, it's written in JavaScript. Have a look
in App.js. It's a recursive AST walker. If you do manage to patch it you can
send me a pull request on github. The code is relatively clean and easy to
read. It should also serve well as a learning tool to see what the symbols of
CoffeeScript are.

Danke for the mention!

-jsilv

------
cjoh
It's pretty clear that jashkenas is the Chuck Norris of Javascript.

~~~
dmix
For the last week I've been using CoffeeScript along with Backbone.js &
Underscore.js (all backed by jashkenas) and it's given me a much greater
appreciation for the power of javascript.

There is some clear talent behind these projects.

~~~
rbxbx
It's amazing how much more I like Javascript under the guise of CoffeeScript.
JS got a lot right, and when you get rid of (most) of the wrong, it really
shines.

Here's hoping for a larger community adoption!

------
ludwigvan
The best new language of the year 2010. Thanks jashkenas!

------
gabrielroth
Newbie question: How is CoffeeScript typically used? On a web server running
node.js? In the browser after including CoffeeScript the way you might include
jQuery? Either? Some other way?

~~~
jashkenas
Anywhere you might use JavaScript. For building web sites, working with
canvas, doing servers with Node.js, or scripting the JVM with Rhino ... for
example:

A Riak client: <http://riakjs.org/>

A canvas sketch:
[http://jashkenas.s3.amazonaws.com/misc/buddhabrot/buddhabrot...](http://jashkenas.s3.amazonaws.com/misc/buddhabrot/buddhabrot.html)

A string scanning library: <http://sstephenson.github.com/strscan-js/>

An in-browser tank game: <https://github.com/stephank/orona>

A Node.js-powered Rack server: <http://josh.github.com/nack/>

------
tectonic
Great work Jeremy! I've been using CoffeeScript extensively for an upcoming
project, and having written 1000+ lines of it so far, I'm loving it!

~~~
aonic
Now if someone made a Cappuccino like framework on top of CoffeeScript instead
of Objective-J I'd be in heaven :)

Out of curiosity, what are you making?

~~~
pyrotechnique
We are developing an open-source MMO on node.js and WebGL -
<http://github.com/feisty>

~~~
treeface
Is there something I can do to get involved with this project?

~~~
pyrotechnique
Absolutely...

I am "pyrotechnick" on Skype/Twitter/Facebook/Google Talk

We would love to hear from anyone who can contribute anything to the projects.
Or who is interested in an alpha/beta

------
eddieplan9
Congrats to the team! I've been using CoffeeScript together with
underscore.js, backbone.js and of course jQuery. Together they make functional
style programming and building MVC pattern so much easier. Thanks for building
such an expressive language.

------
camperman
Thanks for this Jeremy and everyone who contributed. I've held off really
coming to grips with javascript because I found it ugly and full of too many
gotchas. But Coffeescript has got rid of all those excuses!

~~~
jashkenas
Satoshi Murakami deserves a large portion of the credit for the changes
leading up to 1.0 -- his Coco dialect of CoffeeScript has been a strong
influence on the features and optimizations that happened this fall.

<https://github.com/satyr/coco#readme>

~~~
milaniliev
I thought I have a pretty good handle on CoffeeScript, but Coco's README
confused me. Can someone explain the reasoning behind Coco's features? Can't
seem to discern their purpose.

~~~
satyr

      # Fix things CS goofs.
      # Add things CS lacks.

------
kennet
Been holding this one back for awhile, but: Are there any talks, plans or
otherwise on incorporating other languages for client-side scripting? I'd
really just like to get away from JS in general :(

~~~
pyrotechnique
There are yes. I'll try to dig them up shortly.

IMHO it will never happen in the sense you imagine it but we'll see.

In the meantime you may want to check out emscripten
(<http://code.google.com/p/emscripten/>). It is a JavaScript backend for LLVM
which ultimately leads to the same functionality as having other languages on
the client.

------
railsjedi
Congrats on the release! Here's hoping for a CoffeeScriptConf in 2011

------
stenson
Who was responsible for that rad new CoffeScript logo / when was it added to
the site? Coffee-cup and typography look awesome! (Also, love the language).

~~~
jashkenas
Ramesh (<https://github.com/rampall>) just contributed it this week. Great
timing.

------
nopassrecover
This looks awesome. I've never used it, nor much JS, but now I'm going to
write something in it or about it. Cheers

------
stcredzero
Would people be interested in a Ruby-oriented project like this? Say, tiny.rb
ported to use Javascript? (Some Googler already has a Lua-esque VM for tiny.rb
as her 20% project.)

~~~
jashkenas
There are a number of existing projects that compile a partial Ruby into JS:

* <https://github.com/superchris/rubyjs>

* <https://github.com/jessesielaff/red>

* <https://github.com/tlrobinson/cappruby>

I'm afraid that Ruby semantics don't align too well with JavaScript semantics.
Things as basic as numbers, method dispatch, and variable scoping don't work
the same way. Either you end up with perfectly valid code written in one that
doesn't run on the other, or you have an extremely slow Ruby interpreter
implemented on top of JavaScript.

This is the main reason why CoffeeScript tries to stick as close to JavaScript
as possible.

~~~
stcredzero
Perfectly valid code that runs in one and not the other is fine, so long as
context switching can be minimized between browser and server. (It's still a
switch, but smaller.)

------
SupremumLimit
Thanks Jeremy! I think CoffeeScript is a wonderful replacement for JavaScript,
it made client side code so much nicer to write for me. Been using it since
0.7 (?).

------
dreyfiz
Thank you for CoffeeScript (changed my life!), and a very Merry Christmas to
you!

------
JoelMcCracken
Good job guys. I've just started using this in my side projects. Excited!

------
endtime
Congrats, Jeremy. Hope you have some well earned rest over the holidays.

------
sa_su_ke
should be possible tecnically having a coffescript for php?

