<div dir="ltr">Thanks, Reid.<div><br></div><div>When you say the frontend needs to know about how LLVM implements it, do you mean, the Function* type in LLVM, and in which order you add to the arguments array when building this type?<br></div><div><br></div><div>Thank you for the video link, just reading the abstract I see this is the way to go. However, as I finished typing the sentence, I wonder if this means clang and/or llvm may be a runtime dependency. I imagine it doesn't need to be and that clang is the tool I'll use to link to the external libraries without an FFI.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 18, 2015 at 10:38 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Wed, Feb 18, 2015 at 10:20 AM, Hayden Livingston <span dir="ltr"><<a href="mailto:halivingston@gmail.com" target="_blank">halivingston@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I'm also a beginner, so asking on this beginner thread -- is there anything in addition to the C ABI that one needs to worry about? I imagine a C ABI gives lots of free libraries to integrate into your language, etc.</div></blockquote><div><br></div></span><div>Being able to match the local C ABI is generally good enough for most languages. It makes it easy to implement the language runtime in C, and let you build an FFI to external libraries.</div><div><br></div><div>However, if you want to leverage libraries in another language like C++ or Obj-C, it may be worth doing more work to allow deeper interoperability, as is done in Swift for Obj-C. See the "Skip the FFI" dev meeting talk:</div><div><a href="http://llvm.org/devmtg/2014-10/#talk18" target="_blank">http://llvm.org/devmtg/2014-10/#talk18</a><br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Also the C ABI change on platforms? I thought C Calling convention was the same on all platforms.</div></div></blockquote><div><br></div></span><div>It is definitely different. However, if you're just passing scalar values (ints, floats, and pointers), then LLVM will more or less abstract it all away for you. If you pass aggregates, the frontend needs to know the platform calling convention and how LLVM implements it.</div></div></div></div>
</blockquote></div><br></div>