Calcコンパイラの作成

書誌事項

タイトル別名
  • Design and Implementation of Calc Compiler

この論文をさがす

抄録

簡単な関数型言語Calcを設計し,そのコンパイラを作成したのでその模様を報告する.Calcは1階の関数型言語で数値計算を行うことを念頭に,代入可能な配列を扱うことができる.CalcのプログラムはCalcコンパイラによって字句解析,構文解析を経て,k-正規形と呼ばれる中間言語に変換される.最適化には変数名のつけかえ,不要変数除去,定数伝搬などの通常のものに加え,このコンパイラ特有の最適化として部分評価に匹敵する強力な関数展開を備えている.さらに,コード生成部においては,末尾呼び出し最適化や配列アクセスの埋め込みを行っている.コンパイラの構造は従来の最適化に比べて比較的簡明であるが,実際にこの上でキャビティーフローを計算する数値シミュレーションプログラムを動かしたところ,Cに近い性能で実行することができた.

We report on the design and implementation of a compiler for a simple first-order functional language Calc. Calc is equipped with assignable arrays with computing numerical analysis in mind. After going through lexical analysis and syntax analysis, programs are first transformed into an intermediate language called k-normal forms. The Calc compiler then performs ordinary optimizations such as alpha-transformation, elimination of useless variables, and constant propagation. Furthermore, it performs strong inlining (or partial evaluation) as an optimization particular to Calc. In code-generation phase, it performs the tail-call optimization as well as embedding of array access primitives. Although the structure of this compiler is rather simple compared to ordinary compilers, it produces fairly efficient code. In fact, we can execute a numerical simulation program calculating cavity flow with efficiency comparable to the same program written in C.

収録刊行物

キーワード

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

  • CRID
    1050845762820695040
  • NII論文ID
    110002711917
  • NII書誌ID
    AA11464814
  • ISSN
    18827802
  • Web Site
    http://id.nii.ac.jp/1001/00016707/
  • 本文言語コード
    ja
  • 資料種別
    article
  • データソース種別
    • IRDB
    • CiNii Articles

問題の指摘

ページトップへ