Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] [OT] Ocaml (was Re: Re: curiosity)
Home

[Freeciv-Dev] [OT] Ocaml (was Re: Re: curiosity)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] [OT] Ocaml (was Re: Re: curiosity)
From: Alan Schmitt <alan.schmitt@xxxxxxxx>
Date: Sun, 2 Dec 2001 10:19:52 +0100

* Gregor Zeitlinger (zeitling@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
> On Sat, 1 Dec 2001, Alan Schmitt wrote:
> > How about a fast, modern language, like Objective Caml.
> It's interesting you brought up the point. Until Wednesday I thought Java
> was state of the art in programming technique, but then I read a slashdot
> article about lightweight languages. What caught my attention was that
> the research academia basically said hackers are fools because they don't
> know how to program in a proper manner. I then followed some links and
> found that there are really interesing languages and some features were
> just very appealing. Objective Caml was one of them, and one that was
> ranked 2nd on a speed test after gcc and faster than g++. I thought that
> this was really impressive. Even more impressing was that it works
> without any variable assignment. All loops are done recursively without
> any loss in speed (I guess the compiler makes it iterative). And anyone
> who's programmed a declarative or functional/logic language knows that
> some problems can be handled very neet that way.

Actually, it's possible (and easy) to do imperative programming in Ocaml
(there are "for", "while" constructs, with references (variables)), and
the compiler creates the same code for a "for" loop than for a recursive
functional loop (the interesting feature is to be able to detect "tail
recursive function calls", that is function calls whose result is
immediately returned, without being used for additional computation in
the current function. Such calls can be translated into "jump" instead
of "call").

I'm part of the "research academia", and I really like caml, but I don't
think that programmers who use other languages are fool ;-) I think C is
great (and the interpreter for the caml bytecode is written in C, to be
portable (caml can also be compiled to native code for speed, and
bytecode for portability)), and with C you're very close to the machine.
I like Java because of memory management, and for the number of
libraries that come with it. I think it's a little slow, and they got
some things wrong with the objects, but still it's a pretty nice
language. I guess the problem with research academia languages is that
they lack marketing. But we're working on it ;-)

Anyway, back to freeciv. I think that the server and common libraries
should still be written in C, with a well specified interface so that we
lovers of other languages may write clients and client-side AIs in our
favorite language.

Sorry for the offtopic.

Alan

--
The hacker: someone who figured things out and made something cool happen.


[Prev in Thread] Current Thread [Next in Thread]