Your SlideShare is downloading. ×
Dynamic languages for .NET CLR
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Dynamic languages for .NET CLR


Published on

Published in: Education, Technology

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Dynamic programming languages  In the broadest sense of the wordDynamic programming language is a term usedbroadly in computer science to describe a class of high-level programming languages that execute at runtimemany common behaviors that other languages mightperform during compilation, if at all. These behaviorscould include extension of the program, by adding newcode, by extending objects and definitions, or bymodifying the type system, all during program execution.Source: Wikipedia
  • 2. Briefly Changing types at runtime No types at all Generate code at runtime Simplified deployment
  • 3. Where Dynamic Languages fit Rapid prototype development Better string processing capabilities
  • 4. Dynamic VS Static Dynamic Static Languages Languages Simple & Easy to Learn Type safety Late bound Runtime Performance Highly Expressive Compile-time checking No compilation Intelligent tools
  • 5. Dynamic Languages on .NETIron Python Iron Ruby C# Others… Dynamic Language Runtime .NET CLR
  • 6. Is C# dynamic language..? Yes..optionally.. New dynamic keyword in C# 4.0
  • 7. 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
  • 8. 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); Statically typed to dynamic calc = GetCalculator(); be dynamic int sum = calc.Add(10, 20); Dynamic Dynamic method conversion invocation
  • 9. DLR Website
  • 10. Microsoft Vision Implemented as Iron Languages  Iron Python, Iron Ruby All languages run on .NET runtime Easy to use .NET libraries Easy to use other .NET languages Easy to use in .NET hosts Easy to use with .NET tools
  • 11. Current Status DLR 1.0 Iron Python IronRuby 1.1.3
  • 12. IronPython IronPython Website
  • 13. IronPython vs CPython IronPython  Written in C#  Works with .NET VM  Produces IL code  Assemblies, Modules CPython  Written in C  Works Python VM  Produces Python Byte Code  Modules
  • 14. Tools to Develop IronPython Python Tools for Visual Studio
  • 15. Iron Python Shell
  • 16. 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
  • 17. ASP.NET Iron Python ic%20Language%20Support Demo
  • 18. What about Linux  Iron Python can run on Linux  Mono
  • 19. How to Contribute  Both Iron Python and DLR are open source projects  Iron Python Project will accept source code and bugs  DLR is just open source
  • 20. Dynamic Languages in Java Java 223 Specification Jython
  • 21. Real world example