English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Compiler killer code?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-06-08 (14:26)
From: Alessandro Baretta <alex@b...>
Subject: [Caml-list] Compiler killer code?
Is the type inference algorithm guaranteed to termintate? I 
ask because I have accidentally attempted to evaluate a 
(meaningless) function which almost hanged my Athlon.

The killer code is the following:

type t = t -> t
let f (x:t) :t = f f

If I type this into the toplevel, it starts to allocate 
memory by the tens of megabytes, until I have to kill it to 
prevent a system crash. I let it reach approximately 128MB 
before killing it. (BTW, that was with ocaml 3.04+13 

Is the language really supposed to accept such garbage as 
that which I wrote?


To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners