2 ms·
I don't think a direct translation of Ruby -> Javascript would have made much sense, though. It makes much more sense to custom mould a new language to the nee
by michaelchisari 15y ago
I don't think a direct translation of Ruby -> Javascript would have made much sense, though. It makes much more sense to custom mould a new language to the needs of Javascript, than to try and fit Ruby into a whole new context.
I started looking into making a parser that took CoffeeScript and parsed it into PHP, and the farther I got spec'ing things out, the less the CoffeeScript syntax made sense for the context of PHP. So it would make more sense to start new, and create a new syntax that fits better. I'm assuming the same process may have occurred for CoffeeScript.
Anyways, as someone who greatly prefers Python over Ruby, I love using whitespace for blocks.
- fizx 15y agoRuby has a 6000 LOC yacc parser for the grammar. I would bet that Coffee's grammar is smaller, tighter, and less full of perlisms.
- InclinedPlane 15y agohttps://github.com/jashkenas/coffee-script/blob/master/src/grammar.coffee https://github.com/jashkenas/coffee-script/blob/master/src/g...