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.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: pventura@cs.buffalo.edu (Philip R Ventura) Subject: Re: general-purpose vs. domain-specific programming languages Date: 1998/01/09 Message-ID: <6964ug$2hu$1@prometheus.acsu.buffalo.edu>#1/1 X-Deja-AN: 314443659 References: <98010512040396@psavax.pwfl.com> <695dja$qdc@news.ida.org> Organization: State University of New York at Buffalo/Computer Science NNTP-Posting-User: pventura Newsgroups: comp.lang.ada Date: 1998-01-09T00:00:00+00:00 List-Id: In article <695dja$qdc@news.ida.org>, David Wheeler wrote: >I use both Perl and Ada. As a programming language, I think Perl >is terrible; it's designed to make mistakes and be unreadable. Oh come on can you really say that with a straight face? Perl has its lineage in UNIX utils like sed, and awk, UNIX shells and even C. Part of the desing goals were as I mentioned previously, to replace these. As Larry Wall points out in Programming Perl, "Perl is desinged to make the easy jobs easy, without making the hard jobs impossible." Certainly I agree it can at times look cryptic, but that is a function of how regular expressions tend to be written particularly in UNIX. > >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. Again "poorer language?" I much prefer to compare the merit of a language based on how well it meets the stated design goals. After all, one could say Ada is poor because it lacks the expressiveness and power of Perl. Besides, you are free to be as disciplined as you want when you program Perl. > >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. Perl is used for lots, so are Ada, C/C++, Lisp, etc. As you say each has strengths and weaknesses, although your prior comments seem to ignore this. I decided to learn Perl because I was using lots of combinations of shell scripts with sed and awk along with other stuff all to help automate some of the grading process. But in many cases I was coming up against restraints in sed/awk or other things. I could have switched to C or Ada or something else, but why? The interface to the system isn't as clean or easy. The text-processing isn't there. At the same time I have been suitably impressed by Perl, and could see it used for full-scale applications. Perhaps not critical systems, which is where I would definitely want Ada. Blanket value judgements of languages are seldom useful or interesting. I much prefer to accept the uniqueness of them, and be eclectic. After all programming languages are there just to make it easy for us programmers to do the jobs we need to do and do it in an efficient way for the machine. So don't curse the hammer because its hard to chop down a tree with it. -- Phil Ventura phone: 645-3772 Teaching Assistant CS305 email: pventura@cs.buffalo.edu Dept. Computer Science office: Trailer B SUNY at Buffalo http://www.cs.buffalo.edu/~pventura