From: Jacques-Pascal Deplaix <jp.deplaix@gmail.com>
To: Peter Zotov <whitequark@whitequark.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] LLVM OCaml bindings
Date: Tue, 05 Nov 2013 12:09:05 +0100 [thread overview]
Message-ID: <5278D1D1.4060009@gmail.com> (raw)
In-Reply-To: <d7f9f3fb65cc0c93ba87569464c80910@whitequark.org>
Hi,
I'm using LLVM for the compiler of my toy language Cervoise (link below).
First, before I started it, I heard from a friend that the official LLVM
binding can segfaults so I didn't want to use it [1].
I tried to create my own binding that produces LLVM-IR but there were
bugs (the interface didn't seems good).
So I tried the official binding. Like expected, it segfaults and has
several bugs and misses features [2] :/
Then, I tried to reproduce the interface of the LLVM binding but with
types parameters for lltype and llvalue to know what LLVM types can be
inserted for a function (the main cause of segfault), but it was very
very painful since we have to separate impossible cases and the type
errors (with recursive polymorphic variants) are awesome (irony) [3].
So now I have again my own binding that produces LLVM-IR but this time
with the same interface than the official binding, and it works pretty
well [4].
As a conclusion, don't try to add a type parameter like I did (however,
you can try other ways), it would be a waste of time.
[1]: We tried to fix this by starting TyLLVM (but it's not satisfying
and far to be finished): https://bitbucket.org/dinosaure/tyllvm
[2]: I have done several issues on the LLVM bug tracker, but apart from
segfaults and bugs when trying to use LLVM_bitwriter, the missed feature
is, IMHO, the possibility to get a string that contains the LLVM-IR
code, and not just print it.
[3]: https://github.com/jpdeplaix/cervoise/blob/jeSuisFou/src/LLVM.mli
[4]: https://github.com/jpdeplaix/cervoise/blob/master/src/LLVM.ml
On 11/05/2013 05:23 AM, Peter Zotov wrote:
> Hello folks,
>
> I'm currently working on improving LLVM's OCaml bindings.
> There's been quite some progress so far[1]; the only major
> areas pending are AOT code generation and MCJIT support.
>
> I would be very interested to hear how are you using these
> bindings, or suggestions for future development. In particular,
> I'd like to understand the impact of breaking the API.
>
> [1]: https://github.com/llvm-mirror/llvm/commits/master/bindings/ocaml
>
next prev parent reply other threads:[~2013-11-05 11:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 4:23 Peter Zotov
2013-11-05 8:12 ` Gabriel Kerneis
2013-11-05 8:18 ` Peter Zotov
2013-11-05 11:09 ` Jacques-Pascal Deplaix [this message]
2013-11-05 11:32 ` Peter Zotov
2013-11-05 21:00 ` Jeff Meister
2013-11-06 7:19 ` Peter Zotov
2013-11-06 7:54 ` Jeff Meister
2013-11-05 21:30 ` Jacques-Pascal Deplaix
2013-11-06 7:06 ` Peter Zotov
2013-11-08 9:36 ` Jon Harrop
2013-11-08 10:18 ` Peter Zotov
2013-11-08 11:31 ` Jon Harrop
2013-11-08 11:44 ` Peter Zotov
2013-11-12 3:44 ` Jeff Meister
2013-11-12 14:13 ` Peter Zotov
2013-11-13 19:00 ` Jon Harrop
2013-11-14 16:06 ` Hongbo Zhang
2013-11-14 19:29 ` Jeff Meister
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5278D1D1.4060009@gmail.com \
--to=jp.deplaix@gmail.com \
--cc=caml-list@inria.fr \
--cc=whitequark@whitequark.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox