動的言語ランタイム

出典: フリー百科事典『ウィキペディア(Wikipedia)』
動的言語ランタイム
開発元 Microsoft Dynamic Language Runtime Team
最新版
1.0 / 2010年4月16日 (14年前) (2010-04-16)
リポジトリ ウィキデータを編集
対応OS Microsoft Windows, Debian, Ubuntu
プラットフォーム .NET, Mono
種別 システムプラットフォーム
ライセンス Apache License, v2.0
公式サイト www.codeplex.com/dlr
テンプレートを表示

動的言語ランタイム(どうてきげんごランタイム、英語: Dynamic Language Runtime、略称 : DLR)は、共通言語ランタイムの上で動作する、様々な異なる動的言語のために次のような言語機能を提供するためのマイクロソフトによる技術である。

PythonRubyのような動的言語を.NET Framework上に実装することを意図したものである。例えば、具体的な処理系としてはIronRubyIronPython 2.0、動的Visual Basic .NET(VBx)、マネージJScriptなどで使われている[1]

複数の動的言語の実装が共通の基盤となるシステムを持つことにより、異なる言語の実装同士の相互作用が簡単になる。たとえば、任意の動的な言語のライブラリを他の言語から使用可能になる。さらに、ホスティングAPIによりC#およびVisual Basic .NETといった静的に型付けされたCLI言語との相互運用が可能になる。

DLRの歴史[編集]

マイクロソフトの動的言語ランタイムプロジェクトは、MIX 2007 の際マイクロソフトによって発表された。[2][3] マイクロソフトは.NET DLR 0.9ベータ版を2008年11月26日に発表し[4]、2008年12月10日に最終版0.9を発表した。バージョン1.0は2010年4月16日に発表された。2010年7月16日に、マイクロソフトはDLRのライセンスをMicrosoft Public LicenseからApache License v2.0に変更した。[5]さらに.NET 4のリリースに伴い、2010年4月にも、DLRは.NET Framework自体に編入された。[6]

CodePlexの主催によるオープンソースDLRプロジェクトは、言語実装のために追加された機能がいくつかあるが、2010年リリース以来プロジェクトは活動していない。そのプロジェクトでは、IronRuby用のマイクロソフト開発者を含む、.NET Frameworkの動的言語に対するマイクロソフトからの参加の不足を補う物へのリンクも利用できた。[7][8]

サポートされる言語[編集]

DLRサービスは現在IronRubyの開発バージョン、Ruby言語の.NET実装、そしてIronPythonで使用されている[1] 2007年に、マイクロソフトは来るVisual Basic 2010 (VB 10.0)およびマネージJScript (ECMAScript 3.0) 向けにDLRを使用することを計画した。[9][9][10][11][12] しかしながら、2009年の8月現在、マイクロソフトはDLR上のマネージJScript (ECMAScript 3.0) を実装するためのプランを何も発表しておらず、 [13] C#のように、Visual Basicは、IronPythonおよびIronRubyといったDLR上でビルドされた動的言語からオブジェクトにアクセスすることが可能である。[14][15]

Windows 8にリリースされたPowerShell 3.0は、DLRを使用するためにアップデートされた。[16]

来るScheme実装であるIronScheme[17]は、DLR上でビルドされることが計画されていた。使用されるDLRブランチプロジェクトがトランクと共に同期から外さるようになり、さらにその当時におけるDLRのカレントバージョンがSchemeの要求の大半をサポートしていなかったため、このアイデアは棄却された。[18]

アーキテクチャ[編集]

動的言語ランタイムは、言語から独立した汎用の抽象構文木上に、言語固有の部分を実装可能であるという考え方に基づいている。構文木上の各ノードは大半の動的言語で共通の機能に対応している。[19]

このアーキテクチャは、汎用のスタック上に実装される基本的な言語の構造は少ない数であるべきという考え方に基づいている。[20]

DLR はこれらのノードで表現されたコードを動的に生成する。 DLR 上に実装された任意の動的言語向けのコンパイラは DLR の抽象木を生成し、これを DLR のライブラリに引き渡す必要がある。

DLR はメソッドをオブジェクトにバインドし、動的に更新される DynamicSite オブジェクトを提供する。動的言語とオブジェクトの型は、プログラムの寿命の内に変化できるため、メソッドの呼び出しにはメソッドの一覧をチェックし、呼び出しが正しいかを確認しなければならない。DynamicSite オブジェクトはオブジェクトとメソッドの状態をキャッシュし、オブジェクトに対する更新動作はDynamicSite オブジェクトにも反映される。DLR はすべてのメソッドの呼び出しをDynamicSite オブジェクトに回送し、DynamicSite オブジェクトは次に現実の実装におけるメソッドの検索とバインドを行う[21]

Java仮想マシンの中核部分に動的プログラミング言語のサポートを追加しようとするDa Vinci マシンなどの試みとは対照的にDLR は既存の共通言語ランタイムと.NET Framework仮想マシン上に構築されている[22].

脚注[編集]

  1. ^ a b A Dynamic Language Runtime (DLR)” (2007年4月30日). 2007年8月24日閲覧。
  2. ^ Hugunin, Jim. “A Dynamic Language Runtime (DLR)”. 2007年6月21日閲覧。 “For the short term, our focus is on using a small number of languages to drive the first wave of DLR development where we can work closely and face-to-face with the developers in order to iron out the worst kinks in the DLR design. After this initial phase, we want to reach out to the broader language community.
  3. ^ Viehland, Dino (2008年1月15日). “Roadmap for IronPython 2.0”. 2008年2月9日閲覧。 “We don't really have a document like this but the general goal is to ship IronPython 2.0 by the end of the year. For the DLR its self the plan is to ship a v1.0 around the same time as IronPython 2.0.
  4. ^ http://www.codeplex.com/dlr
  5. ^ http://dlr.codeplex.com/license
  6. ^ http://msdn.microsoft.com/en-us/library/dd233052.aspx
  7. ^ Microsoft Tires of IronRuby; Jimmy Schementi Jumps Ship”. rubyinside.com (2010年8月7日). 2012年2月26日閲覧。 “A year ago the team shrunk by half and our agility was severely limited. [..] Overall, I see a serious lack of commitment to IronRuby, and dynamic language[s] on .NET in general.
  8. ^ Microsoft's Dynamic languages are dying”. i-programmer.info (2010年8月10日). 2012年2月26日閲覧。 “Without the final push to get the languages working under Visual Studio and integrated with the designer both Iron languages are probably dead - and Microsoft seems to have lost the will to make them a success.
  9. ^ a b Managed JScript announced”. 2007年5月4日閲覧。
  10. ^ What the heck is "VBx"?” (2007年5月1日). 2009年8月12日閲覧。 “With the new DLR, we have support for IronPython, IronRuby, Javascript, and the new dynamic VBx compile
  11. ^ Putting Mix, Silverlight, the CoreCLR and the DLR into context” (2007年5月1日). 2008年8月12日閲覧。
  12. ^ Introducing Visual Basic 10”. infoq.com (2007年5月4日). 2009年8月12日閲覧。 “VB 10 takes advantage of a Silverlight feature called the Dynamic Language Runtime or DLR
  13. ^ Chiles, Bill (2009年6月1日). “Future of Managed JScript (IronJScript)?”. 2009年8月12日閲覧。 “The DLR JScript was experimental for informing the design of the DLR (expression trees, interop, callsites, hosting, etc.). The JS we released with asp futures and the Silverlight dynamic sdk became very old and unserviceable as the DLR continued evolving for release in CLR 4.0. Unfortunately, there are no plans at this time to develop and release a DLR-hostable JScript.
  14. ^ What's New in Visual Basic 2010”. マイクロソフト (2009年). 2009年8月12日閲覧。 “Visual Basic binds to objects from dynamic languages such as IronPython and IronRuby
  15. ^ http://msdn.microsoft.com/en-us/library/ee461504.aspx#Y480
  16. ^ アーカイブされたコピー”. 2012年4月28日時点のオリジナルよりアーカイブ。2012年3月30日閲覧。
  17. ^ http://www.codeplex.com/IronScheme
  18. ^ Is there any silverlight sample?” (2009年5月11日). 2009年7月26日閲覧。 “Unfortunately, my DLR branch is very out of sync with the Silverlight one. I just thought about it, perhaps I do not need the DLR perse, will investigate. The problem is that the DLR as-is, is not good enough to support the majority of the Scheme's requirements
  19. ^ Hugunin, Jim (2007年5月15日). “DLR Trees (Part 1)”. 2008年2月23日閲覧。 “The key implementation trick in the DLR is using these kinds of trees to pass code around as data and to keep code in an easily analyzable and mutable form as long as possible.
  20. ^ Nutter, Charles (2008年1月28日). “Lang.NET 2008: Day 1 Thoughts”. 2008年2月23日閲覧。 “The idea is that there's a quickly-flattening asymptotic curve to the number of expression tree nodes required to implement each new language. Whether that's the case is yet to be seen.
  21. ^ Bill Chiles (2007年10月). “CLR Inside Out: IronPython and the Dynamic Language Runtime”. MSDN Magazine. 2007年8月10日閲覧。
  22. ^ Rose, John (2008年2月2日). “Bravo for the dynamic runtime!”. 2008年2月23日閲覧。 “The differences between the CLR and JVM extensions are interesting to note. They work completely above the level of the CLR without significantly enhancing it, while we are developing the JVM and libraries at the same time.

関連項目[編集]