fixedpoint.jp


Concurrent Scheme (2008-08-10)

以下の文章で「別々のプロセッサで並列してそれぞれの sexp の評価を行うことができる」と述べていますが、これは一般には成り立ちません。詳しくは 2009/09/19 で説明しています。

R5RS を最初に読んだ際に気になっていた点がいくつかあり、その1つが "Procedure calls" の

A procedure call is written by simply enclosing in parentheses expressions for the procedure to be called and the arguments to be passed to it. The operator and operand expressions are evaluated (in an unspecified order) and the resulting procedure is passed the resulting arguments.

(http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.3)という記述です。これの意味するところは特に「combination に現れる operator および operand を評価する際の順序は定められていない」ということになります。

これとほぼ同じ記述は R6RS にもあります: http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-12.html#node_sec_9.1

これは仕様が許している並行性として実装で積極的に利用することができます。つまり、評価順序を制御しなくてもよいことから、例えば別々のプロセッサで並列してそれぞれの sexp の評価を行うことができるはずです。

そして先日、次のブログのエントリを見てそのことを思い出しました: http://www.ventonegro.org/2008/05/concurrent-scheme/

これによると

ということなので、詳しく調べてみると面白そうです。


© 2006-2023 fixedpoint.jp