maxtaco / coffee-script

IcedCoffeeScript
http://maxtaco.github.com/coffee-script
MIT License
727 stars 58 forks source link

Request: Allow types to be specified in function declarations and support interface concepts #82

Open m1sta opened 11 years ago

m1sta commented 11 years ago

Typescript is important from a team-scalability perspective. Coffeescript is important from a productivity and maintainability perspective (although these obviously impact team-scale concepts too).

It would be fantastic if we could optionally write functions like the following...

myFunc = (a:String or Number, b:Person) -> 

.... so that IDE's could quickly give us hints on types. Type inference is a better alternative in most instances but even the best IDE's are still struggling with how to do this well without hinting.

I've recently being getting a lot of use out of a utility function with the signature below specifically to provide a hint to a custom IDE extension (plus a little simple exception throwing), but such an approach is never going to spread...

confirmArgumentTypes arguments, {a:[String, Number], b:Person}
maxtaco commented 11 years ago

Agreed, this would be a huge improvement, I think Typescript is great. Just might not be doable without an unmergable fork away from mainline CoffeeScript

On Tue, Aug 6, 2013 at 7:12 PM, m1sta notifications@github.com wrote:

Typescript is important from a team-scalability perspective. Coffeescript is important from a productivity and maintainability perspective (although these obviously impact team-scale concepts too).

It would be fantastic if we could optionally write functions like the following...

myFunc = (a:String or Number, b:Person) ->

.... so that IDE's could quickly give us hints on types. Type inference is a better alternative in most instances but even the best IDE's are still struggling with how to do this well without hinting.

— Reply to this email directly or view it on GitHubhttps://github.com/maxtaco/coffee-script/issues/82 .

m1sta commented 11 years ago

True. Maybe this should be an issue in the main coffeescript branch instead then?

maxtaco commented 11 years ago

Yeah! Might already be there, worth a check. On Aug 7, 2013 10:30 PM, "m1sta" notifications@github.com wrote:

True. Maybe this should be an issue in the main coffeescript branch instead then?

— Reply to this email directly or view it on GitHubhttps://github.com/maxtaco/coffee-script/issues/82#issuecomment-22303663 .

doublerebel commented 11 years ago

contracts.coffee has always interested me. I wonder what iced+contracts would look like...