From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 3E7E8BBC1 for ; Wed, 12 Mar 2008 23:08:21 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao0BAFvx10dQDPKSZ2dsb2JhbACBWY8YCwQECQgKDYEQlU8 X-IronPort-AV: E=Sophos;i="4.25,490,1199660400"; d="scan'208";a="10197566" Received: from smtp2b.orange.fr ([80.12.242.146]) by mail3-smtp-sop.national.inria.fr with ESMTP; 12 Mar 2008 23:08:20 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2b19.orange.fr (SMTP Server) with ESMTP id 9D75B700009C for ; Wed, 12 Mar 2008 23:08:20 +0100 (CET) Received: from localhost.localdomain (Mix-Lyon-303-4-65.w193-248.abo.wanadoo.fr [193.248.106.65]) by mwinf2b19.orange.fr (SMTP Server) with ESMTP id 5F22F700008F for ; Wed, 12 Mar 2008 23:08:19 +0100 (CET) X-ME-UUID: 20080312220819389.5F22F700008F@mwinf2b19.orange.fr Date: Wed, 12 Mar 2008 22:09:38 +0100 From: Fabrice Marchant To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] A C to OCaml helper ? Message-ID: <20080312220938.236ba3d5@orange.fr> In-Reply-To: <47D84537.2060100@starynkevitch.net> References: <20080312204217.3f5087e3@orange.fr> <47D84537.2060100@starynkevitch.net> X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.7; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 basile:01 basile:01 ocaml:01 translated:01 rewriting:01 contrib:01 contrib:01 wrote:01 wrote:01 rewrite:01 rewrite:01 caml-list:01 precisely:01 expressive:01 On Wed, 12 Mar 2008 22:03:51 +0100 Basile STARYNKEVITCH 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