末尾再帰最適化がデフォルト
456 /* used for the inlined instruction which is supposed to be called at 457 tail position (e.g. SLOT-REF). This checks whether we're at the tail 458 position or not, and if not, push a cont frame to make the operation 459 a tail call. */ 460 #define TAIL_CALL_INSTRUCTION() \ 461 do { \ 462 if (!TAIL_POS()) { \ 463 CHECK_STACK(CONT_FRAME_SIZE); \ 464 PUSH_CONT(PC); \ 465 PC = PC_TO_RETURN; \ 466 } \ 467 } while (0)
細かい説明はReading Gauche/vm.c/TAIL_CALL_INSTRUCTION - Mona OS developers Wiki辺りを読んでください。
末尾再帰の最適化関連のコードなのですが、最適化がデフォルトになっていて驚きました。個人的な最適化のイメージだとプログラムを動かすという本来の仕事に一手間加えて速くするってな感じなもんで。これは最適化を手動でやる感覚なのかなぁ。
デフォルトを最適化(洗練)したものにしておいて、最適化できない場合にしょうがないから最適化しないであげるってのを自然な感覚にした方がお得な気がした。