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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 68B69BB84 for ; Thu, 9 Oct 2008 23:57:50 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQDABYb7kjAXQIniGdsb2JhbACTWQEBARUiq2oDgWc X-IronPort-AV: E=Sophos;i="4.33,385,1220220000"; d="scan'208";a="30119556" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Oct 2008 23:57:50 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m99Lvm1P001888 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 9 Oct 2008 23:57:49 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqMCAEcb7kjLOwGUaWdsb2JhbACTWRgKBhIEq18DgWc X-IronPort-AV: E=Sophos;i="4.33,385,1220220000"; d="scan'208";a="17872024" Received: from outbound.icp-qv1-irony-out3.iinet.net.au ([203.59.1.148]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Oct 2008 23:57:46 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAIQb7kjLzuai/2dsb2JhbAC/ZwOBZw X-IronPort-AV: E=Sophos;i="4.33,385,1220198400"; d="scan'208";a="335453419" Received: from unknown (HELO hendrix.mega-nerd.net) ([203.206.230.162]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 10 Oct 2008 05:57:41 +0800 Received: from hendrix (hendrix [192.168.200.99]) by hendrix.mega-nerd.net (Postfix) with SMTP id 8771EAB125 for ; Fri, 10 Oct 2008 08:57:41 +1100 (EST) Date: Fri, 10 Oct 2008 08:57:41 +1100 From: Erik de Castro Lopo To: caml-list@inria.fr Subject: Re: [Caml-list] - Convert Caml to C/C++, C#, PHP, etc - Message-Id: <20081010085741.c099a21b.mle+ocaml@mega-nerd.com> In-Reply-To: <200810091747.59342.kuba@mareimbrium.org> References: <19791755.post@talk.nabble.com> <19792384.post@talk.nabble.com> <20081003153921.9bc91e12.mle+ocaml@mega-nerd.com> <200810091747.59342.kuba@mareimbrium.org> Reply-To: caml-list@inria.fr Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 48EE7E5C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 bytecode:01 bytecode:01 compiler:01 developement:01 unreadable:01 compiler:01 wrote:01 readable:01 compile:01 caml-list:01 imperative:01 caml:02 binary:02 Kuba Ober wrote: > Um, since Ocaml can be compiled to bytecode and said bytecode executed > by an interpreter written in C, that's sorta-kinda el-cheapo conversion > right there. One can work backwards. I'm pretty sure the original poster's intent was to convert the MTASC compiler to C, C++ or PHP and then continue developement in the new language. Unfortunately, the machine conversion from languages as different as Ocaml and the imperative laguages above result ins source code that may compile in the target language, but is almost completely unreadable by human programmers familiar with the target language. Doing the conversion via bytecode would result in even less readable code than the more direct route for the same reasons that we don't have usable binary to high level language decompilers. > Side note: is there an Ocaml bytecode-compiler written in Ocaml > somewhere? I'm pretty sure the vast majority of the standard Ocaml bytecode compiler is written in Ocaml. The same is probably not true for the bytecode VM. Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- Pastafarianism : http://www.venganza.org/ The intelligent alternative to 'Intelligent Design'.