Re: Briskets (perl)
Re: Briskets (perl)
- Subject: Re: Briskets (perl)
- From: Ric Phillips <email@hidden>
- Date: Wed, 15 May 2002 10:39:27 +1000
I think it won't hurt to run a thread about AS's 'plain English' language
model. Uninterested members of the list are free to ignore it. And I don't
see why any slagging of Apple's design philosophy should start a flame war.
The SE's (I presume) are grown men and women, who've had the satisfaction of
bringing a major technology into the world - that should up their
self-esteem enough to cope with the grizzles, and / or inspire them to yet
greater efforts. If not, that's their deal.
I think the Perl / AS comparison is really illuminating. Larry Wall, Perl's
author, is a Cognitive Scientist / Linguist (I believe), as well as a Unix
hacker, and drew a great deal on his knowledge of natural languages in
designing Perl. An apposite comment of his might be...
'It's odd, people understand instinctively that the best way for computers
to communicate with each other is for each of them to be strict in what they
emit, and liberal in what they accept. The odd thing is that people
themselves are not willing to be strict in how they speak and liberal in how
they listen.'
There is a lot of this philosophy in Perl's inner workings - especially the
way data is 'typed' through its context. The weird thing about Perl is that
once you get past the "/#(*&??><<" all over the place, it really does have a
great deal of the flexibility of a natural language - hence the slogan
'there is more than one way to do it' (and its variant 'there is more than
one way to f*** it up'). Perl 'knows' it's own insides, and that is why once
you know Perl you can do with two lines of code something that would take
pages in C.
Apple Script was obviously influenced by Apple's guiding philosophyof ease
of use - it's the programming language 'for the rest of us'. So AS is, in a
way, a kind of usability-inverse of perl - intuitive on the surface, but a
standard software-engineer's machine on the inside. AS doesn't know it's own
insides as well a Perl does. So while 'set myVariable to every <object> in
<array/container/object> whose <property> is <value>' seems very plain and
simple, it can be extremely frustrating because AS does not seem to
implement a mechanism that allows it to inspect and resolve any property of
any object it can reference and so provide a 'meaning' for that 'sentence'
in every case - even though it can understand from 'every' that the data
type of myVariable should be a list. If AS was fully implementing this
syntax it would only fail when applied to something wasn't an object - eg, a
scalar variable - or didn't have the property requested. The AS programmer
has to know, in advance, which plain-english construct can applied to which
class/object/type - and that knowledge isn't fully rule based - a good deal
of it is arbitrary.
I think the real power of AppleScript is not derived from the syntax of the
language itself, but from the Apple Events / Open Scripting Architecture it
provides the interface to.
I haven't gone into AE-OSA, but if those technologies do not enforce the
exposure of target classes, then I don't see how it would be possible to
implement a plain-English syntax that would be consistent and unambiguous
for the programmer, and not require prior arbitrary knowledge of sentence
applicability. (Though that is also a problem in real natural languages.)
I do think OSX has a good chance of being a winner for Apple - and if it is
I think we are likely to see an OSA mod from the Perl (or Python, or even
PHP) community, which would mean that AS-english would be there for the
simple small / recordable tasks, and the really clever production level
app-driving stuff would be done via a different language altogether - but
that wouldn't change OSA, and programmers would still have to examine the
inconsistent specifics of the classes and interfaces of target applications.
Ric Phillips
Faculty Web Coordinator
Faculty of Humanities and Social Sciences
Latrobe University
Room HU3 324
Phone: 9479 2792
-----------------------------------------
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.