From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id F31F0BC0B for ; Tue, 16 Jan 2007 16:01:10 +0100 (CET) Received: from hades.snarc.org (hades.snarc.org [212.85.152.11]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0GF1Avv028730 for ; Tue, 16 Jan 2007 16:01:10 +0100 Received: by hades.snarc.org (Postfix, from userid 1000) id 932E61B482; Tue, 16 Jan 2007 16:00:27 +0100 (CET) Date: Tue, 16 Jan 2007 16:00:27 +0100 To: skaller Cc: Martin Jambon , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocaml compiler features Message-ID: <20070116150027.GA17519@snarc.org> References: <45A87011.8080203@gmail.com> <200701141823.32855.jon@ffconsultancy.com> <20070114184148.GA26213@snarc.org> <200701142049.57959.jon@ffconsultancy.com> <20070115000544.GA28731@snarc.org> <20070115221717.GA9982@snarc.org> <1168910291.9207.62.camel@rosella.wigram> <20070116090002.GA14494@snarc.org> <1168956872.5332.28.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1168956872.5332.28.camel@rosella.wigram> X-Warning: Email may contain unsmilyfied humor and/or satire. User-Agent: Mutt/1.5.13 (2006-08-11) From: tab@snarc.org (Vincent Hanquez) X-Miltered: at discorde with ID 45ACE8B6.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 compiler:01 ocaml:01 recursion:01 kloc:01 threads:01 extensively:01 threads:01 generalise:01 cheers:01 garbage:01 garbage:01 wrote:01 exception:01 On Wed, Jan 17, 2007 at 01:14:32AM +1100, skaller wrote: > No it isn't. First, I don't use exceptions like that: I usually > wrap them. Second, this technique isn't that useful in a language > with garbage collection: this is not C++. A thirdly, in my own > language Felix there ARE no exceptions .. so it can hardly > be 'common'. > > The Felix compiler (an Ocaml program) throws exceptions > in three circumstances: > > (a) Errors: no cleanup is required. > > (b) Library functions: either it is a program error > or I map the exception to a variant: no cleanup is > required. > > (c) Exiting a deep recursion: in no case is any > cleanup required. > > So actually in a 60Kloc program, no cleanup is done > anywhere for any reason. It just isn't necessary. Does you felix program have threads ? or lots of file descriptor ? or has to stay up for a long period of time ? or use side effect quite extensively ? Absolutely not, it's a compiler that doesn't need much of these stuff. And even then, you can most of the time just rely on exit(3) to cleanup since it's a short live service. What about a server now ? add threads in the mix where all mutex need to be properly unlocked, add also function with weird side effects that don't have any representation variable at the OCaml level (thus cannot be garbage collected), etc... So please don't generalise your situation which is quite specific (compiler) to the whole world of OCaml and open your mind to the fact that people has different need/expectation. (and that Felix doesn't have exceptions, I couldn't care less. OCaml does and there are no going away, so live with it.) > Actually I'm a Python ex-guru, I have two major pieces > of software written in it, and I've even *implemented* > a Python interpreter .. in Ocaml :) Good for you. (interpreter still fall in the compiler category btw) Cheers, -- Vincent Hanquez