From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 3B65AD55E for ; Fri, 29 Jul 2005 00:34:27 +0200 (CEST) Received: from pih-relay05.plus.net (pih-relay05.plus.net [212.159.14.132]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6SMYQWU029977 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 29 Jul 2005 00:34:27 +0200 Received: from [80.229.56.224] (helo=chetara) by pih-relay05.plus.net with esmtp (Exim) id 1DyGxN-0007Oy-AT for caml-list@yquem.inria.fr; Thu, 28 Jul 2005 23:34:25 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Games Date: Thu, 28 Jul 2005 23:31:28 +0100 User-Agent: KMail/1.7.2 References: <20050728213200.64662.qmail@web30504.mail.mud.yahoo.com> In-Reply-To: <20050728213200.64662.qmail@web30504.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507282331.28919.jon@ffconsultancy.com> X-Miltered: at concorde with ID 42E95D72.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 vastly:01 ocaml:01 simulating:01 non-trivial:01 arrays:01 ...:98 frog:98 wrote:01 wrote:01 structures:01 structures:01 interactions:01 interactions:01 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 Thursday 28 July 2005 22:32, David Thomas wrote: > --- Jon Harrop wrote: > > Many games now use quite sophisticated LOD algorithms > > and OCaml is vastly better suited to this than C++. > > I'm probably missing something obvious, but... why? Essentially, OCaml is much better suited to the manipulation of complicated data structures like trees and graphs than C++. In particular, it is much easier to write such code correctly in OCaml than in C++. As games have evolved, their emphasis has moved from blitting to simulating the interactions of complicated hierarchical systems in real time. For example, the transition from (array-based) sprites to (tree- or graph-based) LOD polygonal models in the presence of collision detection. Similarly, as scientific computing has evolved, emphasis has moved from vector/matrix calculations to the hierarchical simulation of physical systems (not in real time!). For example, use of the (tree-based) Fast Multipole Method (FMM) instead of (array-based) Ewald summation when computing long-range interactions between particles. This is easily explained with a little computer science: We're now close enough to the asymptote that asymptotic algorithmic complexity has become more important than the constant prefactor. We know that trees, graphs and many other non-trivial data structures facilitate common operations (e.g. search, insert, replace) with considerably better asymptotic complexities (e.g. O(log n) instead of O(n)). So we're ditching arrays in favour of trees and graphs and, consequently, we should be ditching C++ in favour of OCaml. This is exactly the topic of my book "Objective CAML for Scientists". Hence, I think I'm a suitable candidate for writing "Objective CAML for Games". :-) -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists