<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 20, 2015, at 12:36 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" class="">chisophugis@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jul 20, 2015 at 9:40 AM, Pete Cooper <span dir="ltr" class=""><<a href="mailto:peter_cooper@apple.com" target="_blank" class="">peter_cooper@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><span class=""><div class="">On Jul 18, 2015, at 11:27 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>> wrote:</div><br class=""></span><span class=""><div class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">2. We don't have a good set of tests for it, nor do we have a good set of tutorials/documentation for it. Our tutorials, specifically, are in C++, not in C. We could break the C API and we'd likely remain unaware for quite awhile.</span></div></span></blockquote>I think this is the most important point, that we lack testing for it.</div><div class=""><br class=""></div><div class="">IMO, the language doesn’t matter too much.  I’m happy with C or C++, but whichever (or both) or those are exposed in a stable way, we need the *users* of those APIs to help test it.</div><div class=""><br class=""></div><div class="">How about we add a StableAPI directory in unittests?  Then have a test written in C/C++ for each of the users of it.  So a WebKit.c test, Go.c, SomeProject.cpp, etc.</div><div class=""><br class=""></div><div class="">Then adding anything to the stable API must have a corresponding test, and changing the API shows us exactly which test broke, who cares about that test, and who to talk to about updating that API if we need to.  If the only test which breaks is WebKit then talk to WebKit, if its Go too then add them in, and so on.</div><div class=""><br class=""></div><div class="">Sure the tests will get large, but thats the point.  It would show us exactly what API users care about.  And the tests don’t need to actually run anything, just ensure that methods signatures are compatible with what they are using.</div><div class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">Part (most?) of the point of having a stable API is as a way of decoupling the development processes of two separate projects (modulo well-documented release-to-release updating). Requiring our users to add tests in our tree doesn't really achieve much decoupling. As a hyperbolic analogy: imagine if libjpeg required every user to add tests into its tree for their usage of the API.</div></div></div></div></div></blockquote>That is a convincing analogy.  I think the same applies to a separate project.  We shouldn’t expect users of the stable API to maintain it in another project.  Many people don’t even build clang, even fewer will build the API project, and if C++ API becomes common, then just about any commit to LLVM could break the API project.</div><div><br class=""></div><div>Seems like there are a few problems here.</div><div><br class=""></div><div>The first is that there’s disagreement over whether the C API is currently meant to be stable.  It used to be, but now maybe it is, maybe it isn’t.</div><div><br class=""></div><div>Then, if all of the C API is stable, we need to just be much more careful about ever changing it, and having tests of everything in it.</div><div>If only a subset of the C API is stable, then we really need to better define what is stable or not.  Currently I think users think its all stable.  Having stable and unstable in the same headers, which is what we have now, isn’t a good idea.</div><div><br class=""></div><div>Finally there’s whether to have a stable C++ API.  This is much tricker.  If we go this route, I would personally like us to define new stable C++ API and not just say that ConstantInt for example is now stable.  I think stable C++ API should be in its own namespace at the very least.</div><div><br class=""></div><div>Cheers</div><div>Pete<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">-- Sean Silva</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""></div><div class="">Cheers,</div><div class="">Pete</div><br class=""></div><br class="">_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu/" rel="noreferrer" target="_blank" class="">http://llvm.cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>