[LLVMdev] Status of ocaml bindings

Jianzhou Zhao jianzhou at seas.upenn.edu
Mon Jul 26 08:32:18 PDT 2010

On Mon, Jul 26, 2010 at 10:15 AM, Jason Johnson
<jason.johnson.081 at gmail.com> wrote:
> Hello list,
> Since reading the kaleidoscope tutorial I have decided to play around with creating a language I've had in the back of my mind for some time.  I would prefer not to write the front end in c or c++ though if it can be avoided.  I read online that the ocaml bindings are distributed with llvm but are not always as up to date as the c or c++ bindings.  Is this (still) the case?  Is there anything that the c/c++ bindings can do that the ocaml ones cannot?

The C++ objects (values, instructions, modules, ...) are opaque in
OCaml. To program them, we need to use the wrapped C++ interfaces for
these objects if there were, and we cannot  'pattern-match' these
objects. For example, the current OCaml bindings can let us build a
LLVM IR (the high-level source language can be translated into LLVM IR
with these interfaces), call any existing analysis or transformations.
To design a new pass in OCaml, it might need to expose more C++
primitives, so it is more convenient to program in C++ once we can
build IR from the source language with OCaml bindings. But I don't
know if there is an better way to expose C++ to OCaml.

> Thanks sincerely for your help,
> Jason
> Sent from my iPad
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


More information about the llvm-dev mailing list