ServicesResourcesConferencesOur TeamWeblogsAboutContact
   

Subscriptions

Post Categories

Affiliations

Archives

How Silverlight supports dynamic languages
I am not at this conference, but anyway...

What I was wondering is how Silverlight does support these super-cool dynamic languages 'on-the-fly'. After some fiddling, this is what I think how it works:
  • 'Non-real' CLR languages like IronPython or IronRuby have a parser which converts the source code to a language-specific abstract syntax tree (AST).
  • The language specific AST is transformed to a language-independent dynamic language runtime (DLR) AST.
  • DLR's code generation converts the DLR AST to IL code using Reflection.Emit (and Light-Weight Code Generation [LCG]). A delegate is created pointing to the new DynamicMethod.
  • The delegate is finally invoked.
Can anybody confirm this?


posted on Tuesday, May 01, 2007 10:12 PM

# re: How Silverlight supports dynamic languages @ Friday, May 04, 2007 12:31 AM

[This is a comment from John Lam]

That's right. You could theoretically go straight to the DLR AST but
experience shows that it's too hard to understand without going
through a language specific AST first.

IronRuby, JScript, and VB are all implemented this way as well.

Christian Weyer


Powered by Community Server, by Telligent Systems