Coffeehouse Post

Single Post Permalink

View Thread: What is your prediction for .NET framework 4.0?
  • User profile image

    Hi there and thanks to the team!

    If "What features would you like to see the C# team add?" is really mean what it is saying then this is my wish list:
    (I have implemented some of these in a library named Foop at but without metaprogramming facilities or syntax extensions they are pretty ugly!)

    1 - Define new operators; i.e. an operator named &&&.
    2 - Define Generic operators; currently we can just overload the existing operators and if the operands are going to be Generic, they can only be of type of one of the Type Parameters of the container class.
    3 - The pipe operator (|) as in F#; which can be there if we have feature number 2.
    4 - Tuples; I have implemented some tuple data structures; but without compiler support, it needs to be implemented for any number of them!
    5 - Better type inference; For example for lambdas I wrote a static method 'infer' for that I be able to define Extension Methods on delegates or use them in Anonymous Types:
        Target = "XPC 10",
        Vel = ExSyntax.infer ((int a) =>
            return a * 22.8;
    ExSyntax.infer (() =>
        return DateTime.Now.Second > 10;
    }).do_while_true (() =>
        Console.WriteLine ("Updating Report...");
    6 - Anonymous Types everywhere; which in fact is "good Type Inference" every where. I think as the members of Anonymous Types are the static members of the container class; so we can apply synchronization and security facilities easily (I know you are the best and you are doing your best; so the "I think" part is just about the point of view from where that I am).
    7 - Dynamic proxies; we can emit runtime types and cache them: declaring a new class that implements the target interface and has members of another type which is going to be have the interface (ducked!).
    8 - Generic Generic Types; So I can define a typed linked list like this:
    TyLList<A> {
        public A Value;
        public TyLList<?> Next;
    9 - Named parameter calling for functions; for void F(int a, string b) calling it like F(b = "OK", a = 10)
    10 - Default values for parameters
    11 - Calling function with an Anonymous Type with members which are named after function arguments:
    For void F(int a, string b) calling F like F(new { b="OK", a=100});
    (We already have 9, 10 and 11 for attributes!)
    12 - Metaprogramming; (not IL weaving) which already have proof of concept projects like F# (Active Patterns and Typed Quoting ...)
    13 - An even very simple form of syntax extending; with 12 we will have enough of this
    14 - A #light syntax for C#; as we have in F#, which can be some form of indentation-based code layout (like in F#) with possibility yet to enclose code blocks in {}s.
    15 - Tagging types; which will provides us Class Cases, I have implemented for example Either<A,B>, some people implement this by declaring additional types like Left<A> and Right<B>; that is wrong! GADT are distingushed from the way that the object is constructed and the cases of the class in fact are different constructors which tag the object with different tags.
    16 - 'this' refers to the current object; If there be somthing like this_type it is hand full (GetType is a runtime thing but this_type i.e. can be passed to Generics)
    17 - Passing lambdas to attributes as parameter
    18 - Defining Execution Contracts; like 'Ensure' and 'Requies' and with 14, even a new step in compiling a method or something.
    19 - Capturing the values in the current execution context as a Name-Value dictionary; we have already the clousures and with 6, this would be very easy (this will provide us continuations).
    20 - An attribute like [AloneExecutionPath] for methods; which grants that the methos just have access to it's parameters, and have not access to any public or internal thing in any assembly written by user (we can use .NET class library(is this good?) and to the Anonymous Types defined inside the function and we can pass objects of those types)
    22 - Curry is necessary;
    21 - OK! OK! ...
    I was just looking into my codes and comming back here and write things! I close Visual Studio for now!
    Maybe this is another language! Smiley Yet I do not think so!

    Thanks all!