comp.lang.ada
 help / color / mirror / Atom feed
* Re: general-purpose vs. domain-specific programming languages
@ 1998-01-12  0:00 Marin David Condic, 561.796.8997, M/S 731-96
  1998-01-13  0:00 ` Robert Dewar
  0 siblings, 1 reply; 28+ messages in thread
From: Marin David Condic, 561.796.8997, M/S 731-96 @ 1998-01-12  0:00 UTC (permalink / raw)



David Wheeler <wheeler@IDA.ORG> writes:
>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.
>
    I have no problem using some esoteric language for quickie hacks
    instead of writing it out in Ada. I still do some things with DCL
    jobs - not all things worth doing are worth doing well.

    I think my point was that if there were some specific useful
    features of Perl that could be functionally duplicated in Ada, it
    might be worth having a collection like this around. I think the
    original example was to search & replace a string in a text file.
    Without implementing anything more than this, you would have a
    useful tool for Ada programmers.

    I'd hate to try to duplicate all of the functionality of Perl, or
    any other language in Ada - you'd end up trying to do some serious
    tough work which probably would satisfy no one. But individual
    capabilities might not pose this big a problem as long as one was
    not trying to duplicate the entire flavor of the language. (Ex: I
    recall some version of Basic that allowed you to do matrix math
    operations - without duplicating all of Basic, wouldn't it seem
    useful to build a package that provided this capability?
    Certainly, the Information Systems annex of the ARM was a
    reasonable attempt to steal from Cobol something Cobol did very
    well.)

>Feel free to come up with a list of primitives and semantics, I'd love
>to see it.  Implementing them is doable, but nontrivial.
>
    I don't speak Perl - I was trying to be helpful in response to
    someone else's complaint that Ada lacked features found in Perl.
    You are probably right about it being a non-trivial body of work,
    but there may be peices still worth doing.

>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.
>
    Dittos. But I still like to "extend" Ada by building utility
    software that does useful stuff - sometimes stealing from other
    languages things they do well. Sure, Lisp can do slick things with
    lists much better than off-the-shelf Ada - but you can build list
    tools in Ada and keep them in the bag of tricks, possibly avoiding
    the headaches of mixed-language programming.

    MDC

Marin David Condic, Senior Computer Engineer     Voice:     561.796.8997
Pratt & Whitney GESP, M/S 731-95, P.O.B. 109600  Fax:       561.796.4669
West Palm Beach, FL, 33410-9600                  Internet:  CONDICMA@PWFL.COM
=============================================================================
    "I filled out an application that said, 'In Case Of Emergency
    Notify'. I wrote 'Doctor'... What's my mother going to do?"
        --  Steven Wright
=============================================================================




^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: general-purpose vs. domain-specific programming languages
@ 1998-01-05  0:00 Marin David Condic, 561.796.8997, M/S 731-96
  1998-01-07  0:00 ` Joe Gwinn
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Marin David Condic, 561.796.8997, M/S 731-96 @ 1998-01-05  0:00 UTC (permalink / raw)



"Terry J. Westley" <westley@CALSPAN.COM> 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?
>
    I don't know Perl, so I can't speak to specific features. It would
    seem that even in a 'string friendly' language like Perl, you'd
    still need to specify certain things like the source file, the
    object file, the string (or meta-string?) to search for and the
    string with which to replace it. In Ada, you might build a package
    like this:

    package Perl_Like_Utilities is

        procedure Search_And_Replace (
            Source_File     : in     String ;   --  OS dependent filename.
            Object_File     : in     String ;   --  OS dependent filename.
            Search          : in     String ;
            Replace         : in     String) ;

        --  And whatever else you think you need.

    end Perl_Like_Utilities ;

    Then using Text_IO or Stream_IO and the various string
    manipulation packages, you could build up the procedures you need.
    Of course, at this point, you are acting in the same capacity as
    the Perl-primitive-implementor. The guy who had to code up the
    behavior of the Search_And_Replace primitive (whatever it is in
    Perl) had to operate by reading the file and laboriously comparing
    characters - probably in assembler. But its a job you only do
    once.

    I'll agree that the string handling packages in Ada (See "Strings
    - A.4.1" in the ARM for the description of Ada.Strings,
    Ada.Strings.Maps, Ada.Strings.Fixed, Ada.Strings.Bounded,
    Ada.Strings.Unbounded) can be confusing. They don't provide the
    utilities that *I* would have written (everybody has their own
    favorite way of doing things) but they are fairly "regular"
    ("orthogonal" is also a favorite term) and they will usually get
    the job done. As with anything else, you've got to spend the time
    to learn "The Ada Way" of doing it and not try to write Perl (or
    Snobol, or Lisp, or Basic) only with Ada syntax.

    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.

    MDC

Marin David Condic, Senior Computer Engineer     Voice:     561.796.8997
Pratt & Whitney GESP, M/S 731-96, P.O.B. 109600  Fax:       561.796.4669
West Palm Beach, FL, 33410-9600                  Internet:  CONDICMA@PWFL.COM
=============================================================================
    "Outside of a dog, a book is man's best friend; inside a dog,
    it's too dark to read..."
        --  Groucho Marx
=============================================================================




^ permalink raw reply	[flat|nested] 28+ messages in thread
[parent not found: <01bd1616$a9110b40$24326489@Westley-PC.calspan.com>]

end of thread, other threads:[~1998-01-16  0:00 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-12  0:00 general-purpose vs. domain-specific programming languages Marin David Condic, 561.796.8997, M/S 731-96
1998-01-13  0:00 ` Robert Dewar
1998-01-13  0:00   ` Brian Rogoff
1998-01-15  0:00     ` Stephen Leake
1998-01-16  0:00       ` Randal Schwartz
1998-01-16  0:00         ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1998-01-05  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-07  0:00 ` Joe Gwinn
1998-01-07  0:00   ` Robert Dewar
1998-01-08  0:00   ` Robert Munck
1998-01-09  0:00     ` nabbasi
1998-01-09  0:00       ` Philip R Ventura
1998-01-10  0:00         ` Nick Roberts
1998-01-16  0:00     ` Randal Schwartz
1998-01-16  0:00       ` Robert Dewar
1998-01-09  0:00   ` David Wheeler
1998-01-09  0:00     ` Philip R Ventura
1998-01-07  0:00 ` Brian Rogoff
1998-01-08  0:00 ` Michael F Brenner
1998-01-09  0:00   ` nabbasi
1998-01-10  0:00     ` Robert Dewar
1998-01-13  0:00       ` Thornton
1998-01-10  0:00   ` Robert Dewar
1998-01-13  0:00     ` Thornton
1998-01-13  0:00       ` Robert Dewar
1998-01-15  0:00         ` Michael F Brenner
1998-01-15  0:00           ` Robert Dewar
     [not found] <01bd1616$a9110b40$24326489@Westley-PC.calspan.com>
1997-12-31  0:00 ` Brian Rogoff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox