Mars Programming Language

Mars 0.3

Upgraded type system, with local variable type inference and new scoping rules, switch exhaustion checks, working field reference and replace operations, and many fixed bugs.

Milestone information

Project:
Mars
Series:
trunk
Version:
0.3
Released:
2010-06-25  
Registrant:
Matt Giuca
Release registered:
2010-06-25
Active:
No. Drivers cannot target bugs and blueprints to this milestone.  

Download RDF metadata

Activities

Assigned to you:
No blueprints or bugs assigned to you.
Assignees:
46 Matt Giuca
Blueprints:
No blueprints are targeted to this milestone.
Bugs:
46 Fix Released

Download files for this release

After you've downloaded a file, you can verify its authenticity using its MD5 sum or signature. (How do I verify a download?)

File Description Downloads
download icon mars_0.3.0_src.tgz (md5) Source tarball 0.3 65
last downloaded 91 weeks ago
download icon mars_0.3.0-1_i386.deb (md5) Debian binary package for i386 0.3 92
last downloaded 3 weeks ago
Total downloads: 157

Release notes 

Upgraded type system, with local variable type inference and new scoping rules, switch exhaustion checks, working field reference and replace operations, and many fixed bugs.

Changelog 

View the full changelog

  * Pattern bindings in case statements are now like any other assignment --
    scoped to the entire function and in the same namespace as all the other
    locals. Patterns no longer create a new scope, and the variables they
    create no longer shadow existing locals. It is now a type error if a local
    variable has the same name but different type as a pattern variable
    (backwards incompatible). (LP: #513638)
  * It is now a compiler error if a switch statement does not cover all
    possible constructors of the type it switches over, preventing the
    possibility of runtime pattern match failure errors (backwards
    incompatible). (LP: #408411)
  * Variables no longer require declaration. Any variable assigned in a
    function is now implicitly a local variable. It is no longer an error to
    assign to a global variable or an undefined variable (this just creates a
    new local variable). (LP: #483082)
  * The field reference and replace expressions and the field update statement
    now work (previously they displayed "not implemented" errors). It is now
    possible to access and update individual fields of an object by name,
    without having to use a switch. (LP: #439171)
  * The field replace statement is now an expression; its result is the
    updated object. It previously didn't make much sense because the statement
    performed an implicit assignment of its source variable. (LP: #408301)
  * The field update operator changed from "=" to "=!", reflecting its impure
    nature. (LP: #595782)
  * It is now an error to have two fields of the same name in a given
    constructor. (LP: #513585)
  * It is now an error to have two variables of the same name in a given
    pattern. (LP: #509939)
  * Reading the value of (and therefore executing the body of) a computable
    global constant now caches the result so subsequent reads do not
    re-execute the body. Previously CGCs would be re-executed on each read.
    (LP: #491697)
  * The built-in "is" function has been moved to the "impure" module.
    (LP: #582634)
  * The "is" function now works on objects of user-defined types (previously
    always returned 0). (LP: #585724)
  * Added prelude function "ref" which gets the element of a list with a
    particular index. (LP: #582635)
  * Paul Bone: Fixed error compiling Mars on some systems, due to Readline
    code. (LP: #552168)
  * Critical type safety problem -- if a declared local variable and pattern
    binding have different types, after the switch, the variable name has the
    declared type, but the value bound by the case (of the wrong type). Fixed
    by giving pattern bindings the full function scope, forcing them to have
    the same type as any declared variable. (LP: #513638)
  * Internal error "Phi missing predecessor in CFG" for programs with complex
    nested switches. (LP: #567082)
  * Internal error "Field reference to something not an ADT" for case
    statements with a nested pattern with two fields. (LP: #576375)
  * Type error for cases with int literals on polymorphic types. (LP: #509457)
  * Internal error for string literals with '\0. (LP: #534159)
  * Internal error calling "error" or "get_env" with '\0 in string.
    (LP: #534161)
  * Library function "encodeURIComponent" gives garbage output on strings with
    non-byte characters. (LP: #585703)
  * Now correctly sets the exit status of Mars to the result of main – rounds
    to a machine-size int with wraparound rather than using mod. (LP: #552413)
  * The "show" function now correctly includes empty parens for terms built
    from nullary constructors. (LP: #587787)
  * Replaced "dummy term binding" technique with explicit rigid type variables
    (as now described in documentation for type unification). (LP: #488595)
  * The control-flow graph (CFG) representation now includes full type
    information. (LP: #574108)
  * The t_switch instruction no longer includes fully-recursive patterns, but
    a limited format which matches only a single tag. Switch statements are
    now factored into this much lower-level construct which is easier to
    compile into machine code. (LP: #408411)
  * The interactive environment now uses SSA variable names, so variables
    which are re-assigned are no longer physically clobbered in the
    environment; they are assigned with a new qualified name. This makes the
    semantics of interactive consistent with the rest of the language and
    fixes issues with certain backends or analyses. (LP: #580487)
  * Fixed test suite silently treating invalid "outcome" values as "fail".
    (LP: #574141)
  * No longer generates code for statements which are inaccessible because
    they are preceded by a return statement. This prevents malformed code
    generation. (LP: #517403)
  * Fixed parser not allocating a type to subexpressions of expressions which
    already have a type annotation. (LP: #578082)
  * Interactive mode executes type-annotated versions of statements.
    (LP: #578084)
  * Test suite is now orders of magnitude faster to run (fixed re-compilation
    for every case, causing N^2 behaviour). (LP: #589000)
  * Interpreter interface is now abstracted so it is possible to plug in
    different interpreter backends. (LP: #550708)
  * In the test framework, expecting a compile error now causes all of the
    runtime tests to be expected to be skipped, so they don't raise large
    errors when they are. (LP: #596734)
  * Terminator instructions now hold a context object. (LP: #408291)
  * Function signatures no longer have an "argmode". This was part of some
    uniqueness information analysis which was abandoned for a different
    representation, and has since been unused and completely obsolete.
    (LP: #550739)
  * All library functions are now documented. (LP: #486958)
  * The documentation is now syntax-highlighted for all Mars code.
    (LP: #576776)
  * If a bug in Mars causes an internal error, it will be displayed much more
    neatly, with a link to the "file bug" page on the bug tracker.
    (LP: #534165)
  * The test framework no longer generates .py files with Mars assembly (a bug
    dating back to when we actually generated Python output). (LP: #521992)
  * The src directory now includes a Makefile, so Mars can be compiled with a
    simple make. (LP: #522477)
  * The Mars Vim script (misc/mars.vim) has an updated list of built-in names.
    (LP: #539368)

0 blueprints and 46 bugs targeted

Bug report Importance Assignee Status
513638 #513638 Implicitly-declared locals should have function scope 2 Critical Matt Giuca  10 Fix Released
517403 #517403 Local variables on inaccessible lines considered global 2 Critical Matt Giuca  10 Fix Released
552168 #552168 readline module has a declaration in foreign_code section 2 Critical Matt Giuca  10 Fix Released
552385 #552385 readline uses "non-standard" strdup 2 Critical Matt Giuca  10 Fix Released
567082 #567082 Phi missing predecessor in CFG 2 Critical Matt Giuca  10 Fix Released
576375 #576375 Nested pattern with two fields raises interpreter error 2 Critical Matt Giuca  10 Fix Released
580487 #580487 Interactive doesn't assign unique names to variables 2 Critical Matt Giuca  10 Fix Released
483082 #483082 Variables should not require declaration 3 High Matt Giuca  10 Fix Released
509457 #509457 Type error for cases with int literals on polymorphic types 3 High Matt Giuca  10 Fix Released
534159 #534159 String literals with '\0' crash Mars 3 High Matt Giuca  10 Fix Released
534161 #534161 Calls to error or get_env with '\0' in string crash Mars 3 High Matt Giuca  10 Fix Released
574108 #574108 CFG representation needs type information 3 High Matt Giuca  10 Fix Released
574141 #574141 Test framework: Silent failure on bad "outcome" values 3 High Matt Giuca  10 Fix Released
578082 #578082 Type checker doesn't assign types to subexprs on exprs with types 3 High Matt Giuca  10 Fix Released
578084 #578084 interactive.handle_command doesn't execute type-annotated statement 3 High Matt Giuca  10 Fix Released
579113 #579113 ast_cfg does not assign types to unpacked variables 3 High Matt Giuca  10 Fix Released
579729 #579729 ast_cfg: Phi nodes do not update the type map 3 High Matt Giuca  10 Fix Released
585703 #585703 urllib.encodeURIComponent gives garbage output on non-byte values 3 High Matt Giuca  10 Fix Released
589000 #589000 Test framework re-compiles for each test case 3 High Matt Giuca  10 Fix Released
408301 #408301 Field replace statement should be an expression 4 Medium Matt Giuca  10 Fix Released
439171 #439171 Implement field ref, set and replace operations 4 Medium Matt Giuca  10 Fix Released
486958 #486958 Docs: Library functions need documentation 4 Medium Matt Giuca  10 Fix Released
488595 #488595 Type variable dummy-binding trick is flawed 4 Medium Matt Giuca  10 Fix Released
513585 #513585 Duplicate field name should be an error 4 Medium Matt Giuca  10 Fix Released
534165 #534165 Clean up internal errors 4 Medium Matt Giuca  10 Fix Released
550708 #550708 Abstract the interpreter interface 4 Medium Matt Giuca  10 Fix Released
574149 #574149 Test framework: --report-fail doesn't report expected compile errors 4 Medium Matt Giuca  10 Fix Released
582634 #582634 Move the "is" function into "impure" 4 Medium Matt Giuca  10 Fix Released
584081 #584081 urllib documentation assumes UTF-8 encoded string 4 Medium Matt Giuca  10 Fix Released
595782 #595782 Field update statement needs scarier notation 4 Medium Matt Giuca  10 Fix Released
596734 #596734 Test framework: Skipped runtime errors are still "unexpected" even if compile error is expected 4 Medium Matt Giuca  10 Fix Released
408291 #408291 terminator_instr has no context 5 Low Matt Giuca  10 Fix Released
491697 #491697 Interpreter: Cache CGC results instead of re-executing them 5 Low Matt Giuca  10 Fix Released
509939 #509939 Should not allow repeated variable name in pattern 5 Low Matt Giuca  10 Fix Released
521992 #521992 Test framework still generates .py files 5 Low Matt Giuca  10 Fix Released
522477 #522477 Src directory needs a Makefile 5 Low Matt Giuca  10 Fix Released
539368 #539368 Update names of builtins in mars.vim 5 Low Matt Giuca  10 Fix Released
550739 #550739 Remove argmode from function signatures 5 Low Matt Giuca  10 Fix Released
552413 #552413 Program exit code has incorrect modulo 5 Low Matt Giuca  10 Fix Released
576776 #576776 Docs should be syntax-highlighted 5 Low Matt Giuca  10 Fix Released
582635 #582635 Add prelude function "ref" 5 Low Matt Giuca  10 Fix Released
584839 #584839 interactive: :e should not evaluate thunks 5 Low Matt Giuca  10 Fix Released
585724 #585724 The 'is' function doesn't work on terms 5 Low Matt Giuca  10 Fix Released
587787 #587787 show() of nullary terms omits parens 5 Low Matt Giuca  10 Fix Released
408411 #408411 Pattern match failure should be caught at compile-time 6 Wishlist Matt Giuca  10 Fix Released
574277 #574277 Pattern typechecker gives slightly-wrong type error 6 Wishlist Matt Giuca  10 Fix Released
This milestone contains Public information
Everyone can see this information.