[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Interfacing to AppleEvents



}On Mon, 16 Jun 1997, Paul J. Schinder wrote:
}> In fact, I'd love for someone to define "scripting language".  The
}> definition would have to be pretty convoluted to exclude MacPerl, IMHO.
}
}Not at all.  To me, a scripting language is a language in which you can
}naturally specify a sequence of actions, that you would ordinarily execute
}'by hand', in a 'script'.  All Unix shells, more or less, constitute

Sounds like Perl to me.  It isn't quite as convenient as sh/AppleScript,
but it can do it.  And on a Mac, MacPerl gives me control over events that
AppleScript lacks.

}scripting languages in this sense.  Tcl, when it's embedded in an
}application, is a scripting language in this sense.  Because the Mac has
}no standard command-line interface (it's graphically oriented), these
}models have to be modified for the Mac.  There, AppleScript and Frontier
}are real scripting languages for the Macintosh because they let you
}control AppleScriptable applications in a way that's very closely tied to
}their standard gui interfaces.

And what of MacPerl::DoAppleScript, which provides the same function?  (And
as Chris points out, it's really Apple Events, not AppleScript, and MacPerl
is arguably a better AE engine than AppleScript is.)  I don't see the point
of trying to categorize like this.  I agree with Vicki Brown.  Languages
are a continuum, and the boundaries imposed between "scripting languages"
and the rest are artificial.  I would simply define a "scripting language"
as a language where the user doesn't have to run a separate compiler step
by hand, and not worry about the fuzz at the edges.  All of the scripting
languages that I've ever used give you a way to run external applications.

I personally choose a language among the ones I know well enough to use
based on the job at hand and the capabilities of the language.  I don't
much like bit-twiddling in Perl, so I use C.  C stinks for numerical
scientific work, so I use Fortran.  I'd hate to render text in C or
Fortran, so I use Perl.  I can knock out a plot with PGPerl much faster
than I can write the same plot in Fortran using PGPlot.  It's not that that
languages I don't choose can't do the job, but it's simply not as
convenient, and will take longer.  So it is with MacPerl and running Mac
apps.  It's not as convienient, but it can certainly do it.

}
}Under this definition, MacPerl is no more a scripting language than C is.
}You can just as easily concoct a "DoAppleScript" function in C as in
}MacPerl.  In both cases it's just as foreign to the basic language.
}Contrast this with Unix shells and Tcl.  To me, Perl is an very nice
}high-level programmining language, but I don't get any extra thrills by
}trying to pretend it's a useful scripting language for the Mac.

But it *is* a useful scripting langauge, even with your definition of
scripting.  That's the point.  Sure, using MacPerl::DoAppleScript isn't
quite as convenient as using AppleScript itself, but it can (I have) used
it to help perform useful tasks, tasks that I would never try to do in
AppleScript alone.

}
}This definition isn't convoluted at all.  As far as I can see, any less
}rigid definition of "scripting" would be so inclusive as to encompass all
}high-level (I'm just trying to exclude assembly) programming languages.

Certainly.  That's why the definition isn't very useful.

}I'd love to see a concrete definition of a "scripting" language that
}included perl but excluded C.  Perl is almost a drop-in replacement for C
}for most user-level applications (that I'd write).  With Matthias' efforts
}at providing mac toolbox support, it's getting closer and closer to
}replacing C outright.
}
}Cheers,
}
}Tom
}
}PS: I'm amazed that Matthias hasn't reprimanded me for starting this
}discussion.
}
}PPS: I wouldn't call awk or sed scripting languages either.
}-------------------------------------------------------------------------
}W. Thomas Pollard                                  Schrodinger, Inc.
}pollard@schrodinger.com                       http://www.schrodinger.com/
}-------------------------------------------------------------------------


---
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@pjstoaster.pg.md.us



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch