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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dd4586b9dd51c602 X-Google-Attributes: gid103376,public From: wheeler@ida.org (David Wheeler) Subject: Re: general-purpose vs. domain-specific programming languages Date: 1998/01/09 Message-ID: <695dja$qdc@news.ida.org>#1/1 X-Deja-AN: 314319585 References: <98010512040396@psavax.pwfl.com> Organization: IDA, Alexandria, Virginia Reply-To: dwheeler@ida.org Newsgroups: comp.lang.ada Date: 1998-01-09T00:00:00+00:00 List-Id: Joe Gwinn (gwinn@res.ray.com) wrote: : In article <98010512040396@psavax.pwfl.com>, "Marin David Condic, : 561.796.8997, M/S 731-96" wrote: : > "Terry J. Westley" writes: : > >Here are the sorts of questions I would like such research to address: : > > Why do people use Perl so much for CGI programming? : > > Why can't I write some libraries so that Ada is just as easy to : > > use to search and replace data in text files as Perl? : > > Why is string and list handling so much easier in Tcl and Perl : > > than in Ada? : > > : [snip] : > I'd suspect that if you could come up with a list of your favorite : > Perl primitives and a description of their semantics, it would be : > possible to build an Ada package that provided equivalent : > features, perhaps by utilizing the Ada.Strings... packages as the : > underlying implementation. (Maybe you'd like to e-mail me some : > examples and we could investigate how difficult the job might be.) : > A decent specification might even gain some wider acceptance as a : > defacto standard if it was circulated widely. I use both Perl and Ada. As a programming language, I think Perl is terrible; it's designed to make mistakes and be unreadable. So, why do I use Perl when I choose to do so? The answer is listed above: it includes a large number of built-in capabilities in its libraries. In particular, it has a rich regular expression system that I find very useful (for matching, substituting with great control, and splitting). It also has capabilities for handling lists of files & option flags in the command line, associative arrays, and growable arrays. Yes, I could implement that in Ada, but it's faster to use a poorer language with already-implemented, already-tested components than a better language without them. Feel free to come up with a list of primitives and semantics, I'd love to see it. Implementing them is doable, but nontrivial. And as others have noted, each language has different strengths. Perl is usually used for short trivial programs (say <1K lines), where Ada's readability and programming-in-the-large capabilities are not as obvious. Use the tool appropriate to the job; the choice of programming language for a given task is an engineering decision. --- David A. Wheeler dwheeler@ida.org