Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] - Convert Caml to C/C++, C#, PHP, etc -
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Erik de Castro Lopo <mle+ocaml@m...>
Subject: Re: [Caml-list] - Convert Caml to C/C++, C#, PHP, etc -
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'.