News for hackers. Stuff that matters.
Re:Announcing CoffeeScript 2 by dugmartin on Monday September 18, 2017 @03:08PM (#15278605)
I felt the same way when I switched from CoffeeScript to TypeScript but the type checking was worth all the braces, returns and lack of existential operator. If CoffeeScript added an (optional) type system I'd switch back in an instant.
Re:Announcing CoffeeScript 2 by GeoffreyBooth on Monday September 18, 2017 @04:02PM (#15279014)
It’s not elegant, but there is a way to do type checking in CoffeeScript: http://coffeescript.org/#type-annotations
Re:Announcing CoffeeScript 2 by Yaggo on Tuesday September 19, 2017 @05:36AM (#15283049)
This is cool! That being said, it would be very nice to have (optional) syntactically more beautiful type annotation. I assume Flow must be compatible with regular javascript, but CoffeeScript could take more flexible approach. I have no idea what the actual syntax could be, though.
Re:Announcing CoffeeScript 2 by ralmidani on Monday September 18, 2017 @05:08PM (#15279606)
Thanks for the link. :)

But wow, "not elegant" is an understatement.

Re:Announcing CoffeeScript 2 by kbp on Monday September 18, 2017 @03:59PM (#15278989)
> If CoffeeScript added an (optional) type system I'd switch back in an instant.

The home page talks a little about achieving this by using Flow annotations in Coffeescript source and then having the build system pass the Javascript output to Flow: http://coffeescript.org/#type-annotations

Re:Announcing CoffeeScript 2 by ralmidani on Monday September 18, 2017 @03:29PM (#15278769)
That would be really nice, but CoffeeScript will probably not be adding types unless they start adding them to JavaScript.

It is a dilemma, but so far I have gotten by without type-checking.

Re:Announcing CoffeeScript 2 by vanderZwan on Monday September 18, 2017 @03:46PM (#15278892)
Well, guess it's time for someone to build yet another layer of abstraction by writing a typed superset that compiles-to-CoffeeScript then!

(I'm joking, but actually.. why not?)

Re:Announcing CoffeeScript 2 by petecox on Monday September 18, 2017 @09:29PM (#15281133)
call it ToffeeScript - a dialect of CoffeeScript that transpiles to TypeScript?
Re:Announcing CoffeeScript 2 by jashkenas on Monday September 18, 2017 @10:32PM (#15281349)
I'm afraid you're a few years too late!

https://github.com/jiangmiao/toffee-script

Re:Announcing CoffeeScript 2 by rattray on Tuesday September 19, 2017 @03:50AM (#15282558)
You might like LightScript: http://lightscript.org

Good interop with Flow isn't quite there yet, though.