From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA11292; Mon, 7 Jun 2004 19:01:26 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA11590 for ; Mon, 7 Jun 2004 19:01:25 +0200 (MET DST) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i57H1NSH004322 for ; Mon, 7 Jun 2004 19:01:24 +0200 Received: (qmail 11712 invoked from network); 7 Jun 2004 17:01:20 -0000 Received: from shell2.speakeasy.net ([69.17.110.71]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 7 Jun 2004 17:01:20 -0000 Date: Mon, 7 Jun 2004 10:01:20 -0700 (PDT) From: brogoff To: "Brandon J. Van Every" cc: caml Subject: Re: [Caml-list] 32 bit floats, SSE instructions In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 40C49F63.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brogoff:01 brogoff:01 caml-list:01 floats:01 brandon:99 floats:01 gcaml:01 thou:01 showstopper:01 gcaml:01 doubles:01 boxing:01 realm:01 unacceptable:01 mlton:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 7 Jun 2004, Brandon J. Van Every wrote: > Game developers do tons of stuff with 32 bit floats. How difficult to > add these to OCaml? I'm not saying, "do it for me," I'm asking how > difficult it would be to add to the language. If it were feasible, then > this mod could be distributed as a patch, until such a time as it is > accepted as A Good Thing. (Anyone already tried this?) Bigarray supports 32 bit floats (note to Christophe, he said 32 bit floats, not 32 bit ints!). Since the main use of Bigarray is to interface to C and Fortran, you can take this as an implicit suggestion to write those parts of your code in C. Sorry. I don't think the lack of true overloading (GCaml, where art thou?) is the problem, you can always make up some new operators for 32 bit floats. Yes, I'd prefer overloading, but that isn't a showstopper. In any case, certain members of the Caml cabal have commented that they are in favor of overloading, but as usual, they want to do it right, so we may need to wait quite a while before we see it. There is already a GCaml branch in the CVS tree. I think the real problem with floats (pun intended) and doubles and chars and all that is that you frequently get unwanted boxing in OCaml and other such languages. This will of course lead to reduced performance, which, if I understand the game programming realm, is generally unacceptable. I don't think that problem is insurmountable. I spoke with Stephen Weeks about a year ago and he was interested in doing an OCaml front end for MLton, but since he's a lean fellow and needs to eat, he was also interested in remuneration. In case you don't know, MLton is a whole program optimizing compiler for SML which supports "Untagged native integers and words of many sizes, unboxed reals, and unboxed arrays." which I think is what you want for coding some of the high performing parts of games and many other apps. > Does the lack of operator overloading pretty much prevent this support > in practice? If there's only one +. operator available, and it's for 64 > bit floats, whaddya gonna do? +@, -@, etc., etc. > SSE instructions I imagine would be more involved. The data type I'm > interested in is a vector of 4 32 bit floats. Sounds like another job > for operator overloading. C doesn't support this either, yet people get by. I'm not making excuses for the lack of a desirable (IMO too) feature, just pointing out that the absence of overloading isn't the big problem here. -- Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners