caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Caml productivity.
@ 2002-07-15 21:22 Pal-Kristian Engstad
  2002-07-20 15:16 ` William Chesters
                   ` (3 more replies)
  0 siblings, 4 replies; 47+ messages in thread
From: Pal-Kristian Engstad @ 2002-07-15 21:22 UTC (permalink / raw)
  To: caml-list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 2579 bytes --]

Some proponents of this mailing list seem to be
convinced that Ocaml is so much more productive than
C++. I find this to be a terrible mistake. From an
industry where performance is crucial (games
programming), I find quite a few aspects of Ocaml hard
to unify with productivity.

There is something to be said for syntax. Syntax
should help the programmer, not the compiler. In
games, it is standard to have a huge library of
classes dealing with mathematical concepts. A minimum
requirement is support for matrices, vectors,
quaternions and splines. This usually also entails
inline assembly, taking advantage of SIMD instruction
sets. Operator overloading is very important to games
programmers, especially for AI and behavior code.

Here is a short list of items that I’ve found
illogical and inconvenient for C/C++ programmers in my
field:

1. The lack of operator overloading, especially
floating-point operations.
2. The lack of bit-fiddling operations.
3. The lack of inline assembly constructs.
4. The non-obvious layout of variables (essential for
optimized functions).
5. The non-obvious differences between arrays and
“inline” arrays.
6. The non-obvious behavior of garbage collection.

One has to understand that when performance is
super-important, one cannot just rely on the compiler
anymore. Some sections of the code have to be
optimized by hand, and it is here that Ocaml falls
short of C/C++. 

As an example, imagine that you want to define:

struct Elems {
	u32 handle;
	u16 numData;
	u16 index;
};

struct Data {
	Elems elem[128];
	u8 buffer[16 * 1024];
};

Data *data = (Data *)0xabadbeef;

This is a very clear layout. One wants the data in a
very specific memory configuration. One needs to know
the exact sizes of the data structure. This could for
instance map to special hardware that is laid out in
this way. This is impossible to do with Ocaml.

Now, Ocaml is a great language for some tasks. I’ve
successfully used it with Facile, a constraints
solver. The parsing of the input was a breeze compared
to a similar C/C++ solution. But one can’t go around
claiming that Ocaml is a productivity enhancer for all
tasks. Games programming certainly isn’t one of them.

PKE.



__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.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


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2002-08-02 14:51 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-15 21:22 [Caml-list] Caml productivity Pal-Kristian Engstad
2002-07-20 15:16 ` William Chesters
2002-07-22 18:22   ` Pal-Kristian Engstad
2002-07-22 18:41     ` achrist
2002-07-22 19:23       ` Pal-Kristian Engstad
2002-07-22 21:13         ` [Caml-list] CamlIDL and function pointers Michael Tucker
2002-07-23  8:39           ` Xavier Leroy
2002-07-23 13:11             ` Dmitry Bely
2002-07-24 15:00             ` Michael Tucker
2002-07-25  9:36               ` Xavier Leroy
2002-07-22 21:26     ` Games (Re: [Caml-list] Caml productivity.) Oleg
2002-07-23  2:56       ` Issac Trotts
2002-07-23 11:03         ` eijiro_sumii
2002-07-23 16:17           ` Charles Martin
2002-07-29  3:36           ` Andrei de A. Formiga
2002-07-29  6:32             ` Florian Hars
2002-07-29 10:23             ` eijiro_sumii
     [not found]               ` <001901c237a7$9e685920$890bfea9@mimbi>
2002-07-30  4:52                 ` eijiro_sumii
2002-07-30 18:13                   ` Jonathan Coupe
2002-07-30  6:16                     ` eijiro_sumii
2002-08-01 15:39                     ` John Max Skaller
2002-08-01 15:59                       ` Markus Mottl
2002-08-01 16:28                       ` Jonathan Coupe
     [not found]                         ` <86vg6ta9o6.fsf@laurelin.dementia.org>
2002-08-02 12:50                           ` Jonathan Coupe
2002-08-02 14:51                         ` John Max Skaller
2002-07-25  3:19       ` Chris Hecker
2002-07-28 13:45         ` Jonathan Coupe
2002-07-29  0:57           ` Michael Vanier
2002-07-22 22:00     ` [Caml-list] Caml productivity Alexander V.Voinov
2002-07-20 15:25 ` Oleg
2002-07-22  6:41 ` Tom
2002-07-22 10:46 ` Nicolas Cannasse
2002-07-22 17:46   ` Pal-Kristian Engstad
2002-07-24  3:20     ` Travis Bemann
2002-07-24  9:45       ` Pal-Kristian Engstad
2002-07-26 21:42         ` Chris Hecker
2002-07-27  4:41           ` Issac Trotts
2002-07-27  5:49             ` Chris Hecker
2002-07-27 14:49               ` John Max Skaller
2002-07-27  9:06           ` Oleg
2002-07-27 18:18             ` Chris Hecker
2002-07-29  8:13         ` Nicolas Cannasse
2002-07-30  4:46           ` Travis Bemann
2002-07-24  8:02     ` Nicolas Cannasse
2002-07-24  8:25       ` Jérôme Marant
2002-07-24 10:00       ` Pal-Kristian Engstad
2002-07-27  9:06         ` Oleg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).