Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any idea's on how long it takes to learn C++, then create a chessmonster

Author: Gareth McCaughan

Date: 18:04:14 12/11/01

Go up one level in this thread


On December 11, 2001 at 17:44:03, Roy Eassa wrote:

[I said:]
>> SML = Standard ML. I would recommend OCaml in preference, though,
>> since the OCaml compiler produces staggeringly fast code.
>
> I somehow hadn't heard of Caml before.  I looked up O'Caml at
> http://www.ocaml.org/ and found it to be very interesting.  How would you
> compare it to Python (or Jython)?

I'm not an expert, but here are a few differences.

  - Quirkier syntax. One advantage of Python is that it's very
    readable even for newcomers; O'Caml doesn't have that.

  - Much faster execution. O'Caml's compiler produces blindingly
    fast native code. Python doesn't have a native code compiler,
    and its bytecode compiler + interpreter doesn't produce specially
    good performance.

  - Static typing. O'Caml is a statically typed language, but
    not so obtrusively as (e.g.) C++ because it has type inference
    and polymorphic types.

  - Functional versus eclectic/procedural. Python is a fairly
    mainstream language in most respects; it makes a couple of
    small nods in the direction of functional programming (e.g.,
    having a "lambda" keyword) and a couple in odder directions
    (e.g., its generators), but basically it's very ordinary.
    O'Caml is a functional language, and it does pattern matching,
    and in general it feels much less mainstream than Python.
    The heavy use of nested functions and higher-order functions
    is likely to make it seem rather inside-out, for instance.

  - Libraries. Python comes with a bunch of handy modules for
    doing the sort of things the Python developers care about:
    strings, regular expressions, serving and reading web pages,
    XML and so on. O'Caml's developers have a rather different
    focus. Yes to strings and regular expressions; no to web and
    XML And all that trendy stuff. On the other hand, yes to
    arbitrary-precision rational arithmetic and parser building
    and sets.

Someone who knows more about O'Caml than I do can probably say
more.

--
g



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.