Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Peter Zotov <whitequark@whitequark.org>
To: <caml-list@inria.fr>
Subject: Re: [Caml-list] LLVM OCaml bindings
Date: Tue, 12 Nov 2013 18:13:42 +0400	[thread overview]
Message-ID: <f2b4398d78be424e036e7fc34fe1ccf0@whitequark.org> (raw)
In-Reply-To: <CAHaHOqSGEA4=5R2BLs4U66dq66eUuVDcXU2dtmn=dAMuh2R-Rg@mail.gmail.com>

Jeff Meister писал 12.11.2013 07:44:
> Aside from compatibility with existing code though, I can't imagine
> why any OCaml programmer would want to use a type-unsafe version of
> the LLVM bindings. The C API gets a pass for flattening LLVM's deep
> inheritance hierarchies into opaque pointers like llvalue and lltype,
> since that's all C lets you do. But that's just not acceptable to me
> in OCaml, where I have the tools to correct the situation. If I have
> to give up static type safety to work with LLVM in OCaml, then I might
> as well not use OCaml on that project.

Speed? :) Actually, OCaml has much more type safety than C or bindings
of LLVM to dynlangs (Ruby, etc). Ruby bindings didn't even check if I
pass lltype where llvalue is expected, and there was no easy way to do
it.

> If the Haskell bindings expose more capabilities than the OCaml ones,
> it would be great to add these additional functions. But I'm curious,
> how are they getting additional functions? Can Haskell bind directly
> to C++ without going through C? Or have the Haskell folks made major
> changes to the LLVM C API? And if so, why wouldn't they push those
> changes upstream themselves?

They wrote their own C wrappers using the C++ API. I'm currently 
pushing
them upstream, slowly. Haskell folks probably didn't do that because 
it's
somewhat of a pain if you're not an LLVM committer.

> 
> On Fri, Nov 8, 2013 at 3:31 AM, Jon Harrop <jon@ffconsultancy.com> 
> wrote:
> 
>>> I'm not going to change APIs in any way which needs nontrivial, 
>>> significant fixes to clients, there's simply no need.
>> 
>> Ok, great.
>> 
>> Jeff Meister was talking about writing more type safe bindings. I 
>> think that would be fine as long as it wraps the existing less-safe 
>> bindings so people can continue to use them. I tried using LLVM from 
>> Haskell and had a lot of problems because they'd used every trick in 
>> the book to write the most type safe possible bindings and it makes it 
>> much harder to learn and use. I'd personally much rather see more 
>> complete bindings...
>> 
>> BTW, what are your thoughts on MSJIT? I just started reading about it 
>> and it seems very underwhelming. Sounds like they're struggling to 
>> refactor their C++ code so they're reinventing things but not doing it 
>> significantly better. So I don't think I'll be rushing to switch to 
>> MSJIT unless they actually deprecate the old JIT.
>> 
>> Cheers,
>> Jon.
>> 
>> -----Original Message-----
>> From: Peter Zotov [mailto:whitequark@whitequark.org]
>> Sent: 08 November 2013 10:19
>> To: jon@ffconsultancy.com
>> Cc: caml-list@inria.fr
>> Subject: RE: [Caml-list] LLVM OCaml bindings
>> 
>> Jon Harrop писал 08.11.2013 13:36:
>>> I just wanted to check: you're not breaking the existing bindings,
>>> right?
>> 
>> Sorry, realized the previous letter was phrased ambiguously.
>> I'm asking because I do want to break existing bindings. The changes 
>> would mainly touch two areas:
>> 1) Memory management. I want to get rid of most or all of dispose 
>> functions and allow to use OCaml's GC.
>> 2) Llvm_target interface is very outdated and it could be updated to 
>> integrate much better with the TargetMachine interface.
>> 
>> There are also two or three Llvm functions which need minor changes.
>> 
>> I'm not going to change APIs in any way which needs nontrivial, 
>> significant fixes to clients, there's simply no need.
>> 
>> --
>>    WBR, Peter Zotov.
>> 
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list [1]
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners [2]
>> Bug reports: http://caml.inria.fr/bin/caml-bugs [3]
> 
> 
> 
> Links:
> ------
> [1] https://sympa.inria.fr/sympa/arc/caml-list
> [2] http://groups.yahoo.com/group/ocaml_beginners
> [3] http://caml.inria.fr/bin/caml-bugs

-- 
   WBR, Peter Zotov.

  reply	other threads:[~2013-11-12 14:13 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
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 [this message]
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=f2b4398d78be424e036e7fc34fe1ccf0@whitequark.org \
    --to=whitequark@whitequark.org \
    --cc=caml-list@inria.fr \
    /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