Mono 1.0 Ships

Mono 1.0 has been released, following a speedy set of beta releases. The detailed release notes are interesting. Mono is also being used to build Nemerle a "functional .NET language compiler".

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

nemerle

It looks like nemerle still needs types specified on function parameters and has a generic c#ish template syntax rather than having the polymorphism be infered. I would think that neither of these would be necesary if they used a modern type inference engine. any idea why they still have them?

It is hard for me to imagine working with a language without good type inference. but perhaps haskell has spoiled me.

Nemerle type annotations

I've played with Nemerle a bit, and I believe the type annotations are required on class-level members mainly for documentation/interop reasons -- without them, it's all too easy to accidentally change the type signature, which would cause serious problems when you're interacting with languages that don't have type inference at all (plus it's generally a good idea to document your interfaces -- even in Haskell, i believe it's considered good practice to declare your functions' types where possible).

Within methods, they have full type inference, so i'm sure they could have had inference on method parameters, they just chose not to to avoid interop issues. If you want to write in a purely functional style, with full type inference, it's possible to do so just by using nested functions within Main() (although, obviously, if you do that, you can't access any of it from outside).

Type annotations

Type annotations are obligatory only for class methods. The reasons are exactly those mentioned in the other post. Code documentation and avoiding strange behaviour in presence of other assemblies, which may make type inference ambiguous. We will probably allow ommiting type annotations in private methods, because they can't be seen outside.

The same holds for polymorphism inference - it is no different from type annotations, the following code works just fine:

def f (x, y) { (y, x) };
def p = (1,2);
def pr = f (p);
Nemerle.IO.printf ("%s\n", pr.ToString ());

Altough our inference engine still has some problems with inheritance:

class A { ... }
class B : A { .. }
class C : A { .. }
...
def x = [B (), C ()];

is failing, because compiler is infering type of x to list <B> and when it come to C() it is not currently able to weaken constraints and give x type list <A>. We are still working on typing engine to allow this.