Re:"Hello World" in Dart, compiled to JavaScript
by geon on Wednesday October 12, 2011 @03:05PM
(#3104065)
> where exactly is the line
Not that I have an aswer to that, but I have the impression Coffeescript was designed specifically to compile 1:1 to matching js.
A lot of the distinction seems to depend on the local culture of the language. I've seen a lot of lispers talking about their new "language", where they add some minor feature to scheme.
Re:"Hello World" in Dart, compiled to JavaScript
by cubicle67 on Thursday October 13, 2011 @04:57AM
(#3106639)
...Coffeescript was designed specifically to compile 1:1 to matching js
possibly initially, but there's a lot of constructs in coffeescript that aren't in js eg existential operator
solipsism = true if mind? and not world?
compiles to var solipsism;
if ((typeof mind !== "undefined" && mind !== null) && !(typeof world !== "undefined" && world !== null)) {
solipsism = true;
}
see also splats http://jashkenas.github.com/coffee-script/#splats, function binding and comprehensions over collections eg eat food for food in ['toast', 'cheese', 'wine']
Here we have two ways of expressing code, coffeescript and dart. Both are syntactically quite different from js, both offer features not found in js, both encourage you to write code differently to how you would in js and both compile to plain js.