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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada Annoyances Date: Sun, 25 Jun 2017 18:43:15 -0500 Organization: JSA Research & Innovation Message-ID: References: <1ac5a44b-4423-443a-a7bb-2864d9abe78f@googlegroups.com> <4921bd4e-3827-a7ac-7f2d-d60edbc514a3@tidorum.invalid> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1498434196 25487 24.196.82.226 (25 Jun 2017 23:43:16 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sun, 25 Jun 2017 23:43:16 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:47115 Date: 2017-06-25T18:43:15-05:00 List-Id: "Niklas Holsti" wrote in message news:4921bd4e-3827-a7ac-7f2d-d60edbc514a3@tidorum.invalid... > On 17-06-23 20:49 , Randy Brukardt wrote: >> wrote in message >> news:be1619b4-2220-4287-8e67-1af32377d3f7@googlegroups.com... >> ... >>> Ada forcing tagged types on you to use certain features *is* a >>> problem, if only because certain Ada users are forbidden to >>> use tagged types altogether and thus are prevented to use a >>> lot of useful features. >> >> Stupid language usage rules are not the problem of the language design, >> they're a management problem. > > Sometimes usage rules are imposed by environment constraints, in > particular limited resources in smallish embedded systems, combined with > reliability requirements which mean that running out of resources at run > time must be avoided. > >> I can understand banning T'Class (thus banning >> dynamic dispatching) and banning controlled types (thus banning hidden >> calls >> that can be harder to analyze), but not banning tagged types themselves. ... > b) the non-static size of class-wide objects (of type T'Class), which > means that the compiler and/or the programmer must use dynamic allocation > (usually heap or secondary stack) for such objects. ... > Point (b) is more difficult and I know of no work-around that can be > applied at analysis time. Simply banning the use of T'Class has that effect. It's rather drastic, but it eliminates all of the dynamic features. Note that this was considered important enough that the standard (in Annex H) restriction No_Dispatch has this effect. You still get the other advantages of tagged types (extension, proper inheritance for private, equality, prefixed notation, etc.), and there is almost no runtime penalty (or analysis problem). Randy. .