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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,78b2880bc7e78e39 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-16 13:55:23 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!freenix!fr.clara.net!heighliner.fr.clara.net!newsfeed.planete.net!psinet-france!psiuk-f4!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: RISC Date: Fri, 16 Mar 2001 13:33:31 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <98tmai$5q5$1@nh.pace.co.uk> References: <98qumf$5sf$1@nh.pace.co.uk> <98r4g1$7r1$1@nh.pace.co.uk> <3AB22CB2.E8A851A5@averstar.com> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 984767634 5957 136.170.200.133 (16 Mar 2001 18:33:54 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 16 Mar 2001 18:33:54 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: supernews.google.com comp.lang.ada:5769 Date: 2001-03-16T18:33:54+00:00 List-Id: I know its sometimes hard to deal with rep clauses from a compiler writer's perspective. 99.44% of the time I really don't care what the compiler does with a record and hope that the representation chosen makes for easy optimization. Its just that from the perspective of a developer with concerns for interfacing to the outside world, it becomes *really* important to be sure you get what you need. Perhaps there needs to be some kind of compromise? Typically, I am only interested in the representation clause on a record if the record is going to hold data for I/O (usually a communication path) or it represents some electronic device (registers, ports, special hardware, etc.) So mostly, I'm going to move data into it and extract data out of it. Some other structure that is not used for anything computational may be a suitable answer. For example, JOVIAL had something called a "compool" (IIRC?) that was similar to a Fortran common block. We used to get superb control over the layout of a compool. - making things span word boundaries, etc. It obviously wasn't the same as a record type and didn't have to support the semantics of an Ada record, so maybe it was easier for the compiler to support it with strange representations? If there was a similar structure in Ada - one that had limited use to spare the compiler grief - maybe this would suffice for most of the uses where representations become a big deal? type T is table Some_Field : Yadayadayada; --rep controlled similar to a record. end table ; And the only allowed operations on a table are assignments to/from fields or assignments to/from the whole structure. (No math or other stuff - just data motion) Would something like this take the burden off of the compiler writer? I'm not sure if I'd need tagged tables or not. I know I don't mind where you put the tag - as long as I can find out where the tag is so I can work around it. Does the presence of a tag and class-wide operations provide a problem? (Again assuming that all you ever have to support is assignment of data.) I'm not sure there might not be a better way - such as through some sort of pragma on record types - to ease the burden, but I know that I could live with some restrictions on the records for which I want to control representation. I just need some mechanism to guarantee I can make my memory representation match things outside of the language. Just an idea..... MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Tucker Taft" wrote in message news:3AB22CB2.E8A851A5@averstar.com... > This is my cue to pipe up with the Compiler Writer's Lament. > Rep clauses are difficult to support because every special case > makes a compiler more complicated and more buggy, and makes > optimization harder. So compilers really "want" to do everything > one way if possible, and then optimize the heck out of that.