comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic, 561.796.8997, M/S 731-96" <condicma@PWFL.COM>
Subject: Re: general-purpose vs. domain-specific programming languages
Date: 1998/01/05
Date: 1998-01-05T00:00:00+00:00	[thread overview]
Message-ID: <98010512040396@psavax.pwfl.com> (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
=============================================================================




             reply	other threads:[~1998-01-05  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-05  0:00 Marin David Condic, 561.796.8997, M/S 731-96 [this message]
1998-01-07  0:00 ` general-purpose vs. domain-specific programming languages 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
  -- strict thread matches above, loose matches on Subject: below --
1998-01-12  0:00 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
     [not found] <01bd1616$a9110b40$24326489@Westley-PC.calspan.com>
1997-12-31  0:00 ` Brian Rogoff
replies disabled

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