Dynamic Runtime & Languages - What's it all about?

quaggahooliganInternet και Εφαρμογές Web

5 Φεβ 2013 (πριν από 4 χρόνια και 6 μήνες)

156 εμφανίσεις


.NET as we
know

knew it


The new .NET languages stack


The DLR and why is it so cool ?


Objects


Duck typing


Extending existing types


Some ruby magic


Meta programming


Interop

between C# and Dynamic
Languages



Common Type system

Class Loader, GC, JIT, Execution Support

Security

Base Class Libraries

Common Language Runtime

C#

VB.NET



Common Type system

Class Loader, GC, JIT, Execution Support

Security

Base Class Libraries

Common Language Runtime

C#

VB.NET

IronPython

DLR Runtime

DLR

Dynamic

Languages

VBx

JScript

IronPytho
n

IronRuby

3rd
Party
langs

CLR

Frameworks

VS
Integration

Tools

Scripting Hosts

Applications

ASP.NET

Silverlight


IMHO Best IDE on the market


Shared dynamic subsystem


Standard hosting environment


Based on passing messages to objects


Full access to the CLR


Enable fast generation of dynamic code


One true object



Classic implementation of a dynamic
language


DLR: One true object


Demo 1 : Person class


If it looks like a duck and quacks like a…


Demo 2: similar properties


C# 3.0 has got extension methods


Ruby supports it natively


Demo 4: extension methods


Simulating multiple inheritance using
mixins.


DRY you can separate all common logic
out to one place.


A little similar to an Interface and it’s
implementation


Works with Class (static) methods too



Demo 5: Taggable mixin


Demo 6: Mixin with class methods


Instead of throwing a NoMethodError


Catch all for undefined methods


Mostly used in delegation scenarios


Syntactic sugar


Demo 7: Delegation scenario


Demo 8: Syntactic sugar




Avoiding boilerplate code


Taking advantage of adding methods
and classes at runtime


Rails ActiveRecord is build on it


ie. Dataformat drives the code


Demo 9: Build classes from csv files



Core types : reference mscorlib


require ‘mscorlib’


Pretty easy to build wpf apps


Will allow choice between asp.net
webforms or rails framework



Demo 10: REPL


extending ironruby with the C#
implementation of minutes.ago


Demo 11:

Rss reader in WPF.


http://www.ironruby.net/


http://rubyforge.org/projects/ironruby


http://blogs.msdn.com/hugunin/


http://www.iunknown.com/


http://www.ruby
-
lang.org/en/


http://flanders.co.nz/blog