From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA16967 for caml-redistribution; Fri, 8 Oct 1999 12:01:06 +0200 (MET DST) 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 CAA23898 for ; Fri, 8 Oct 1999 02:31:30 +0200 (MET DST) Received: from mail5.svr.pol.co.uk (mail5.svr.pol.co.uk [195.92.193.20]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id CAA19932 for ; Fri, 8 Oct 1999 02:31:28 +0200 (MET DST) Received: from modem-115.regranex.dialup.pol.co.uk ([62.136.86.115] helo=toy.william.bogus) by mail5.svr.pol.co.uk with esmtp (Exim 2.12 #2) id 11ZNwV-00078t-00; Fri, 8 Oct 1999 01:31:27 +0100 Received: (from williamc@localhost) by toy.william.bogus (8.8.7/8.8.7) id BAA03378; Fri, 8 Oct 1999 01:26:55 +0100 Date: Fri, 8 Oct 1999 01:26:55 +0100 Message-Id: <199910080026.BAA03378@toy.william.bogus> From: William Chesters MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Gerd.Stolpmann@darmstadt.netsurf.de Cc: William Chesters , caml-list@inria.fr Subject: Re: speed versus C In-Reply-To: <99100800064700.23684@ice> References: <199910071046.LAA02740@toy.william.bogus> <99100800064700.23684@ice> X-Mailer: VM 6.34 under Emacs 20.2.1 Sender: weis Gerd Stolpmann writes: > >For me, the kind of elegance and beauty you want in a language > >comes not from constructing castles in the air, but from using > >abstract ideas to understand the real world better. ocaml says > >"look, this is what you really mean when you write machine code". > > I agree only partly. [...] For example, I cannot even imagine an > assembler program that uses closures (paraphrased by machine > instructions); there is always a much simpler way to get the same > effect. OK, how about this real life example from the Linux kernel: error = file->f_op->read(inode,file,buf,count); Here, `file' is a faked object, with `vtbl' = `f_op' and `this' passed in the second argument. And what is a closure if not an object with one method :-) ? I think this is quite a natural idiom to use, even in assembler---especially once one has seen how it can be given a nice meaning within a higher level framework like C++ or indeed Caml. > I like Caml because it does not waste resources, and because it > shows how cheap abstraction can be. I can but agree ... (Though I'd argue that's because it sticks to abstractions that "ornament" the low-level computational model without "obscuring" it :-) .) > I have done some benchmarks in the meantime: Thanks, they were interesting (I was wrong about vectors being quicker to construct).