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,da047bd41d707e54 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!l33g2000pri.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: networking support? Date: Fri, 19 Dec 2008 13:49:27 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <494a17a9$0$30226$9b4e6d93@newsspool1.arcor-online.net> <494a4655$0$30220$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: 62.21.85.17 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1229723367 12664 127.0.0.1 (19 Dec 2008 21:49:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 19 Dec 2008 21:49:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l33g2000pri.googlegroups.com; posting-host=62.21.85.17; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3049 Date: 2008-12-19T13:49:27-08:00 List-Id: On 18 Gru, 13:47, Georg Bauhaus wrote: > How would your program benefit from first wrapping system > functions (that use C conventions) in C++ classes only for > having to match Ada's O-O types and C++'s O-O types in > a second step? > Seems like an artificial setup to me. Except that a lot of things in the C world (especially in the system APIs) are defined in header files as preprocessor constants, optional or even unofficial structure fields or field order within a struct - all this means that the binary layout of data structures is a big question mark. This problem is particularly notorious with network services. There is no way to reasonably interface with all this mess from Ada and having a wrapper layer that fixes some of this optional/unofficial/ ordering stuff for the Ada part is a valid option. Now the question is how thick this adapter layer should be - and here a layer that does a bit of lifetime management or error reporting in addition to just parameter passing is also a valid solution. Then you might discover that all the work that is done in this adapting layer can be reused in C++ projects as well (it is a low- hanging fruit, so why not benefit from it?) and you end up with a regular C++ library that encapsulates some system services and is used from the Ada program. There is nothing artifical in it - it starts with a fundamental feasibility issues and ends up with simple economy. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada