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

Coffeescript is great in theory. The problem is that when debugging stuff in the browser, you're going to be looking at Javascript in Chrome Developer Tools or Firebug. You can hopefully do an inverse mapping from generated JS to the corresponding line in Coffeescript...but that's kind of a pain, especially because it's not a line for line conversion.

Short of patching Chrome Dev Tools to support stepping through Coffeescript itself, not sure how to fix that.




The truth, (and a big part of the reason why we haven't already tried to solve this), is that it hasn't posed a problem for folks who are building apps in CoffeeScript. The transformation is straightforward enough that by glancing at the line number mentioned in the JavaScript, it's immediately obvious where the problem is in the CoffeeScript.

That said, I'd love to have a true solid debugger. The browser vendors (starting as soon as Firefox 4, perhaps) have plans to add better support for compile-to-JavaScript languages.

https://bugzilla.mozilla.org/show_bug.cgi?id=618650

http://intertwingly.net/blog/2010/11/25/Hobgoblin-of-Little-...


>The browser vendors (starting as soon as Firefox 4, perhaps) have plans to add better support for compile-to-JavaScript languages

That are great news, Do you thing we will see many new languages that compile to JS in the near future?


That's a pretty lame excuse. There also isn't a simple line for line relationship between C code and x86 code or C# code and MSIL code. But there's a standard solution to this problem when debugging: let the compilers generate mapping information.

For something like CoffeeScript, you'd probably have a debug compilation mode where each line of generated code is annotated with comments containing line numbers or full lines of code from the original CoffeeScript source code. It wouldn't be as convenient as a true source-level debugger for CoffeeScript, but it should suffice.


As far as I'm aware, there is no such debugging mode for CoffeeScript. The current method of debugging really is to look in the JS and then find the corresponding CS code. They do make this easier by keeping the JS code as readable as possible.


Oh, I know. I was saying that it would be doable to implement.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: