Core Lucy compiler
The 0.4.0 release of Lucy includes support for producing TypeScript definitions (.d.ts
files) behind a flag. You can use it like so:
lucyc --out-file out.js --experimental-dts input.lucy
This will produce another file, out.d.ts
alongside the JavaScript. This feature works with --out-file
and --out-dir
.
TypeScript definition support is available only through the Lucy CLI and bugs are to be expected. The plan is to bring stability to this feature and eventually drop the flag in favor of producing DTS by default.
Also added is a flag --print
to specify what is printed to stdout. The value can be either js
or dts
. This flag is to be used when not using either --out-file
or --out-dir
.
lucyc --print dts input.lucy
This is a major change to Lucy introducing 2 major changes:
Using invoke
now requires you call it like a function.
state start {
invoke(thing) {
}
}
Otherwise it is unchanged.
Symbols are explained in the docs. In short they provide a mechanism for references something that needs to be passed in on the JavaScript side, such as a guard function. The syntax for symbols is a :
followed by a name, similar to how they are used in Ruby and Elixir.
state idle {
pay => guard(:hasFunds) => processing
}
Adds support for block and line comments.
Fixes bug with multiple guards for the same transition.