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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: System calls - GNAT library vs. direct bindings Reply-To: anon@anon.org (anon) References: <1180623520.303981.191090@q75g2000hsh.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Fri, 01 Jun 2007 06:59:54 GMT NNTP-Posting-Host: 12.65.78.145 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1180681194 12.65.78.145 (Fri, 01 Jun 2007 06:59:54 GMT) NNTP-Posting-Date: Fri, 01 Jun 2007 06:59:54 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:16012 Date: 2007-06-01T06:59:54+00:00 List-Id: In <1180623520.303981.191090@q75g2000hsh.googlegroups.com>, Maciej Sobczak writes: >Hi, > >I would like to now your opinion about the two options in the subject. > >Let's suppose that the problem is a network-aware application on the >POSIX system. Ada doesn't know about network per RM, so we have to >look around for libraries. >One option is to use the GNAT library that has some package for >sockets. >Another is to write thin wrappers that bind directly to relevant >system calls (socket, connect, read, write, close, bind, listen, >accept, select - that's it for the basic stuff). > >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. One factor is that Ada was designed for portability there if you do not care about portability then do not use Ada! >The seconds is not important neither, I will probably use only GNAT. Wrappers defeat the purpose of use Ada, so do not use them! > >In other words - the focus for evaluation should go elsewhere. >Performance? Maintainability? Some other factors? Performance -- use the OS's core language. Which normally means using C instead of writing code in Ada or using Wrappers. But as the performance of the code goes up the maintainability starts to drop. This is due to the fact that performance alorithms are normally tied to the hardware and as hardware is update the alorithms may need to be rewritten just to maintain current performance levels which increases the maintainability cost. But portability gives an average stable performance with a reduced maintainability cost. Which means that development cost may be high but installation and maintains cost afterwards for the software team is very low. Especially in this age of upgrading the hardware every 6 to 18 months. So unless one wants to spend the rest on the days updating and rewritting code to maintain that package, portability should be the highest priority.