From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 813D1D176 for ; Tue, 26 Jul 2005 03:09:59 +0200 (CEST) Received: from cenn.mc.mpls.visi.com (cenn.mc.mpls.visi.com [208.42.156.9]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6Q19wnP006648 for ; Tue, 26 Jul 2005 03:09:59 +0200 Received: from [192.168.42.2] (bhurt.dsl.visi.com [208.42.141.66]) by cenn.mc.mpls.visi.com (Postfix) with ESMTP id 6C63B81B7; Mon, 25 Jul 2005 20:09:58 -0500 (CDT) Date: Mon, 25 Jul 2005 20:10:29 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Jere Sanisalo Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to do this properly with OCaml? In-Reply-To: <20050726005640.GA30583@xmunkki.org> Message-ID: 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> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 42E58D66.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocaml:01 char:01 char:01 apis:01 api:01 applicative:01 2005,:98 25,:98 wrote:01 wrote:01 ptr:02 ptr:02 languages:03 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 On Tue, 26 Jul 2005, Jere Sanisalo wrote: > On Mon, Jul 25, 2005 at 07:47:16PM -0500, Brian Hurt wrote: >>> The language requirements with respect to initialisation >>> are the difference: Ocaml requires all store to be >>> initialised, C/C++ does not. >> Yep. The following C code is really hard to implement in Ocaml: >> char * ptr = (char *) 0xA00000ul; >> ptr[315] = 'a'; >> I consider this an advantage of Ocaml over C/C++. > > Depends on the task.. What if it was a hardware driver? Hardware drivers are specialized tasks. One thing that drives me crazy is the assumption that a language needs to be able to do everything, and if it can't, it can't do anything. > More so, it's not > the language, it's the things you can do with it, coupled with the APIs > possible and already present. I know I'm already favoring .NET as a general > platform for API tools in the gaming world. The games still need to be fast, > so C++ for them for now, but C# (and others) solve the tool problem quite > nicely. And the .NET library is not the least of the reasons; it's easy to > do so. Note that languages encourage or discourage certain styles of programming. For example, C++, and to a lesser extent Java and C#, rather strongly discourages an applicative style of programming- primarily due to the costs of allocation. You can do it, but it's going to be a fairly serious perfomance hit. Ocaml, on the other hand, discourages an imperitive style of programming. There's no performance hit, but there are some type issues and library support. The point is that instead of bitching about how hard it is to implement the other language's solution in this language, to instead be thinking about the correct solution to implement in this language. Brian