Skip to content

Releases: qsctr/metro

v0.3.2

01 Jan 07:32
Compare
Choose a tag to compare

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

26 Jul 04:38
Compare
Choose a tag to compare

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 default Show 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

18 Jul 13:58
Compare
Choose a tag to compare

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

02 Jul 14:45
Compare
Choose a tag to compare

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:
    let b = f a
    let a = 2
    def f x -> x
    
    Note that this only applies to code in let declarations which is immediately evaluated. let declarations which are circularly defined result in an error. Functions (either defined with def or as a lambda expression in a let 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.

v0.2.0

13 Nov 05:00
Compare
Choose a tag to compare

New features:

  • Native function definitions
    def native add
        x y -> x + y
    
  • Native let bindings
    let native pi = Math.PI
    let native print = console.log
    
  • main function
    def main
        _ -> print "hello world"
    

v0.1.1

22 Aug 11:55
Compare
Choose a tag to compare

New features:

  • Multi-expression case matching
case x, y of
    1, 2 -> ...
    a, b -> ...
  • Wildcard patterns
def is-hello
    "hello" -> 1
    _       -> 0

Also added haddock documentation for all modules.

v0.1.0

20 Jun 22:47
Compare
Choose a tag to compare

Initial release.

Syntax support for:

  • Declarations
    • Def
    • Let
  • Expressions
    • Variables
    • Literals
    • Applications
    • If-then-else
    • Case
    • Lambda
  • Patterns
    • Variables
    • Literals
  • Literals
    • Numbers
    • Strings