InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Programming for the DLR

Posted by Werner Schuster on Jan 21, 2008

Sections
Development
Topics
.NET ,
Scripting ,
Silverlight ,
Ruby ,
.NET Framework
Tags
IronPython ,
DLR ,
RubyDotNet ,
JVM
The IronRuby team is busy moving forward on both the Ruby implementation and the underlying Dynamic Language Runtime (DLR). The latter is a group of various APIs and systems all (dynamic) language implementations for .NET (might) need. By pulling out this functionality into a common library, creating new language implementations will become much easier. A new blog about the using the DLR to build language implementations now provides practical insight in the design of the DLR.

An example is how the DLR factors out IL code generation:
The ToyScript sample language's front-end is very similar to that of any traditional compiler. It has tokenizer, parser and an abstract syntax tree representation of the toy language. What makes it a DLR based language (from the compiler pipeline perspective) is that instead of generating its own intermediate code, or generating Microsoft .NET IL directly, ToyScript will generate a tree representation of the code - DLR Trees. Dynamic Language Runtime will then take care of the code generation.

The DLR Trees are essentially the DLR representation of programs so every language that targets DLR produces the DLR Trees. ToyScript's design is similar to that of all the other DLR based languages, such as IronPython or IronRuby in the sense that it first parses into its own AST and then generates the DLR trees. At one point ToyScript (being very simple language) parsed directly into the DLR trees, but we changed that to behave more like the other DLR based languages, even though for ToyScript it is not strictly necessary.

By generating the DLR Trees instead of IL, the compiler writer doesn't have to worry about the IL generation and the DLR will take care of the intricacies. The developer can then focus on the correct semantic of the language at hand by implementing the front-end and implementing the correct runtime semantic.

The blog, written by Martin Maly who works at Microsoft on IronPython and the DLR, uses a toy language, conveniently named ToyScript, to show basic principles of the DLR. Future topics will also focus on how the DLR is used in IronPython or IronRuby.

This project also shows the kind of services a common language runtime library can provide - a similar project called JLR was attempted for the Java platform. While the JLR project seems mostly abandoned (with only one library in the SVN repository), the accompanying JVM Languages list is busy and shows that language implementations for the JVM face very similar design issues.

As for general IronRuby progress, read InfoQ's recent John Lam interview.
Another good interview by Fabio Akita Posted
Re: Another good interview by Robert Bazinet Posted
Re: Another good interview by Fabio Akita Posted
Re: Another good interview by Robert Bazinet Posted
First Class Support on VS 2008 Required by Soft Mind Posted
  1. Back to top

    Another good interview

    by Fabio Akita

    I would recommend this other interview with John Lam as well, it greatly complements this one :-)

    www.akitaonrails.com/2007/11/12/chatting-with-j...

  2. Back to top

    Re: Another good interview

    by Robert Bazinet

    Nice interview. I agree, it does complement this one as well.

    Do you have an English-only feed?

  3. Back to top

    First Class Support on VS 2008 Required

    by Soft Mind

    Hi,

    If i am not wrong Mr.Scottgu has accepted IronRuby as a first Class Citizen for DLR.

    I think IronRuby inbuilt integration in VS2008 like C# and Vb.Net is a must, without this support, IronRuby would not be taken in a serious manner and would be treated like an orphan child, with no goals.

    I do not like the idea of depending just on a third party tool. Let Sapphire Steel come as an option as Free Vs Paid IDE.

    If MSFT is considering IronRuby and IronPython their own baby, than it should be proved with such integration.

    SoftMind.

  4. Back to top

    Re: Another good interview

    by Fabio Akita

    Hi, sorry for the long delay!!

    Yes, now I do have an english-only feed: feed://feeds.feedburner.com/AkitaOnRailsEnglish

    Cheers

  5. Back to top

    Re: Another good interview

    by Robert Bazinet

    No problem, I just realized it myself. Thank you for the feed link.

    -Rob

Educational Content

Jesper Boeg on Priming Kanban

In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.