Vous pouvez vous abonner à nos annonces de séminaires
http://gallium.inria.fr/seminaires/
S E M I N A I R E
__
/ _` _ / / o
/ ) __) / / / / / /\/|
(___/ (_/ (_ (_ / (__/ / |
I N R I A - Rocquencourt
Amphi Turing du bâtiment 1
Lundi 27 octobre, 10h30
---------------
Frédéric Bour
---------------
=====================================================
Tail-recursion modulo constructor experiment in OCaml
=====================================================
A complaint often heard in OCaml is that some common functions, such as
`List.map`, can blow the stack: while a tail-recursive implementation
exists, the naive and natural formulation is not tail-recursive.
Tail-recursion modulo constructor (TRMC) is a well-known optimization
to recover constant stack usage for a large class of functions,
including `List.map`.
We propose an implementation of TRMC in the OCaml compiler, but we remark that
optimized programs don't behave well with the current garbage collector.
Tail-recursion is recovered by introducing mutations, which have a
non-negligible cost. A prototypical extension to the GC is proposed to
recover optimal behavior for programs using the subset of OCaml language
without exceptions.