dynamic languages for .net clr
TRANSCRIPT
![Page 1: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/1.jpg)
Dynamic Languages for .NET CLR
![Page 2: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/2.jpg)
Dynamic programming languagesIn the broadest sense of the word
Dynamic programming language is a term used broadly in computer science to describe a class of high-level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all. These behaviors could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system, all during program execution.
Source: Wikipedia
![Page 3: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/3.jpg)
BrieflyChanging types at runtimeNo types at allGenerate code at runtimeSimplified deployment
![Page 4: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/4.jpg)
Where Dynamic Languages fit
Rapid prototype developmentBetter string processing capabilities
![Page 5: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/5.jpg)
Dynamic VS StaticDynamic
Languages
Simple & Easy to Learn
Late bound
Highly Expressive
No compilation
StaticLanguages
Type safety
Runtime Performance
Compile-time checking
Intelligent tools
![Page 6: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/6.jpg)
Dynamic Languages on .NET
Dynamic Language Runtime
Iron Python
Iron Ruby
C# Others…
.NET CLR
![Page 7: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/7.jpg)
Is C# dynamic language..?
Yes..optionally.. New dynamic keyword in C# 4.0
![Page 8: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/8.jpg)
Dynamic VS Object dynamic dyn = 1;
object obj = 1;
//NOT MUCH DIFFERENCE System.Console.WriteLine(dyn.GetType()); System.Console.WriteLine(obj.GetType());
dyn = dyn + 3; obj = obj + 3; // THROWS ERROR //obj = (int)obj + 3;
More Readable Code
![Page 9: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/9.jpg)
The Dynamic Type in C#
Calculator calc = GetCalculator();int sum = calc.Add(10, 20);
object calc = GetCalculator();Type calcType = calc.GetType();object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, new object[] { 10, 20 });int sum = Convert.ToInt32(res);
ScriptObject calc = GetCalculator();object res = calc.Invoke("Add", 10, 20);int sum = Convert.ToInt32(res);
dynamic calc = GetCalculator();int sum = calc.Add(10, 20);
Statically typed to be
dynamic
Dynamic method
invocation
Dynamic conversion
![Page 11: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/11.jpg)
Microsoft VisionImplemented as Iron Languages
Iron Python, Iron RubyAll languages run on .NET runtimeEasy to use .NET librariesEasy to use other .NET languagesEasy to use in .NET hostsEasy to use with .NET tools
![Page 12: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/12.jpg)
Current StatusDLR 1.0Iron Python 2.7.2.1IronRuby 1.1.3
![Page 14: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/14.jpg)
IronPython vs CPythonIronPython
Written in C#Works with .NET VMProduces IL codeAssemblies, Modules
CPythonWritten in CWorks Python VMProduces Python Byte CodeModules
![Page 15: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/15.jpg)
Tools to Develop IronPython
Python Tools for Visual Studiohttp://pytools.codeplex.com/
![Page 16: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/16.jpg)
Iron Python Shell
![Page 17: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/17.jpg)
Exploring Iron PythonDemo
Using .NET Class Libraries(HelloWorld example)
Using C# DLL in Iron Python(Extending Iron python with C#)
Embedding Iron Python in C#Windows Forms
![Page 18: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/18.jpg)
ASP.NET Iron Python http://aspnet.codeplex.com/wikipage?title=
Dynamic%20Language%20Support
Demo
![Page 19: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/19.jpg)
What about LinuxIron Python can run on LinuxMono
![Page 20: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/20.jpg)
How to ContributeBoth Iron Python and DLR are open source projects
Iron Python Project will accept source code and bugs
DLR is just open source
![Page 21: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/21.jpg)
Dynamic Languages in Java Java 223 SpecificationJython
![Page 22: Dynamic languages for .NET CLR](https://reader036.vdocuments.net/reader036/viewer/2022062303/55557beab4c9058a5a8b50d5/html5/thumbnails/22.jpg)
Real world example
http://Ironserver.codeplex.com