Super set of CoffeeScript with types
- extremely incomplete yet.
- heavily under development
- some dirty hack of CS
struct Point {
x :: Number
y :: Number
}
p :: Point = {x: 3, y: 3}
line :: Point[] = [{x: 3, y: 4}, {x: 8, y: 5}, p]
f :: Number -> Number = (n) -> n * n
((n :: Number) :: Number -> n * n)(3)
See test/type.coffee as working codes.
$ npm install typed-coffee-script
now aliased tcoffee
$ tcoffee --js < scratch.coffee > scratch.js
- ✅ Struct definition
- ✅ Typed function definition
- ✅ Function call with typecheck
- ✅ Typed Array
- ✅ Member access
- ✅ If statement
- ✅ ForIn statement
- ✅ ForOf statement
- ✅ Range
- ✅ Function
- ✅ BinaryOperator
- Scope about this and class
- Generics
- Generate pure coffee
- Share type context with some scripts
- Super set of CoffeeScript (must be passed all coffee tests)
- Type check target is CS AST, not compiler.
- Inspired by TypeScript, Roy and other altjs.
{
} } {
{ { } }
} }{ {
{ }{ } } _____ __ __
( }{ }{ { ) / ____| / _|/ _|
.- { { } { }} -. | | ___ | |_| |_ ___ ___
( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \
|`-..________ ..-'| | |___| (_) | | | || __/ __/
| | \_____\___/|_| |_| \___|\___| .-''-.
| ;--. .' .-. )
| (__ \ _____ _ _ / .' / /
| | ) ) / ____| (_) | | (_/ / /
| |/ / | (___ ___ _ __ _ _ __ | |_ / /
| ( / \___ \ / __| '__| | '_ \| __| / /
| |/ ____) | (__| | | | |_) | |_ . '
| | |_____/ \___|_| |_| .__/ \__| / / _.-')
`-.._________..-' | | .' ' _.'.-''
|_| / /.-'_.'
/ _.'
( _.-'
Complete enough to use for nearly every project. See the roadmap to 2.0.
npm install -g coffee-script-redux
coffee --help
coffee --js <input.coffee >output.js
Before transitioning from Jeremy's compiler, see the intentional deviations from jashkenas/coffee-script wiki page.
git clone git://github.com/michaelficarra/CoffeeScriptRedux.git && cd CoffeeScriptRedux && npm install
make clean && git checkout -- lib && make -j build && make test
I'd like to thank the following financial contributors for their large donations to the Kickstarter project that funded the initial work on this compiler. Together, you donated over $10,000. Without you, I wouldn't have been able to do this.
- Groupon, who is generously allowing me to work in their offices
- Trevor Burnham
- Shopify
- Abakas
- 37signals
- Brightcove
- Gaslight
- Pantheon
- Benbria
- Sam Stephenson
- Bevan Hunt
- Meryn Stol
- Rob Tsuk
- Dion Almaer
- Andrew Davey
- Thomas Burleson
- Michael Kedzierski
- Jeremy Kemper
- Kyle Cordes
- Jason R. Lauman
- Martin Drenovac (Envizion Systems - Aust)
- Julian Bilcke
- Michael Edmondson
And of course, thank you Jeremy (and all the other contributors) for making the original CoffeeScript compiler.