latte

JavaScript, with a little milk and sugar

latte-js

JavaScript, with a little milk & sugar

Latte is an extension of JavaScript, bringing features of CoffeeScript in a familiar JS syntax.

If you like CoffeeScript, but not the Rubyish syntax, Latte is for you.

http://lattejs.com

npm install -g latte

or

npm install --save-dev latte
$ latte --help
Latte.js compiler.
Usage: latte [options] [--] files...
 
Options:
  -c, --compile  Compile input files. If not specified, evaluates the files.
  -o, --output   Output directory, to be used with --compile.
  --version      Show version
$ latte
> [1,2,3].map(x => x * x)
[ 1, 4, 9 ]
latte -o lib/ -c src/

Full documentation at http://lattejs.com

http://tc39wiki.calculist.org/es6/arrow-functions/

$ latte
> [1,2,3].map(x => x * x)
[ 1, 4, 9 ]
> var [x,y] = [10,20];
> x
10
> y
20
> `wow
I'm multiline!`
'wow\nI\'m multiline!'
> var x = 10, y = 3;
> `The answer is: ${ Math.pow(x,y) }`
'The answer is: 1000'
> var s = "Hello world!";
undefined
> [s[i].charCodeAt(0) for (i in s)]
[ 72,
  101,
  108,
  108,
  111,
  32,
  119,
  111,
  114,
  108,
  100,
  33 ]
let x = 'something';
for (let i in [...]) {
    ...
}
  • Changed iterators & generators to reflect latest ES6 spec (no more StopIteration).
  • Added benchmarks (just for generators, initially).
  • Optimised generators for tail call emulation use case - performance is comparable to trampoline.
  • Monads now implemented via generators - reusing control flow logic, and to allow use of native generators implementation where available (this will be a command line flag later on).
  • Monads now properly support return statement (fixes #9).
  • Added support for array spreads (via https://github.com/square/es6-spread).
  • Added support for rest params (via https://github.com/thomasboyt/es6-rest-params).
  • Added support for generating source maps (via https://github.com/benjamn/recast).
  • Allow monad binds in for loops.
  • Allow monad binds in test/update expressions in all supported control structures.
  • Fixed break and continue in monad blocks.
  • Fixed issue with monadic binds in a multiple-var-decl statement resulting in undefined references.

Fixed issue with using functions as part of a monad bind.

Various fixes.

  • Support for monads.
  • Initial support for ES6 generators.
  • For-of statement.

Array comprehension improvement

Clear module cache when evaluating script in-process

  • Array comprehension with variables
  • Set __dirname properly when evaluating script in-process
  • Array comprehensions
  • Command line improvements
  • For-in-if statement: for (x in y if (x.is('awesome')))
  • Array destructuring
  • Let statement
  • Support for more AST nodes (stops the noisy output)

Basic quasi-literals support

Node 0.8 compatibility

Grunt task

Unix fixes

Initial release, arrow functions