Browse thread
A C to OCaml helper ?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2008-03-12 (22:08) |
From: | Fabrice Marchant <fabrice.marchant@o...> |
Subject: | Re: [Caml-list] A C to OCaml helper ? |
On Wed, 12 Mar 2008 22:03:51 +0100 Basile STARYNKEVITCH <basile@starynkevitch.net> wrote: > Fabrice Marchant wrote: > > Please does it exist some tool that could do at least the very mechanical first parts of the translation of a C source to OCaml ? > > Why do you want to do that? Why do I want a tool to do the _very mechanical parts_ of the job ? A simple example : because I would be happy to get the comment brackets automatically translated ( and the C++ like C extension // too.) There are several such very automatic things like if( ) -> if then. > You could call most of your C routines from Ocaml. Yes, but in the present case, I'm interesting in a full rewriting. This is precisely because I imagine to be able to rewrite the C ( game ) program a very different and terse way, that I undertake this task. > And most importantly, the main interest of ocaml is the way of thinking > it. Absolutely : that's the reason why I play to rewrite the C program an OCaml way. > When mastered, it is a language much more expressive & much more fun. Without daring to brag about 'mastering' the language, I however declare to perfectly know this. > And no mechanical translation would give you that.... Obviously. > If it is a homework, better to start thinking & coding in Ocaml, than to > translate blindly C into Ocaml. > > And a blind translation won't learn anything about Ocaml or functional > programming. When I play chess, I always think the other player will give the best things and never suppose he has absurd ideas in mind... However, I remember you are the man who oriented me to OCaml and I'm very grateful of this, because OCaml programming is a real pleasure Best Regards, Fabrice http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=626 http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=627 http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=619