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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:d205:: with SMTP id z5-v6mr4272817itf.35.1531581219254; Sat, 14 Jul 2018 08:13:39 -0700 (PDT) X-Received: by 2002:aca:4787:: with SMTP id u129-v6mr2052830oia.4.1531581218978; Sat, 14 Jul 2018 08:13:38 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!d7-v6no3551463itj.0!news-out.google.com!l67-v6ni3910itl.0!nntp.google.com!g2-v6no3543127itf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 14 Jul 2018 08:13:38 -0700 (PDT) In-Reply-To: <87fu0m7ak0.fsf@nightsong.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.171.111.51; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 71.171.111.51 References: <1d3743b1-1a36-429d-92c7-9ae0e7c16e63@googlegroups.com> <87fu0m7ak0.fsf@nightsong.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6febe5d6-0339-4da5-afe5-9af4e2255597@googlegroups.com> Subject: Re: Ada: A beginners experience From: Jere Injection-Date: Sat, 14 Jul 2018 15:13:39 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:53811 Date: 2018-07-14T08:13:38-07:00 List-Id: On Friday, July 13, 2018 at 11:36:51 PM UTC-4, Paul Rubin wrote: > This won't be a popular viewpoint here but IMHO Ada isn't a great choice > as a first language. It's designed to help deal with the problems of > writing and maintaining very large code bases. But there is a lot of > overhead in the features it supplies for that. > I know you probably know all this (you have a lot of experience), but for the benefit of new folks, I wanted to get a bit more specific on this. Languages like Ada and C++ can have a lot of overhead if used like one is writing a desktop application. However, Ada (and C++) has a lot of those features at either no cost or almost no cost. I've spent a lot of time writing Ada (and C++) code for a chip with 64k flash, so I've definitely spent time deciphering what causes overhead. The type system (the big draw for me to Ada) is actually very streamlined. I've extensively used generics as well and have found almost no extra cost at all (verifying the generated assembly). Mind you, not only is this compiler specific, but it also requires you to consider how you are defining your types, variables, and functions. If the compiler can make things at compile time, that's when the cost goes drastically down. Creating things based on runtime inputs is where it can start to skyrocket if not monitored. However, there are definitely things in Ada that are costly. Tasks and Protected objects are a big one. Full exception handling capability is another. I haven't been able to get Finalization working (haven't tried hard honestly), so I cannot comment on that one. As a side note, even some runtime components can actually be better than compile time. In every practical case of my C++ projects, using dynamic dispatching was faster and smaller code size than trying to use case statements. It's not always the case, but again, that is something a developer has to keep tabs on. None of this is beginner friendly though obviously.