Hacker News new | ask | show | jobs
by Sapient 5470 days ago
Just reading your comment, it occurred to me that this is an editor problem.

What we actually need are editors in which you can set you language (haml, slim, less etc), and then those are compiled and saved, in realtime to html, erb, css etc.

Not having used too much Coffee Script yet, I don't know what the transformation from CS -> JS -> CS would result in, but I believe HAML -> HTML -> HAML would be pretty much 1:1, and html2haml already produces pretty much exactly the same haml I would have produced if I had done the conversion manually.

2 comments

One of the goals of CoffeeScript is to produce only well-formed, compliant JS. JS to CS conversion would go against that.
Yeah, good catch— I didn't mean to say any JS->CS conversion was bad, just that it shouldn't be a part of the core language or of a real workflow.
I can see such a conversion like that leading to a scenario where someone writes some broken markup and the conversion to and from formats only makes the situation worse.
You are of course correct, this was a horrible idea!
I don't know if this reply was read as being sarcasm, but It honestly wasn't. I was wrong about the whole idea, it would never work.
Eh, it's an interesting line of thinking.