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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 51185BBCA for ; Fri, 9 May 2008 07:16:03 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AroCALJ6I0jUnw6Eb2dsb2JhbACCMY9VAQwFAgQHE5kW X-IronPort-AV: E=Sophos;i="4.27,458,1204498800"; d="scan'208";a="10535209" Received: from pih-relay05.plus.net ([212.159.14.132]) by mail2-smtp-roc.national.inria.fr with ESMTP; 09 May 2008 07:16:03 +0200 Received: from [80.229.56.224] (helo=beast.local) by pih-relay05.plus.net with esmtp (Exim) id 1JuKxd-0001cv-Uj for caml-list@yquem.inria.fr; Fri, 09 May 2008 06:16:02 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: Why OCaml **cks Date: Fri, 9 May 2008 06:10:45 +0100 User-Agent: KMail/1.9.9 References: <200805090139.54870.jon@ffconsultancy.com> <20080509011133.GA4766@neptune.mattcox.ca> In-Reply-To: <20080509011133.GA4766@neptune.mattcox.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200805090610.45785.jon@ffconsultancy.com> X-Plusnet-Relay: 3386894b05ef57309969d51c3ab2ba27 X-Spam: no; 0.00; ocaml:01 0100,:01 lexing:01 ocaml:01 lexers:01 parsers:01 ocaml's:01 advocates:01 recursive:01 recursive:01 advocates:01 recursion:01 mutation:01 haskell:01 haskell:01 On Friday 09 May 2008 02:11:33 Matthew William Cox wrote: > On Fri, May 09, 2008 at 01:39:54AM +0100, Jon Harrop wrote: > > 5. Strings: pushing unicode throughout a general purpose language is a > > mistake, IMHO. This is why languages like Java and C# are so slow. > > This is simply ridiculous. Using heavy-weight unicode-aware functions > for character operations may slow down string-intensive operations in > those languages, but the only alternative is to be broken. Your definition of "broken" is broken. > See items 3 and 4 here: > > http://www.moserware.com/2008/02/does-your-code-pass-turkey-test.html > > In both cases, we need locale-aware character processing. That means > Unicode these days. Unless you code your own routines for processing > every 8-bit character set out there. I don't. That is not a justification for pushing Unicode throughout a programming=20 language. You can support Turkish and Arabic without degrading the=20 performance of my software. =46or us, this is about two things: 1. Profit. 2. Performance. Our sales already correlate with the world distribution of wealth even thou= gh=20 we only support English. There is literally no value in us supporting other= =20 languages. So we have no need of unicode. What you call "Using heavy-weight unicode-aware functions for character=20 operations" refers to all lexing and parsing. OCaml provides incredibly fas= t=20 lexers and parsers and our customers make heavy use of that. Other language= s=20 do not. This is a major advantage of OCaml, IMHO. So imposing unicode upon = us=20 is not only unnecessary but is actually damaging. > > 8. Exceptions: I love OCaml's extremely fast exception handling (6x > > faster than C++, 30x faster than Java and 600x faster than C#/F#!). I > > hate the "exceptions are for exceptional circumstances" line promoted by > > the advocates of any language implementation with cripplingly-slow > > exception handlers. I really miss fast exception handling in F#. Brian > > gives an example of exception handling with recursive IO functions > > failing to be tail recursive here and advocates option types. But > > recursion is the wrong tool for the job here and option types are even > > worse. You should use mutation and, failing that, CPS. > > I suspect his reaction to exceptions comes from an unfamiliarity with > their uses in Ocaml. Except Brian has been using OCaml for many years. > > 9. Deforestation: Brian says "Haskell has introduced a very interesting > > and (to my knowledge) unique layer of optimization, called > > deforrestation". True, of course, but useless theoretical piffle because > > we know that Haskell is slow in practice and prohibitively difficult to > > optimize to-boot. Deforesting is really easy to do by hand. > > Yes, its easy to do by hand. It's also time consuming. Do you spend >1% of your time deforesting? > Don't you make a living off ocaml? I use OCaml professionally in industry but our OCaml-based sales have decli= ned=20 since Q3 2007 to only =A36k p.a. now. > I'm surprised you can justify using your time on such a mechanical task. By my estimates, <<1% of my time is spent deforesting. It is irrelevant, ju= st=20 like all of the other "benefits" of Haskell that have debilitating hidden=20 costs. > Granted, deforesting something like map f . map g into=20 > map (f . g) is trivial, but we can come up with both trivial and > nontrivial examples for almost anything. Predictable performance and memory consumption are infinitely more valuable= =20 than the odd trivial rewrite. Incidentally, I forgot a couple of things for my wish list: =2E Overloading. =2E IDE-friendly, e.g. Intellisense for GUI code. =2D-=20 Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e