Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All this comes from the fact that people think for some reason that coffeescript is a javascript variant. Obviously, it has been demonstrated that it's not: syntax is different, semantics are different.

Also, users of cs shouldn' t have to think about how one language "transpile" to another. Otherwise what would be the point of using cs? If coffeescript designers have provided a clear documentation of their language behaviour, users should refer to it, and not make wild guesses of how it behaves, or how it translates to js.

That said, I'm not an expert of either language.



You might be wondering why people think that. Here's why: it's the entire point of CoffeeScript. According to the first two intro grafs at coffeescript.org:

> CoffeeScript is a little language that compiles into JavaScript. Underneath all those awkward braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

> The golden rule of CoffeeScript is: "It's just JavaScript". The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript.


That's a misunderstanding it seems. The real meaning is that "under the hood, it's javascript", and not "it's like javascript". People read "It's just Javascript", and jump to the second meaning, without thinking of the first, but the rest of the text is pretty explicit.




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

Search: