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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9c86eb13dd395066 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: CRC in Ada? Date: 1997/03/06 Message-ID: <1997Mar6.085946.1@eisner>#1/1 X-Deja-AN: 223535911 X-Nntp-Posting-Host: eisner.decus.org References: <1997Mar2.220652@nova.wright.edu> <1997Mar5.083233.1@eisner> <1997Mar5.131846.1@eisner> X-Nntp-Posting-User: KILGALLEN X-Trace: 857656800/27364 Organization: LJK Software Newsgroups: comp.lang.ada Date: 1997-03-06T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) writes: > In article <1997Mar5.131846.1@eisner>, > Larry Kilgallen wrote: >>In my experience it is generally C programmers who make this mistake. >>Perhaps it because many of them come from a Unix background where there >>is no strong sense of a "record". On the other hand, it may just be >>that there are so many C programmers that statistically speaking most >>of the mistakes made will be made by a C programmer. > > I still don't think it's a "mistake" to expect buffering to be done by > standard packages, rather than by every user's program. I mean, you > have to tell the thing that you're planning to read sequentially through > the file, but beyond that, the application program shouldn't have to > worry about it. If one were to espouse the Unix paridigm of "stream of bytes", it seems to me the logical representation of that is an array (at least for files less than 1 GB if you do not have 64-bit addressing). For large (compared to resources made available by the operating system) file IO mechanisms such as provided with Ada are needed. > (When I programmed on VAX/VMS, I was appalled at the complexity of the > Record Management Services. I still don't know why all that complexity > is necessary, as compared to the Unix notion that a file is a sequence > of bytes. But I could be wrong -- I write compilers, mostly, which > don't need "fancy" I/O facilities.) But there are more people writing financial software (in general) than writing compilers. I write some programs were that record stuff is crucial and some where it is skipped. > Note that Ada compilers don't typically use Text_IO to read the source > code! ;-) And typical VMS compilers (meaning those from DEC) don't use RMS to read those characters either. They map the files into their virtual address space and compile directly out of memory. (Of course they have alternate strategies for rare special cases such as compiling from a magnetic tape or compiling from the keyboard). This is perilously close to the "stream of bytes is an array" approach. But compiler writers do this with a full understanding of the performance characteristics of their environment. It is impossible to write a program which performs well on all operating systems without taking into account the varying characteristics of the operating systems. The variable block-size disks used on MVS provide a swift example where generality does not cut the mustard. Larry Kilgallen