Live data from Hacker News

CoffeeScript hits 1.0 -- Happy Holidays, HN

jashkenas.github.com

51–55 of 55 posts

Re: CoffeeScript hits 1.0 -- Happy Holidays, HN

#51

Earlier quoted context omitted.

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 rule…

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 requirem…

"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.

Re: CoffeeScript hits 1.0 -- Happy Holidays, HN

#52

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!

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

Aha - thanks. And thanks satyr!

Re: CoffeeScript hits 1.0 -- Happy Holidays, HN

#54

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.

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.

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

Re: CoffeeScript hits 1.0 -- Happy Holidays, HN

#55
post #24

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).

Thanks stenson! Great timing indeed. I stumbled upon coffeescript barely a week before the 1.0 release and fell in love.
Post reply on HN