C# 4.0 – Relationship with Dynamic Language Runtime

ccompilerdynamic-typing

Let's say I wanted to create a dynamic language compiler/interpreter, a Scheme interpreter perhaps, on the .NET platform as it exists today. Would I be better off using the Dynamic Language Runtime (DLR), or using C# 4.0 to implement my language's dynamic features? Or do I need both?

I know that there has been other work done in this area, in particular with IronScheme and IronPython. Both of those languages use the DLR; I believe IronPython uses the most current version of the DLR (which is about a year old), while IronScheme uses an early, heavily modified fork of an early version of the DLR. But C# 4.0 was not available when these compilers were created.

I've seen Rob Conery's work with Massive, using C# 4.0's dynamic features; it is quite impressive. But would C# hold up to the full-scale effort of a dynamic language compiler/intepreter? Are there features in the DLR that are missing from C#, or was the DLR essentially rolled into C# 4.0? Would I be missing any important features of the DLR if I just used C# 4.0 exclusively?

Best Answer

This is the article I remember reading. msdn.microsoft.com/en-us/magazine/gg598922.aspx

Later the DLR was also included in the .NET Framework 4 to support dynamic features in C# and Visual Basic. If you only need the dynamic keyword in C# 4, you can simply use the .NET Framework and in most cases it will handle all interactions with the DLR on its own. But if you want to implement or port a new dynamic language to .NET, you may benefit from the extra helper classes in the open source project, which has more features and services for language implementers.

Related Topic