動的言語ランタイム

出典: フリー百科事典『ウィキペディア(Wikipedia)』
移動: 案内検索
Dynamic Language Runtime
開発元 Microsoft Dynamic Language Runtime Team
最新版 1.0 / 2010年04月16日(3年前) (2010-04-16
対応OS Microsoft Windows, Debian, Ubuntu
プラットフォーム .NET, Mono
種別 システムプラットフォーム
ライセンス Microsoft Public License
公式サイト www.codeplex.com/dlr
テンプレートを表示

動的言語ランタイムDLR)は、共通言語ランタイム上に次のような言語機能を提供するためのマイクロソフトによる技術である。

これはPythonRubyのような動的言語を.NET Framework上に実装するために使われる。例えば、IronRubyIronPython 2.0、動的Visual Basic .NET(VBx)、マネージJScriptなどで使用されている[1]

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

目次

DLR の歴史 [編集]

マイクロソフトの動的言語ランタイムプロジェクトは、MIX 2007 の際マイクロソフトによって発表された。[1]. 現在 DLR のコードは IronPython のリポジトリ内に存在している。マイクロソフトは DLR の利用可能な バージョン 1.0 を、2008年末までに IronPython 2.0 と同時に出荷することを計画している[2]

アーキテクチャ [編集]

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

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

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

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

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


関連項目 [編集]

参考文献 [編集]

  1. ^ a b A Dynamic Language Runtime (DLR)” (2007年4月30日). 2007年8月24日閲覧。
  2. ^ 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.
  3. ^ 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.
  4. ^ 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.
  5. ^ Bill Chiles. “CLR Inside Out: IronPython and the Dynamic Language Runtime”. MSDN Magazine. 2007年8月10日閲覧。
  6. ^ 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.