Sunday, February 01, 2009

Don't wait for C# 5, use Nemerle Now !!!

Hello ,
I mentioned nemerle before as C# glorified here . As you know C# 5.0 will came with compiler services that allows us to run dynamic code on runtime. Mono has already have it but it is not available to Windows at the moment (you can reference gmcs on windows but with limited support only). So here's our example:

using System;
using System.Console ;
using Nemerle.Evaluation.Evaluator ;

module Program
{
Main() : void
{
def function = EvaluateExpression( "x => x + 1.0" ) :> double -> double ;
Console.WriteLine(function(2.0));
}
}

The above code outputs 3!! Simply wonderful and best of all this code is in visual studio with full intellisense as below:

Just install nemerle from http://nemerle.org and add Nemerle.Macros and Nemerle.Evaluator as reference and run the code that's it!






6 comments:

Anonymous said...

Do you know that is a feature of Mono and not of NMerle? You can do this with C# on mono too.

Onur Gümüş said...

@Paco : As you see in the screen shot this is windows only. Mono's that feature is not available on windows. This is certainly a nemerle feature

Anonymous said...

Umm, I think one problem with Nemerle is there's very little documentation available (tutorials and such) that one can peruse. Also, Visual Studio support is a bit thin on the ground - there's no IntelliSense for Nemerle, right?

Onur Gümüş said...

Nemerle has a fairly large amount of documentation, but is it enough ? No unfortunately. There a lot more things to be covered but still you can ask to developers if you are stuck. They are quite responsive. For intellisense I added two more screenshots regarding your concerns

出会い said...

大好評の逆ナンイベントが毎週開催決定!素敵な出会いのきっかけ探し・アイナビにきませんか?積極的な出会いを求める人達なら無料参加OK!あなたもほんの少しの勇気で素敵な彼氏・彼女をGETしちゃおう

右脳左脳チェッカー said...

ランク王国でもご紹介された右脳左脳チェッカー、天才肌を見分ける楽しい盛り上がりツールとして今、支持をうけております。みんなでやれば盛り上がる事は間違いなし診断結果でも全国ランキングなどにランクインされて面白さ倍増!話のネタに一度はどうぞ