MONO 1.2.5 released !!!

Mono have just released the 1.2.5.

This new version bring a pack of things as usual…

  • Dynamic language runtime (DLR) which is the big part of moonlight.
  • the C# 3.0 features (minus query expression of LINQ):
    • Type inference: the “var” keyword
      expl: var i = 1; var intArr = new[] {1, 2, 3, 4}
    • Anonymous types: the compiler will generate a class which fit to the behaviour of your constructor. (quite like duck in ruby)
      expl: new {hair=”black”, skin=”green”, teethCount=64}
    • Object/Collection initialization: specified values of fields/properties in constructor
      expl: var myCoord = new Coordinate{ x = 0, y= 0} ;
      List<string> animals = new List<string> {“monkey”, “donkey”, “cow”, “dog”, “cat”} ;
    • Automatic properties: generate the private variable linked to the propertie
      expl: public string Bar {get; set;} will fill the get and set with a private field.
    • extension methods: extend a class with a new method (like partial class)
      expl: public static ToInt32(this string s) {…} will extend the string class with this function
    • lambdas expression: anonymous methods in more concise syntax
      expl: s => Console.Writeline(s);
  • Runtime optimisation
  • Improove .NET 2.0 support (System.core, System.Data, winforms)
  • VB.NET bugfix
This entry was posted in .NET, development, Mono, open source. Bookmark the permalink.

4 Responses to MONO 1.2.5 released !!!

  1. These are all very nice improvements, but I wonder why the type inference isn’t stretched a bit further. My critique isn’t related to Mono since it has to be compatible with Microsoft.NET, but I’m wondering why the “var” keyword is needed, for example. And do you really need the “new []” construct? Couldn’t that line just look like:

    intArr = {1, 2, 3, 4};

    And is the “new” keyword really necessary on anonymous type initialization? Wouldn’t the presence of an opening bracer be enough for the compiler to understand that it is an initialization, and by examining the body of the block concluding that it’s either an anonymous type or an array?

    I think that C# 3.0 is a great step in the right direction, but I don’t think it’s great enough. What do you think?

  2. duff says:

    totaly agree with you.
    I have ever done a post about the grammar of C# and ruby compare but it is in french.

    Ruby have done something beautiful for property with the attr_accessor, attr_reader,…

    var is needed to see difference between definition and declaration of variable in compiler. Imagine you have a code with a variable which is change everytime where do we know when it is definition and declaration.

    for(int i=0;i<10;i++)
    Here you have variable which will be declare at the first loop and just defined in other loop…

    But I understand your point and I think it can be done. I know that ruby has ever done it.

    For intArr = {1, 2, 3, 4}; I agree totaly “new” is not needed and ruby has ever ride the step by doing exactely what you have done.

    But, I think MS do not want to do to keep compatible with .NET 1.1 and to not be so close to ruby.

    I really love ruby.NET and I think that C# will move to be more close to ruby in futur but will keeping braces.

  3. Steve Thompson says:

    I also have to wonder why they didn’t take this further. A couple of examples:

    var zoo = new List{“lions”, “tigers”, “bears”}

    Why does the language not just ‘infer’ that it is dealing with a List?

    Also, why is it mandatory that I give my foreach loop a type? Why can’t I just say:

    foreach(animal in zoo)

    It seems to me that at this time, Nemerle is perhaps closest to my ideal. Unfortunately, I haven’t seen a lot of life in that language over the past year, but it was capable of doing many of the things even back then that are only starting to creep into C#.

  4. duff says:

    the closest language to my idea are nemerle and Boo which are both great even if I do not like the type definition with “def” and “as” (def foo(x as int) as int:) and prefer to have a braces.
    The issue is that this languages is not well known ;(

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s