[Mono-list] Nemerle 0.2.9 released

Michal Moskal Michal Moskal <michal.moskal@gmail.com>
Wed, 23 Mar 2005 01:35:40 +0100

We are pleased to announce the 0.2.9 release of the Nemerle compiler
and the language.

Nemerle is a high-level statically-typed programming language for the
.NET platform. It offers functional, object-oriented and imperative
features. It has a simple C#-like syntax and a powerful meta-programming

Features that come from the functional land are variants, pattern matching
and type inference and parameter polymorphism (aka generics). Meta-system
allows great compiler extensibility, embedding domain specific languages,
partial evaluation and aspect-oriented programming.

The source tarball can be downloaded from:




MSI, DEB and RPM packages (as well as the source tarball of course)
as usual from:


The binary packages may have a small lag to the source release.

New features in this release include (from the NEWS file):

0.2.9, Mar 22 2005
  This is preview release before 0.3.0, which is real soon now. There
  are lots of changes in this version -- the parser and the typer
  (which constitute more then half of the compiler) have been replaced
  by entirely new implementations.

  There is a number of backward incompatible changes in this release.
  Most of them were previously discussed on the mailing list, and
  received rather good feedback other only generate warnings in this
  release. We apologize for both. We hope they make Nemerle a better
  language. On the plus side -- we should be now far closer to certain
  language stabilization point.

  0.3.0 should bring implicit conversions, List iterators as list[T] methods
  and maybe some more goodies.
  Incompatible language changes:
    * Variant options are now nested inside enclosing variant, so their
      names need to be prefixed with variant name. For example:
        variant Foo { | A | B { x : int; } }
        def x = Foo.A ();
        match (some_foo) {
          | Foo.B (3) => ...
	  | _ => ...
      You can mark variant with [ExternallyVisibleOptions] to import its
      options outside the variant or open variant name with 'using'. 
      More details in this thread:
    * Generic types use now [] instead of <>. That is there is 'list [int]' 
      not 'list <int>'. This is the second (and hopefuly last ;-) time we 
      change it.  More details in this thread:
    * Record patterns like '{ foo = 42; bar = 3 }' are now deprecated. New 
      'where' patterns have been introduced, to explicitly mark the class
      used for matching:
        | Foo.Bar where (x = 3, y = Qux) => ...
        | Foo.Bar where (3, Qux) => ...
      Variant patterns now also support field names:
        | Deep.Though (x = 7) => ...
    * The ':' operator in patterns should from now on be only used to 
      statically enforce type. Runtime type checks should be performed
      with the 'is' operator which uses the same syntax:
        match (some_list) {
          | (x : int) :: xs => OverloadedFunction (x); loop (xs)
	  | [] => {}

        match (some_expr) {
          | x is Foo => ...
	  | x is Bar => ...
	  | _ => ...
      Trying to use ':' or 'is' in the other context will rise warning. It 
      will be hard error for ':' used as 'is' in future release.
    * The catch handler syntax has been changed to reflect change in 
        try {
	} catch {
	  | foo is SomeException => ...
	  | bar is Exception => ...
	  // or | bar => ...
	  // or | _ => ...
    * Macros can no longer be nested in classes
  Language additions:
    * Added <<, >>, |, ^ and & operators. %|, %^ and %& remain there.
    * It is now possible to ignore values like this:
        _ = ignore_me (17);
    * It is now possible to assign stuff to tuples, like this:
        mutable x = 7;
	mutable y = "foo";
	(x, y) = (42, "bar");
    * Function parameters can be now marked 'mutable'.
    * The 'partial' modifier on classes is now supported.
    * '{ def _ = foo; }' is now allowed without the additional '()'
      at the end.
    * New 'throw;' expression to rethrow the exception.
    * The type inference engine has been replaced by a new one:
      - code like this compiles fine:
          def foo (x) { x.bar () }
	  List.Map (some_list, foo)
	when the type of 'some_list' is known.
      - overloading resolution now works when passing functional values:
          List.Sort (some_list, string.Compare)
      - variant option's constructors have now proper type, that is there
        is no longer need to 'SomeVariant.Option () :> SomeVariant.Option'
      - stuff like 'array [A (), B ()]' should now work (if 'A' and 'B' have a 
        common supertype)
    * Add 'repeat (times) body' language construct

  Library changes:
    * IMap.Fold used to use reverse parameter order then other fold 
      functions. It is fixed now.
    * A new Set class has been added.
    * Nemerle.Collections.Vector is now enumerable (patch by nuffer).
    * New functions in List:
      - MapFromArray
      - GetElementType
      - Contains
      - ContainsRef
      - FirstN
      - ToString (separator : string)
    * List Length() and IsEmpty() are now properties.
    * New functions in Option:
      - Iter
      - GetHashCode override
    * Stack.Top() is now a read/write property.
  Macro library changes:
    * Concurrency macros based on implementation of Polyphonic C# 
      has been added (implemented by Ricardo).
    * The foreach macro now uses semantics consistent with matching:
      foreach (s : string in foo) requires elements of foo to be of
      statically known type string, foreach (s :> string in foo)
      casts each element of foo to string (raising exception in case
      of problems) and foreach (s is string in foo) executes the loop
      body only for strings in foo.
    * Assertions macros now have new syntax extensions available. They can be
      used like in http://nemerle.org/macrouse.html#designbycontract
    * Added macro library for type-safe SQL operations with MS SQL Server
    * Diagnostics macros now have parameterless Trace macro and 'time' macro
      for measuring performance of some chunk of code
    * Quotations of patterns, types and expressions are now unified to 
      simple use of <[ some code ]>
    * Added OverrideObjectEquals macro for automating overriding of
      Equals (object) method with type-safe Equals (SomeType) method

  Other stuff:
    * Parser has been changed, it gives better error recovery, forward
      lookup and capability of deferring parsing in syntax extensions 
      (see http://nemerle.org/mailman/pipermail/devel-en/2005-March/000427.html)
    * We have a new tool -- a C# to Nemerle converter. It produces
      human-readable Nemerle sources. 
    * We have added over 300 converted testcases from MCS. ncc
      behaves now far more sane and C#-like especially at the class level.
    * The -doc switch can be now used with NDoc. You can have a look at
      the example output: http://nemerle.org/doc/
    * Some warnings can be now disabled by-number, there is also -warn
      warning level switch.
    * Simple Nemerle interactive shell has been included in the distribution.
    * The debug symbol output should work under MS.NET.
    * The Sioux webserver has been greatly extended.
    * A syntax highlighting file for Midnight Commander editor.
    * The htmldumper tool has been written -- it creates pretty Nemerle 
      sources for the web.
    * It should be now easier to compile Nemerle on Windows using MinGW.
    * Lots of performance work -- in the compiler, the library and the 
      generated code.
    * Lots of bugs hunted.

: Michal Moskal :: http://nemerle.org/~malekith/ :: GCS !tv h e>+++ b++
: You can't blame yourself for what gorillas did :: UL++++$ C++ E--- a?