The McDev Blog

Kevin McKelvin's perspective of the Ruby world.

Dynamic Languages & DLR Presentation - Languages UG

Thanks for the great turn-out at the Microsoft Community Night on 12 July, we had a full room for the languages UG!

For those who weren’t there - I gave a talk on Dynamic Languages and the DLR on Tuesday 12 July.

Here are the resources from the talk:

IronPython: http://ironpython.codeplex.com Clay: http://clay.codeplex.com System.Dynamic: http://msdn.microsoft.com/en-us/library/system.dynamic.aspx

And here’s the code used to call a Python script from C#, using the DLR interop and dynamic keyword:

1
2
3
4
5
6
7
8
9
var engine = IronPython.Hosting.Python.CreateEngine();
var scope = engine.Runtime.UseFile("greeter.py");
dynamic greeterClass = scope.GetVariable("Greeter");
dynamic greeter = greeterClass();

dynamic s = greeter.sayHello("Kevin!");

Console.WriteLine(s);
Console.Read();