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,10c4f504305837f2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-13 04:32:16 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!newsfeed.stueberl.de!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Efficient Stream_IO Date: Tue, 13 Apr 2004 11:32:15 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1081855935 10728 217.17.192.37 (13 Apr 2004 11:32:15 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 13 Apr 2004 11:32:15 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:7045 Date: 2004-04-13T11:32:15+00:00 List-Id: * Stephen Leake wrote: > Lutz Donnerhacke writes: >> Is there a portable way to implement efficient IO on streams? > > Depends on how wide a range of hardware and OS you mean by "portable". Real world justification of programmer's attitute: It has to be run on a single maschine, specified by the programmer and configured as the programmer wishes. It will be an ordinary x86 based server from the shelf. The server can be used as initial development enviroment. For further developments a simiar maschine will exists. > The Ada language tries hard to be portable to no OS, hardware that has > 39 bit "bytes", hardware that has ones-complement integer arithmetic, > etc. And how will one convert from String to Stream_Element_Array? Using String'Output to a self defined, trivial Memory_Stream? I know the benefits of this approach very well. Instead of mapping a type to Storage_Element_Array or Stream_Element_Array, the 'Read and 'Write attributes vanish any alignment and representation problem. That's great and slow. > If you restrict "portable" to mean an OS with a TCP stack, and hardware > with 8 bit bytes, things are much simpler. In fact, the code you wrote is > probably portable among that set. Thank you.