From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA23691; Wed, 28 Jul 2004 18:38:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA23111 for ; Wed, 28 Jul 2004 18:38:15 +0200 (MET DST) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6SGcDEV030890 for ; Wed, 28 Jul 2004 18:38:14 +0200 Received: (qmail 7750 invoked from network); 28 Jul 2004 16:38:12 -0000 Received: from shell1.speakeasy.net ([69.17.110.70]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 28 Jul 2004 16:38:12 -0000 Date: Wed, 28 Jul 2004 09:38:12 -0700 (PDT) From: brogoff To: Alex Baretta cc: Ocaml Subject: Re: [Caml-list] looping recursion In-Reply-To: <4107544C.4040502@baretta.com> Message-ID: References: <16646.64470.304530.264731@soggy.deldotd.com> <16647.5177.849829.421587@soggy.deldotd.com> <4107544C.4040502@baretta.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 4107D675.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brogoff:01 brogoff:01 caml-list:01 recursion:01 baretta:01 000,:01 caml-list:01 petty:01 whining:01 sigkill:01 linked:01 ocaml:01 ocaml:01 speakeasy:01 alex:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 28 Jul 2004, Alex Baretta wrote: > brogoff wrote: > > Sometimes lists are best. If lists are OK for 100, 1_000, or 10_000 items, > > why not 100_000 or 1_000_000? Map and friends shouldn't blow stack. > > > > -- Brian > > Actually, it's not that bad. Well, I'm still on the caml-list, so of course it isn't *that* bad. Also, as I said, if you need a tail recursive map over built in lists, you have at least two options. Unfortunately, my preference is to use Obj, which IMO points to a deficiency in the core language. Most, maybe all, of my issues with OCaml, amount to petty complaints, no showstoppers or dealbreakers. Hey, at least I'm not whining about the license! > Sometimes I design an algorithm in terms of basic data structures, such > as lists, and transformations applied through higher order iterators. > Such "featurs" as the stack overflow in List.map or the Linux > out-of-memory SIGKILL give me a clear indication of the simplemindedness > of such algorithms and force me to rethink them in terms of more > efficient structures and techniques, typically streams and laziness. There are quite a few cases where singly linked lists are the most efficient data structure, and they're just right for the problem. Streams and laziness are not at all efficient in comparison. Stack overflow commonly happens when one of my users (yup, I have users of my code who aren't me ;-) decides to run on data much larger than I'd anticipated. Also, lists are builtin, and have syntactic support in OCaml, by which I mean nice, easy to read syntax. So the language encourages you to use them. -- Brian ------------------- 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