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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews1.google.com!not-for-mail From: kevin.cline@gmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: 23 Sep 2004 12:11:23 -0700 Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 198.23.5.11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1095966683 8446 127.0.0.1 (23 Sep 2004 19:11:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 23 Sep 2004 19:11:23 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:4036 Date: 2004-09-23T12:11:23-07:00 List-Id: Ole-Hjalmar Kristensen wrote in message news:... > >>>>> "KC" == Kevin Cline writes: > > > > >> > >> Does this prove that perl is the best language? If so, perhaps we > >> should all switch our avionics projects over to perl. Must be it will > >> be easier to code and maintain, safer to fly, and run just as fast. > > KC> It doesn't prove that Perl is the best language for every job. But > KC> the original thread was about Ada popularity. Relatively few people > KC> write avionics code, or any safety-critical software. I do think that > KC> a lot of projects currently being written in C++, Java, or C# could be > KC> done much more cheaply and effectively in Perl or a similar language. > > >> > >> The things that make a language a "good" language are many and > >> complex, and are different in different circumstances. If I need a > >> small utility that compares lines in different text files, I find perl > >> much easier than Ada. On the other hand, if I have a very large > >> project that must always perform "correctly", I've not found a > >> language that can beat Ada. > > KC> But large projects in Ada or C++ or Java or C# might be small or > KC> medium-sized projects in a higher-level language. > > Maybe. It depends on how large the projcet is, and how good you are to > create reusable components/abstractions within the project, and how > good a fit your problem is to the facilites provided by the > "higher-level" language. > > KC> If you have a project that must always perform "correctly", then you > KC> better prove it correct. Strong typing can help, but is not > KC> absolutely necessary to that effort. > > KC> For the rest of us, the most important thing is to get tested code > KC> done quickly. I don't know about you, but I can write and test 14 > KC> lines of code a whole lot faster than I can write and test 80 or 160. > > I usually find that my ability to create programs is limited by my > thought process, not my typing speed :- Mine too. For the Perl program, the thought process was limited to this: read input: while (<>) split into sequences of alphabetic characters: foreach my $word (split (/[a-zA-Z]+/)) count words: ++$count{$word} sort words by frequency: sort { $map{$a} <=> $map{$b} ) keys %count print first 10: $n = 0; foreach ( ... ) { print ...; last if ++$n >= 10; } The only bits that required much thought at all were figuring out the right comparison function for sorting (I looked at an example), and getting the loop exit right. The rest was written nearly instantaneously. Are you really claiming that you can think of: procedure Insert (Word : in String) is procedure Increment_Count (K : in String; N : in out Natural) is pragma Warnings (Off, K); begin N := N + 1; end Increment_Count; C : Wordcount_Maps.Cursor; B : Boolean; begin -- Insert Insert (M, Word, 0, C, B); Update_Element (C, Increment_Count'Access); end Insert; As quickly as I can think of: ++concordance[word] or ++$count{$word} ? Multiply this 1000 times for a medium to large program and I think Ada really suffer from unnecessary verbosity. It's reasonable to claim that Ada is better than C++ for safety-critical embedded programming, but if you really want to understand why Ada is not more popular for desktop applications I think the evidence is here. The real question I have is why Perl and similar high-level languages are not more popular.