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 KAA14633; Tue, 18 May 2004 10:52:26 +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 KAA14620 for ; Tue, 18 May 2004 10:52:25 +0200 (MET DST) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4I8qOEV009751 for ; Tue, 18 May 2004 10:52:25 +0200 Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1BQ0Km-00042x-00 for ; Tue, 18 May 2004 09:52:24 +0100 Date: Tue, 18 May 2004 09:52:24 +0100 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Teaching OCaml Message-ID: <20040518085224.GA15477@redhat.com> References: <40A8A1F6.3090604@di.ubi.pt> <69392398-A827-11D8-89DA-0003939A19AA@fas.harvard.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69392398-A827-11D8-89DA-0003939A19AA@fas.harvard.edu> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at nez-perce with ID 40A9CEC8.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 0400,:01 quicksort:01 haskell:01 quicksort:01 implemented:01 bug:01 implemented:01 deployed:01 datasets:01 ltd:98 ocaml:01 ocaml:01 garbage:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, May 17, 2004 at 01:27:02PM -0400, Michael Hamburg wrote: > Hi. > > A few thoughts on the subject. > > Iif you want practical features of OCaml, you could try the classic > "QuickSort in n lines" where n depends on how efficient you want to > make it, but you can still achieve O(n log n) in something like 4 > lines. It takes 10 or so to be efficient, compared to at least 50 in > C. Of course, Haskell has even nicer syntax for this, but it looks > good in O'Caml too. Sorry, but why is this a "practical" feature of OCaml? Anyone who uses OCaml to sort things will use List.sort, unless they have incredibly specialist sorting requirements, in which they certainly won't be using a 4-line implementation of quicksort. Frankly I don't care how List.sort is implemented, as long as it's (a) reasonably fast, and (b) bug free. It may be implemented in C for all I know/care. OCaml is a practical language for many good reasons: (a) Garbage collection, type safety and other features which mean that many bugs appear at compile time, not when your program has been deployed at a customer site. (b) Ability to construct and pattern-match against data structures almost effortlessly. Data-driven analysis programs like the sort of stuff I write for work are a joy to code with these features. (c) Speed - it's fast enough, and can be very fast when you need it to be. I can chew through datasets of hundreds of thousands of rows from an Apache logfile in much less than a second. Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment MONOLITH is an advanced framework for writing web applications in C, easier than using Perl & Java, much faster and smaller, reusable widget-based arch, database-backed, discussion, chat, calendaring: http://www.annexia.org/freeware/monolith/ ------------------- 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