From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,632dbd0caea19836 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: System calls - GNAT library vs. direct bindings References: <1180623520.303981.191090@q75g2000hsh.googlegroups.com> In-Reply-To: <1180623520.303981.191090@q75g2000hsh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1180719756 12.201.97.213 (Fri, 01 Jun 2007 17:42:36 GMT) NNTP-Posting-Date: Fri, 01 Jun 2007 17:42:36 GMT Organization: AT&T ASP.att.net Date: Fri, 01 Jun 2007 17:42:36 GMT Xref: g2news1.google.com comp.lang.ada:16031 Date: 2007-06-01T17:42:36+00:00 List-Id: Maciej Sobczak wrote: > > 1. The advantage of using GNAT library is portability across various > systems that are targeted by GNAT. (I assume that the GNAT library is > available outside of POSIX - if not, please correct me.) > > 2. The advantage of writing custom thin wrappers is portability across > various compilers that target POSIX platforms. > > The first is not really important for me, I will probably use only > POSIX systems. > The seconds is not important neither, I will probably use only GNAT. > > In other words - the focus for evaluation should go elsewhere. > Performance? Maintainability? Some other factors? It's usually better to reuse something that has been widely used than to recreate the wheel. Reuse is generally less effort than creating a new library. An existing library is usually better tested and has fewer errors than a custom library. And an existing library's maintenance is generally not part of your project's maintenance effort, while a custom library's maintenance is. Portability is generally a good thing, even if you don't think you need it. Many systems that were created under the assumption that portability wasn't an issue were later ported at greater effort than would have been involved in creating them to be portable in the 1st place. To my mind, given the existence of a library that is portable across compilers and platforms, such a library should be used. In the absence of such a library, but given the existence of an existing library such as GNAT's, I'd probably choose the existing library, but would add a wrapper around it in case I need to use another compiler. Only in the absence of any existing libraries would I write my own, and I'd try to make it portable across compilers and platforms. -- Jeff Carter "Why don't you bore a hole in yourself and let the sap run out?" Horse Feathers 49