From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id B9E1BD565 for ; Wed, 27 Jul 2005 18:04:39 +0200 (CEST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6RG4bwe030165 for ; Wed, 27 Jul 2005 18:04:38 +0200 Received: from rosella (ppp6-113.lns1.syd3.internode.on.net [59.167.6.113]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j6RG37oH026217; Thu, 28 Jul 2005 01:33:08 +0930 (CST) Subject: Re: [Caml-list] How to do this properly with OCaml? From: skaller To: Brian Hurt Cc: Jere Sanisalo , caml-list@yquem.inria.fr In-Reply-To: References: <200507241623.13705.Stephane.Glondu@crans.org> <1122251570.9027.362.camel@localhost.localdomain> <200507242345.13152.Stephane.Glondu@crans.org> <1122291335.6766.33.camel@localhost.localdomain> <20050726005640.GA30583@xmunkki.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-aW6jTBsCVpzQPf0Eari2" Date: Thu, 28 Jul 2005 02:03:06 +1000 Message-Id: <1122480187.6768.65.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 X-Miltered: at nez-perce with ID 42E7B095.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 applicative:01 assertion:01 stack:01 malloc:01 stack:01 eliminates:98 wrote:01 sourceforge:01 sourceforge:01 lexical:01 lexical:01 closures:01 functional:02 X-Attachments: type="application/pgp-signature" name="signature.asc" X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 --=-aW6jTBsCVpzQPf0Eari2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2005-07-25 at 20:10 -0500, Brian Hurt wrote: >=20 > Note that languages encourage or discourage certain styles of programming= .=20 > For example, C++, and to a lesser extent Java and C#, rather strongly=20 > discourages an applicative style of programming- primarily due to the=20 > costs of allocation. You can do it, but it's going to be a fairly seriou= s=20 > perfomance hit. =20 I agree with your assertion but not the reason you cite for it. The real reason it is discouraged is the lack of lexical=20 scoping. I cite Felix as a counter example: the current implementation provides lexical scoping and functional programming in the ML style is simple and easy. Yet the stack frames are indeed allocated using malloc in the standard driver. For some classes of problems, the lack of performance here just isn't an issue -- especially as the optimiser eliminates almost all closures.=20 [The real problem in Felix is the the collector cannot be run inside functional code, because there is no way to predict the structure of the machine stack: procedural code doesn't use the machine stack] --=20 John Skaller --=-aW6jTBsCVpzQPf0Eari2 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBC57A5sRp8/9aGVGsRAj2wAJ0WlzuX2BiHSkCIYldlAIrfjoGCLgCfSSCf fVVUH2WlSXYQj0eya0Lh1tI= =g/Y8 -----END PGP SIGNATURE----- --=-aW6jTBsCVpzQPf0Eari2--