Ricsin: Ruby に C を埋め込むシステム

書誌事項

タイトル別名
  • Ricsin : Ruby ニ C オ ウメ コム システム
  • Ricsin: A System for “C Mix-in to Ruby”

この論文をさがす

抄録

スクリプト言語 Ruby は,その記述の容易さから世界中で広く利用されているオブジェクト指向プログラミング言語である.C 言語を用いて実装されている Ruby 処理系はRuby C API を提供しており,Ruby では記述できない機能拡張や,性能のボトルネックとなるメソッドを C で実装するといったことが可能である.しかし,C で機能拡張を行う場合,メソッド単位で C 言語を記述する必要があり,Ruby プログラムの一部を直接 C で記述することはできない.また,Ruby から C のような,言語をまたぐプログラムの呼び出しにはオーバヘッドが生じるという問題がある.そこで,我々は Ruby プログラムに C プログラム片を埋め込むためのシステム Ricsin を開発した.埋め込んだ C プログラム片から Ruby プログラムのローカル変数などのコンテキスト情報へのアクセスが可能である.本システムを用いることで,Ruby の記述性の高さと C 言語の強力な機能を組み合わせることができる.また,Ruby 処理系に専用の命令を導入することで言語間の呼び出しオーバヘッドを抑える.本論文では Ricsin のアーキテクチャについて述べ,実装し評価を行った結果を述べる.

Scripting language Ruby is an Object-Oriented programming language used in world-wide because of its ease of description. The Ruby interpreter written in C supports “Ruby C API”, which allows to write an extension in C and to replace a performance bottleneck method with C. However, a whole method replacement is needed to write a method in C. In other words, even if only a part of program should be written in C, then whole method should be implemented in C. Moreover, an overhead of foreign function call between Ruby and C is also a problem. On this background, we develop Ricsin: a system to support “C Mix-in to Ruby”. Ricsin enables to embed a part of C program in a Ruby program. An embedded part of C program can access to a Ruby program context such as local variables. Using Ricsin, we can combine an easy-writing nature of Ruby and powerful features of C. Moreover, we propose the method to avoid foreign function call overheads using collaboration with Virtual Machine. In this paper, we will describe Ricsin architecture and show the implementation and the evaluation result of Ricsin.

収録刊行物

関連プロジェクト

もっと見る

キーワード

詳細情報 詳細情報について

問題の指摘

ページトップへ