Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2008-10-09 (21:57)
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

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 de Castro Lopo
Pastafarianism :
The intelligent alternative to 'Intelligent Design'.