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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac2397ce800de518 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-07 06:10:41 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!opentransit.net!kinglear.mobilixnet.dk!news1!news5.global-ip.net!195.17.59.36.MISMATCH!news3.global-ip.net!not-for-mail Message-ID: <3B98C898.99D7A1F6@eraseme.systems.saab.se> From: Peter Dulimov X-Mailer: Mozilla 4.61 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: adasockets and adatypes References: <20010904115244.24236db3.tonygair@blueyonder.co.uk> <9n2lpb$c7b$1@nh.pace.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 07 Sep 2001 15:16:08 +0200 NNTP-Posting-Host: 139.58.232.1 X-Trace: news3.global-ip.net 999868164 139.58.232.1 (Fri, 07 Sep 2001 15:09:24 MET DST) NNTP-Posting-Date: Fri, 07 Sep 2001 15:09:24 MET DST Xref: archiver1.google.com comp.lang.ada:12888 Date: 2001-09-07T15:16:08+02:00 List-Id: Getting a bit off the original topic here, but ... Is there a freely available XDR to Ada translator? I have heard of the Ada Corba effort, but being an old-fashioned kind of person I would prefer an OSF-DCE implementation for Ada (the part dealing with RPC that is). I guess linking into object files produced by compiling automatically generated C code is acceptable, but it raises the barrier to "broad general acceptance" just a little bit further. Also, what about the efficiency consideration? The compiler generally chooses the best representation that it can to get alignment right for complicated data types, and if you go specifying every bit's position, you are likely to introduce more fix-up delays. When I have done this (specifying bit patterns for socket comms with C programs etc), I have had a type defined for "on the wire" where the representation is specified, and another equivalent type for internal usage where I let the compiler choose the representation. The conversion from one type to another is the last thing that happens {before hitting | after leaving} the wire. Regards, Peter Dulimov. Ole-Hjalmar Kristensen wrote: [snip] > And don't forget that there are automated tools for doing this in C, > the most widespread is probably SUN's XDR/rpcgen, which always has > been freely available. From an XDR interface specification, rpcgen > will happily generate both server and client side subs, and indeed a > skeleton server, if you wish. As the XDR format is a wire format, > there are no problems with different compilers and endianness. rpcgen > essentially eliminated the extra manual work in writing bread and > butter client/server applications years ago. > > Of course, there is nothing stopping you from calling the generated C > stubs from Ada. > > -- > Kabelsalat ist gesund. > > Ole-Hj. Kristensen