Skip to content

Releases: leafo/mooncoffee

v1.2.0

Choose a tag to compare

@leafo leafo released this 12 Aug 14:47
v1.2.0

First release with language changes that add syntax on top of CoffeeScript 1.12.7.

  • Add const, which declares a block scoped JS const at the statement site instead of a hoisted var, with the name still reserved for the whole function at compile time so it can't be redeclared, shadowed, or reassigned
  • Compile const destructuring to native JS destructuring instead of the expanded ES5 form, so defaults apply only to undefined and array patterns use the iterator protocol, matching CoffeeScript 2
  • Report compile errors for reassigning a const (including +=, ++, loop variables, and writes from nested functions), redeclaring a name, using const as an expression, and patterns JS destructuring can't express
  • Add await, following the CoffeeScript 2 design: there is no async keyword, a function whose body contains await compiles to async function
  • Support await in bound functions, in comprehensions used as expressions (wrapped in an async IIFE), and as await return
  • Report compile errors for await outside a function, a function mixing yield and await, and await in a class constructor
  • await is now a keyword, so it can no longer be used as a variable name the way it could in CoffeeScript 1.x, property access is emitted as a["await"] like other keywords

Code that uses none of the new syntax still compiles byte-for-byte identical to CoffeeScript 1.12.7.

Full Changelog: v1.1.0...v1.2.0

v1.1.0

Choose a tag to compare

@leafo leafo released this 11 Aug 16:24
v1.1.0
  • Embed parse tables as generated Go code instead of JSON parsed at startup, CLI startup goes from 15ms to 2ms
  • Move the grammar into Go (internal/parser/grammar.go), one entry per production with its semantic action attached
  • Add in-repo LALR(1) table generator (go generate ./internal/parser), Jison and Node are no longer part of the grammar pipeline
  • Add test verifying the generated automaton is identical to the one upstream shipped
  • Replace string token tags with integer enums
  • Add hand written scanners for lexer hot paths (numbers, string openers, operators), replacing regexp2
  • Token values are now zero copy substrings of the source, tokens are slab allocated
  • Disable GC in the CLI since it's a one shot process, soft memory limit keeps large batch invocations bounded
  • Report the MoonCoffee version separately from the base CoffeeScript version

Output is still byte-for-byte identical to CoffeeScript 1.12.7.

Full Changelog: v1.0.0...v1.1.0

Initial release

Choose a tag to compare

@leafo leafo released this 10 Aug 18:17
v1.0.0