Releases: qsctr/metro
Releases · qsctr/metro
v0.3.2
Changes:
- The name of the project has been changed to Metro. Program file extensions have been changed to
.metro
accordingly (and generated interface files to.metroi
).
New features:
- Line comment syntax added. Start a comment to the end of the line with
#
.
Other:
- Updated documentation.
v0.3.1
New features:
- The compiler now avoids recompiling any modules which do not need to be recompiled, both in the same run (if a module is depended on by multiple modules) and across runs (if a module hasn't changed and neither have any modules that it depends on).
- In addition to JS output, the compiler now also generates interface files (with extension
.dtfpli
) containing the exported identifiers of each module, which is necessary for recompilation avoidance to work. The format is currently just the output of the defaultShow
instance for the internal Haskell data structures, but this may change in the future. - A basic command-line interface was added, with options to enable/disable internal debug mode, set output verbosity, and show the compiler version. There is also a help option and nicer error messages when parsing options fails.
- The compiler now prints the filenames of the modules being compiled. To disable this you can set verbosity to 0. Otherwise, no output means no recompilation was necessary.
- Compilation errors are now written to standard error instead of standard output.
- The compiler now exits with exit status 1 if there is a compilation error (or an error parsing command-line arguments).
- JavaScript parsing errors in native expressions are now handled nicely and error locations are reported.
- The compiler now reports an error if parameter names (i.e. variable patterns) in native function definitions are named in such a way that their corresponding generated JavaScript name is different, which means that they cannot be referenced in the native expression.
Bug fixes:
- The compiler now reports an error when native expressions contain more input after an expression rather than failing silently and just using the first expression in the output.
Other:
- Internal optimizations.
v0.3.0
New features:
- Added support for modules. See the language reference for more information.
Changes:
- The compiler now takes the full filename of the program as command-line argument, instead of just the basename without the extension.
Bug fixes:
- Fixed parsing error when there is whitespace present before the first declaration and no imports.
- Changed code generation for identifiers to avoid possible name collision.
Other:
- Updated documentation.
- Some internal reorganization.
v0.2.1
New features:
- The compiler now reports errors for unknown variables, duplicate definitions, and variable shadowing (which is disallowed).
- Declarations are automatically reordered so that you can use variables before they are defined. For example, the following code is valid:
Note that this only applies to code in
let b = f a let a = 2 def f x -> x
let
declarations which is immediately evaluated.let
declarations which are circularly defined result in an error. Functions (either defined withdef
or as a lambda expression in alet
binding) have always been able to refer to other variables later on in the file and be recursive.
Changes:
- The compiler now outputs ECMAScript modules with the .mjs extension.
Bug fixes:
- The compiler now finds the correct path to the JS components so that it can be invoked outside of the project directory.
Other:
- Rewrote and improved many parts of the compiler.
- Preliminary work was done on support for modules.