Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Annotated CoffeeScript Grammar (tomayko.com)
26 points by ash on March 16, 2010 | hide | past | favorite | 10 comments


The guys over at Humanized (now at mozilla) did this for plain javascript about two years ago, FWIW. It's not quite as awesome when you don't have a sweet parser DSL.


[..searching...]

Are you talking about code-illuminated? [1,2,3] Interesting approach - works right in the browser.

For some reason I prefer docco output. I'm not sure why. Maybe the design is better. Maybe the code being annotated is better.

[1]: http://code.google.com/p/code-illuminated/

[2]: http://www.toolness.com/wp/?p=441

[3]: http://code-illuminated.googlecode.com/hg/index.html#docs/do...


That is what I was talking about. I remembered it being Atul but looks like I was a year off.


awesome, could this be the start of Knuth's literate programming for the 21st-century web world?

http://www-cs-faculty.stanford.edu/~knuth/lp.html http://en.wikipedia.org/wiki/Literate_programming


Yeah, that's exactly what I thought.

By the way, docco is behind this: http://jashkenas.github.com/docco/ (again pointed by http://tomayko.com/linkings/9f266cc6a6118995e75ffb963a7dce3e)


No. Knuth's literate programming had the source code presented out of order (in whatever order the explanatory text desired).


Actually yes, because of JavaScript/CoffeeScript's habit of pushing declarations up before evaluation, you can more or less lay out your code in any order. We take advantage of this in the Lexer, here...

http://jashkenas.github.com/coffee-script/documentation/docs...

...to stash all of the regex matchers down at the bottom of the file, even though the functions that make use of them come first.



It's code illuminated. I know because it was on HN about a year ago and I forked it on Github back then :)

Edit: link - http://code.google.com/p/code-illuminated/


No, this (docco) is a separate implementation. Even the language is different - CoffeeScript vs JavaScript. Compare the source:

http://github.com/jashkenas/docco/blob/master/docco.coffee

http://code.google.com/p/code-illuminated/source/browse/docs...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: