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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews.google.com!m36g2000hse.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: System calls - GNAT library vs. direct bindings Date: Fri, 01 Jun 2007 13:45:25 -0700 Organization: http://groups.google.com Message-ID: <1180730725.902452.161820@m36g2000hse.googlegroups.com> References: <1180623520.303981.191090@q75g2000hsh.googlegroups.com> NNTP-Posting-Host: 85.3.222.100 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1180730726 25851 127.0.0.1 (1 Jun 2007 20:45:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 1 Jun 2007 20:45:26 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: m36g2000hse.googlegroups.com; posting-host=85.3.222.100; posting-account=Ch8E9Q0AAAA7lJxCsphg7hBNIsMsP4AE Xref: g2news1.google.com comp.lang.ada:16040 Date: 2007-06-01T13:45:25-07:00 List-Id: On 1 Cze, 19:42, "Jeffrey R. Carter" wrote: > 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. That's right. > Portability is generally a good thing, even if you don't think you need > it. Please note that I was talking about targetting POSIX systems. That *is* thinking about portability! > To my mind, given the existence of a library that is portable across > compilers and platforms, such a library should be used. Yes. The point is - GNAT library is not compiler-agnostic. > 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, Yes, but... > but would add a > wrapper around it Bingo. And calling system API directly also requires a wrapper - at least for convenience. Interestingly, for funcions as simple as read/ write/listen/etc., both wrappers will have comparable complexity. Note that no matter how the wrapper is written, it isolates two parties and as such can be later used to achieve freedom from both compiler and system. So we are really comparing writing two wrappers. Same effort with same effect. -- Maciej Sobczak http://www.msobczak.com/