CoffeeScript was obviously inspired by Ruby. While CS is great, I've never gotten over the usage of "->" or "=>" to signify a function. To me, Ruby's "def" or "do" reads so much better. Especially with "end", to signify a barrier, as opposed to whitespace. Have you considered porting Ruby directly to JavaScript?
> I've never gotten over the usage of "->" or "=>" to signify a function.
Give it a try, perhaps. It's critical not to use "def" and "do" when your functions are first-class values that can be passed as arguments, or assigned to variables. It's for this reason that Ruby 1.9 has a new lambda syntax that looks a great deal similar to CoffeeScript's. For example:
request(url, def callback(response) do
...
end)
... that kinda thing is no good.
The reason it's an arrow is because in any decent function, the input determines the output, eg. input points to output. And therefore, the CoffeeScript syntax: (input) -> output
>> it doesn't turn out to be terribly useful in the end
True, I'd chose CoffeeScript over Opal.
>> Give it a try, perhaps.
Oh, I dig it, especially the fat arrow.
>> It's critical not to use "def" and "do" when your functions are first-class values that can be passed as arguments, or assigned to variables.
Still, I find "def" to be more `readable` than arrow symbols. I'm not sure how JavaScript's first class status for functions would deter a keyword containing letters. Considering JavaScript itself uses function as its.
>> The reason it's an arrow is because in any decent function, the input determines the output, eg. input points to output. And therefore, the CoffeeScript syntax: (input) -> output
That definitely makes logical sense. Still, I feel the readability might be increased by using words, which the mind is more attuned to quickly applying meaning to.
> Especially with "end", to signify a barrier, as opposed to whitespace.
But in any programming language you're already indenting blocks for humans. Why repeat the same work? Especially when it allows for inconsistency between how a human and how a machine would read the code.
People HAVE written Ruby -> Javascript compilers. Check out Opalrb, Redscript, Coldruby, Hotruby, Webruby...
The -> comes from Haskell's lambda syntax (\x -> x+1). It's a nice solution. 'Def' doesn't really work for lambdas, do does, but curly-brace blocks are nicer in Ruby if you put them everwhere {|x| x+1}... Keep in mind that Javascript is alot like Scheme in that there isn't really a difference between named and anonymous functions. You can write Scheme and Javascript pretty much the same way...
By the way, thanks for your work on _ & Backbone!