For some language X where Y “compiles to “ X, Y is a new language if it introduces new semantics. For example, pure functional semantics, or object-orientation, or pattern matching, or method flavours, or static typing.
One easy test for this is to ask whether compiling Y to X can be done in small chunks or whether it requires “Whole program rewriting.” For example, transforming a program with continuations into CPS requires whole-program rewriting. I would call any language that adds continuations to JavaScript a new language on that basis alone.
CoffeeScript is almost entirely local transformations. I think of it as JavaScript.
I think differently in CS vs JS. I go for different solutions because they seem more elegant in CS than they did in JS. And if language shapes how we think, then surely thinking differently makes it a different language. Maybe.
This seems like a reasonable definition. Does CoffeeScript not have its own idioms, though? I’ve never used it myself, but a search turned up this chapter on idioms in “The Little Book on CoffeeScript”: http://arcturo.github.com/library/coffeescript/04_idioms.htm...
Javascript has a distinction between statements and expressions, while to my knowledge CoffeeScript does not. "Everything is an expression" is a huge difference in semantics even though nothing has been added.
Let us suppose that languages BE and LE were designed completely independently, but came up with the same semantics in a different syntactic packet. For arguments' sake, let's suppose Google made one and Apple the other. They had different marketing budgets, different logos, different conferences. Religious wars were fought over them. Even though they had identical semantics.
I didn't downvote him, but one alternative is that a language is defined by a grammar. Of course you'd want to group certain very similar grammars together as one language (Python 2.x and 3.x), but the grammars of CoffeeScript and JavaScript are significantly different.
That’s also a reasonable definition. Since I didn’t say “if and only if,” both definitions are compatible. By the grammar definition, we could make a language with pure JavaScript semantics but Lisp-ish s-exprs, and it would be a different language as well.
For some language X where Y “compiles to “ X, Y is a new language if it introduces new semantics. For example, pure functional semantics, or object-orientation, or pattern matching, or method flavours, or static typing.
One easy test for this is to ask whether compiling Y to X can be done in small chunks or whether it requires “Whole program rewriting.” For example, transforming a program with continuations into CPS requires whole-program rewriting. I would call any language that adds continuations to JavaScript a new language on that basis alone.
CoffeeScript is almost entirely local transformations. I think of it as JavaScript.