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 IAA08278; Mon, 22 Jul 2002 08:42:01 +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 IAA08269 for ; Mon, 22 Jul 2002 08:42:01 +0200 (MET DST) Received: from web11907.mail.yahoo.com (web11907.mail.yahoo.com [216.136.172.191]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g6M6fxn25855 for ; Mon, 22 Jul 2002 08:41:59 +0200 (MET DST) Message-ID: <20020722064158.74336.qmail@web11907.mail.yahoo.com> Received: from [24.221.171.193] by web11907.mail.yahoo.com via HTTP; Sun, 21 Jul 2002 23:41:58 PDT Date: Sun, 21 Jul 2002 23:41:58 -0700 (PDT) From: Tom Subject: Re: [Caml-list] Caml productivity. To: Pal-Kristian Engstad , caml-list@inria.fr In-Reply-To: <20020715212251.19685.qmail@web13302.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Some proponents of this mailing list seem to be > convinced that Ocaml is so much more productive than > C++. It is. For many problems. Yours may not be one of them. > I find this to be a terrible mistake. The terrible mistake is thinking that there is one programming language that works really well for everything. There isn't. There never will be because it's a logical impossibility. > From an > industry where performance is crucial (games > programming), I find quite a few aspects of Ocaml hard > to unify with productivity. That's a silly generalization. There are many excellent games that do not require high performance computing in any form. However, even those games that do require high-performance computing (say, for 3D graphics or AI) can generally be partitioned into a small computational kernel and a large set of high-level constructs. And you don't even have to reinvent the wheel--many such kernels alreay exist and are easy to hook up to OCAML: BLAS, LAPACK, OpenGL, various game and object graph libraries (CrystalSpace, etc.), neural networks, and many others. Many high-performance games are programmed in an interpreter coupled to a bunch of those libraries. OCAML gives you a leg up because of better compile-time type checking, a good foreign function interface, and the ability to do modestly high performance computing in OCAML itself in a pinch. Two specific points: > 6. The non-obvious behavior of garbage collection. Anything you don't understand is "non-obvious". However, GC is no more "non-obvious" than manual storage allocators: you have to learn how to write high performance code in either of them. GC'ed languages are different: what you are used to in C/C++ will not work well. (That is not to say that the OCAML collector couldn't be improved for soft real time problems.) > As an example, imagine that you want to define: > [packed data structure layout example follows] Yes, control over layout is nice for high performance computing. It could be added to OCAML. Are you volunteering? Note, incidentally, that neither C nor C++ make a lot of actual guarantees about layout of data in memory; code that actually depends on it is, in most cases, unportable. Some compilers will even change layout under different optimization options, so beware. C and C++ are great languages. I write a lot of C++ code. But C and C++ should really be considered niche languages, for specific, low-level system tasks, computational kernels, or certain high-performance numerical uses. Most code people write in C or C++ (GUI software, many games, etc.) would be much better, and more productively, written in something else. Tom __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com ------------------- 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