caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Compiler killer code?
@ 2002-06-08 14:32 Alessandro Baretta
  2002-06-08 14:34 ` William Lee Irwin III
  0 siblings, 1 reply; 11+ messages in thread
From: Alessandro Baretta @ 2002-06-08 14:32 UTC (permalink / raw)
  To: Ocaml

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 
2002-06-05.)

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

Alex

-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-06-12  8:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-08 14:32 [Caml-list] Compiler killer code? Alessandro Baretta
2002-06-08 14:34 ` William Lee Irwin III
2002-06-08 18:30   ` William Lovas
2002-06-09 13:29   ` Alessandro Baretta
2002-06-09 13:41     ` Xavier Leroy
2002-06-09 18:08       ` Blair Zajac
2002-06-10 10:57         ` [Caml-list] " Michal Moskal
2002-06-12  8:37           ` Xavier Leroy
2002-06-10 15:25         ` [Caml-list] " Xavier Leroy
2002-06-10  2:42     ` Jacques Garrigue
2002-06-10  7:47       ` Alessandro Baretta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).