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,78b2880bc7e78e39 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-16 13:37:53 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!logbridge.uoregon.edu!newsfeed.stanford.edu!news.isc.org!news.gnac.net!uunet!sac.uu.net!ash.uu.net!world!bobduff From: Robert A Duff Subject: Re: RISC Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Fri, 16 Mar 2001 17:10:44 GMT References: <98qumf$5sf$1@nh.pace.co.uk> <98r4g1$7r1$1@nh.pace.co.uk> <3AB22CB2.E8A851A5@averstar.com> Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: supernews.google.com comp.lang.ada:5761 Date: 2001-03-16T17:10:44+00:00 List-Id: Tucker Taft writes: > 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. Ada 83 said that compilers don't have to support rep clauses that can't be "handled simply by the underlying hardware". It's not entirely clear what that means. Ada 95 has a whole lot of verbiage that amounts to more or less the same thing: the compiler has to support some minimal capabilities that we thought were "simple" or "reasonably efficient" on all machines. If I were designing a language from scratch, I think I would require much more, including bit fields oddly aligned, and crossing word boundaries and so forth. I don't think the "underlying hardware" is really the issue, especially in this networked era, the piece of hardware you're trying to mimic might be a different computer, or some weird peripheral device. Tucker's right: these things are hard to implement efficiently. But I think it's worth it. I really think the usefulness of Ada's rep clauses is seriously damaged by their lack of portability. If I ran the circus, all compilers would support exactly the same record layouts. There are also a lot of things that rep clauses just can't express. Eg, TCP/IP protocols often have data structures defined like "a count byte, followed by an array of sub-records" where the count gives the number of sub-records, or the number of bytes including (or not including) the count byte itself. I would like to have a language that could describe that sort of thing at a reasonably high level. - Bob