Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
cost to let rec?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andrej Bauer <Andrej.Bauer@f...>
Subject: Re: [Caml-list] cost to let rec?
Ralph Douglass wrote:
> Is there any cost to defining a function with "let rec" instead of just
> "let"?  A slightly longer compile time or something?  I'm just curious.

The main cost of using "let rec" instead of "let" out of laziness or
"convenience" is time spent debugging the resulting bugs and the extra
time needed for software maintainance ("WTF did this Ralph guy write let
rec everywhere? My god he's totally incompetent and I have to clean
up."). This typically costs far, far more than any processor time you
might gain.

Source code is for humans.