Duane Rettig wrote: > Pascal Costanza <costa...@web.de> writes: >>I rather see it like this. Mainstream programming languages tend to do >>two things: (a) They involve some kind of static type system and other >>ways to deliberately restrict their expressive power, in order to make >>them "safer", more "reliable" and "more efficient". (b) They are >>inclined to be used for creating components, i.e. more or less >>monolotihic building blocks.
> I'd prefer not to call them Mainstream languages, but to fit the > distinction closer to their description: compile/link/load/go > languages.
Oh yes, sure - sorry for that. I meant "language that get lots of publicity these days", or something along these lines. They happen to be c/l/l/g languages.
>>In order to do some kind of reality check: How well is Common Lisp >>suited for component-oriented software?
> In article <ey3y9a1w29s....@cley.com>, Tim Bradshaw <t...@cley.com> wrote: [...]
>>I think that there isn't, and that the distinction is actually >>harmful. > > FWIW, this would also be my answer to this question. > > It's interesting how many people answered a different question from the > one I actually asked. The question many people are answering in this > thread is: "Is there a distinction between scrtiping languages and > programming languages (and if so what is it)?" But the question I posed > was "Is there a USEFUL distinction?" I think it's pretty clear that there > *are* distinctions (if nothing else, the fact that people make the > distinction is itself a distinction). But whether any of the distinctions > have practical utility is an entirely different question, one to which I > join Tim in answering with a resounding "NO!".
Well, I still like the discussion, even though we are answering the wrong questions. ;-)
I have an idea: Perhaps it's better not to talk about whether there is a useful _distinction_ between scripting languages and "ordinary" languages. In fact, scripting languages are a useful _addition_ to "ordinary" languages, if these ordinary languages happen to be c/l/l/g languages. Obviously, programmers need the kind of flexibility the additional features provide. The discussion (and the distinction) is useless in the context of Lisp because Lisp provides these features right away.
Again, perhaps this is going in the wrong direction. Today, I have asked a colleague of mine who hasn't (yet ;) adopted the Lisp mindset how he would define the term scripting languages. He said that the distinguishing feature is that a script is actually a text file. So for example, he would regard DOS batch files as scripts, and therefore the DOS command set as a scripting language.
Joe Schaefer <joe+use...@sunstarsys.com> writes: > Duane Rettig <du...@franz.com> writes:
> > Joe Schaefer <joe+use...@sunstarsys.com> writes:
> [...]
> > > To me, "scripting language" is a misnomer; I think Tim Bradshaw > > > had it right earlier in this thread when he associated > > > "scripting" to a type of *activity* instead of a particular *language*.
> > I guess it depends on how you view the term "scripting language". I've > > always viewed the "scripting" part not as a part of the identifier, but > > as a capability description.
> That makes sense.
> > > I'd roughly define a "script" as something which coordinates the > > > activities of a complex application, without playing a significant role > > > in the application's operation itself.
> > I can agree with this view, and as such, Lisp is a scripting language, > > because it can run a script.
> Yes, I see- thanks alot for cooking up a simple example. Sadly I > actually had to run the progn a few times to make sure I understood it :-)
> [...]
> > Foo and bar are compiled functions (programs - unrelated complex > > applications, if you will, for some value of complex), and the progn > > is the script. So Lisp is a scripting language (among many other > > things).
> What should I do if I wanted to run such a progn as a nightly cron > job? Can I still keep the "script" separate from the "application"?
I'm not sure what you mean by "separate". A nice aspect of Lisp is that it can be invoked once and several different applications loaded and run (including scripts) within the one process, or it can house individual applications , each in different Lisp invocations.
If you really are running cron specifically, then the script might be a Lisp invocation that talks to other Lisps through an IPC or by some other means, or else the script might start up and then load the other Lisp application(s) into the same process, or perhaps the Lisp is already started, and the cron job simply alerts the script to run via an interrupt, IPC call, or by any other means you choose.
Another way to run it is to take a Lisp-is-the-operating-system approach; the Lisp always stays running, and an application that is equivalent to cron (only written in Lisp) invokes the script, which in turn runs each application (still within the same lisp invocation).
Duane Rettig <du...@franz.com> writes: > Joe Schaefer <joe+use...@sunstarsys.com> writes:
[...]
> > What should I do if I wanted to run such a progn as a nightly cron > > job? Can I still keep the "script" separate from the "application"?
> I'm not sure what you mean by "separate".
The script and the application often follow separate, uncoordinated development tracks. I don't want to dump the script and the application into a single executable file just to run the script. I also don't want to write a shell script in order to run the lisp script.
I picked cron arbitrarily, but in retrospect that was a poor example. Something like
Michael Sullivan wrote: > I think there's a distinction
Of course there is. I use a scripting language when I script and a programming language when I program. Although since I never script, but always program, it doesn't matter, anyway...
g...@jpl.nasa.gov (Erann Gat) wrote in message <news:gat-1609021326320001@k-137-79-50-101.jpl.nasa.gov>... > The argument about whether HTML is or isn't a "programming" language > reminded me of something I've been wondering about for a while: is there a > useful distinction to be made between "programming" and "scripting" > languages? My personal opinon is that there is not, but I'd like to know > what others think.
Interesting that no one has mentioned REXX in this thread.^1 I believe that for a reasonable meaning of `scripting,' which is different from the meaning of `programming,' REXX represents the ultimate in scripting. It has a reasonably complete set of language constructs *and* the primitives of whatever environment the REXX program is running in. (If it is the `shell' (CMS), then all operating system commands are available; if it is the editor (XEDIT), then all editor commands, and so on. In fact, it is also possible to switch the environment during execution.) If I call writing in REXX `programming,' that would be for a different meaning of programming than (say) writing in C, which kind of represents the ultimate in non-scripting. _________ ^1 AppleScript was mentioned indeed, but REXX predates it significantly, and is in my opinion more powerful
It's hard to place a simple and unambiguous label on Common Lisp from the above point of view. It is a true and sophisticated programming language, and at the same time it is easy to imagine it used in the same way as REXX in a multitude of co-existing environments (in fact, wasn't it used like that in Lisp machines?). On the other hand, I cannot see C (or any Algol-like language) in REXX's role at all. But maybe Common Lisp is the exception to the rule, as another poster suggested.
By the way, the mainframe world offers another, older example: JCL is a scripting language but not a programming language, isn't it? (Please note that this is quite independent of the question if it is an awful language or not...)
I guess the simplest (and grossly simplified) rule of thumb I can think of is: if, even for the simplest executable unit in the language, some sort of enclosing syntactical delimiters are mandatory (like ``begin'' and ``end''), then it is a non-scripting language; if merely concatenating simple expressions/statements in the language produces an executable unit, then it can qualify as a scripting language. In other words, my intuitive understanding of the distinction is based at least to some extent on the syntax, specifically the minimum amount of syntax that makes a valid program or script.
* * *
More philosophically speaking, and in a different line of thought, I believe that scripting is one step off programming in the direction towards planning. What I have in mind is that the main difference between a plan and a program (or at least one of the main differences) is that a program is to be executed by a machine while a plan is to be executed by an intelligent entity. (A plan is always underspecified and does not provide courses of action for almost all of the infinitely many abnormal situations that may occur, yet its execution is expected to succeed where machine execution of a program would `produce undefined results.') Or to borrow the example quoted by Kaz Kylheku for a simple illustration,
for f in *.foo; do base=`basename $f .foo` mv $f $base.bar done
has more the scripting nature, while
for f in *.foo ; do base="$(basename -- "$f" .foo)" mv -- "$f" "$base.bar" done
has more the programming nature, as the former is less burdened with provisions against undefined results (with the advantage of making the essence of what is being done more conspicuous), at the expense of requring more intelligence by the user to avoid applying it to a situation where it may fail, or to watch for failure and possibly take corrective action.
Joe Schaefer <joe+use...@sunstarsys.com> writes: > Duane Rettig <du...@franz.com> writes:
> > Joe Schaefer <joe+use...@sunstarsys.com> writes:
> [...]
> > > What should I do if I wanted to run such a progn as a nightly cron > > > job? Can I still keep the "script" separate from the "application"?
> > I'm not sure what you mean by "separate".
> The script and the application often follow separate, uncoordinated > development tracks. I don't want to dump the script and the > application into a single executable file just to run the script. > I also don't want to write a shell script in order to run the > lisp script.
You could always separate your applications into fasl files. Then, when they are needed, just load them in. The script could be in a source file, but it's also easy enough to compile as well. This is part of the problem Lispers have of separating scripting and programming languages; we have all of it in one language!
> I picked cron arbitrarily, but in retrospect that was a poor > example. Something like
Yes. It depends on how heavyweight your lisp is (i.e. how much memory it takes and how long it takes to start). That used to be a problem, but I don't think it is anymore - most lisps start in small fractions of a second.
> Nevertheless, I'm sure you've answered the question that I should > have asked. Now I just have to figure out what that question is :-) > Thanks again.
* Erann Gat | It's interesting how many people answered a different question from the one | I actually asked. The question many people are answering in this thread is: | "Is there a distinction between scrtiping languages and programming | languages (and if so what is it)?" But the question I posed was "Is there a | USEFUL distinction?"
I believe most people would want to know what the distinctions are before they judge them useful or not. A priori usefulness tend not to exist, so the obvious answer to the question is "no" /before/ one does careful study.
-- Erik Naggum, Oslo, Norway
Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.
vnikolo...@poboxes.com (Vassil Nikolov) writes: > Or to borrow the example quoted by Kaz Kylheku for a simple > illustration,
> for f in *.foo; do > base=`basename $f .foo` > mv $f $base.bar > done
> has more the scripting nature, while
> for f in *.foo ; do > base="$(basename -- "$f" .foo)" > mv -- "$f" "$base.bar" > done
> has more the programming nature, as the former is less burdened > with provisions against undefined results (with the advantage of > making the essence of what is being done more conspicuous), at the > expense of requring more intelligence by the user to avoid applying > it to a situation where it may fail, or to watch for failure and > possibly take corrective action.
After takin a swig o' grog, Erik Naggum <e...@naggum.no> belched out...:
> * Joe Marshall <j...@ccs.neu.edu> > | So a script is a program written by an amateur?
> Would it not be called just a "gram" then?
If you get a thousand of them, that's called a "kilogram." -- (reverse (concatenate 'string "moc.enworbbc@" "sirhc")) http://cbbrowne.com/info/languages.html "I'm sure that nobody here would dream of misusing the Arpanet. It's as unthinkable as fornication, or smoking pot." -- RMS
vnikolo...@poboxes.com (Vassil Nikolov) writes: > Interesting that no one has mentioned REXX in this thread.^1 I > believe that for a reasonable meaning of `scripting,' which is > different from the meaning of `programming,' REXX represents the > ultimate in scripting. It has a reasonably complete set of > language constructs *and* the primitives of whatever environment > the REXX program is running in. (If it is the `shell' (CMS), then > all operating system commands are available; if it is the editor > (XEDIT), then all editor commands, and so on. In fact, it is also > possible to switch the environment during execution.) If I call > writing in REXX `programming,' that would be for a different > meaning of programming than (say) writing in C, which kind of > represents the ultimate in non-scripting.
Now that's a blast from the past. In fact, in VM/CMS your application could define its own environment and then load in REXX scripts that used this environment.
ObCL: it's 'procedure ... expose' parameter passing gives you the same choice between lexical and dynamic scope as CL.
-- Hai koe, zei de stier, Kom mee met mij in de wei, Dan zijn we tweezaam. Lieven Marchand <m...@wyrd.be>
> > Or to borrow the example quoted by Kaz Kylheku for a simple > > illustration,
> > for f in *.foo; do > > base=`basename $f .foo` > > mv $f $base.bar > > done
> > has more the scripting nature, while
> > for f in *.foo ; do > > base="$(basename -- "$f" .foo)" > > mv -- "$f" "$base.bar" > > done
> > has more the programming nature, as the former is less burdened > > with provisions against undefined results (with the advantage of > > making the essence of what is being done more conspicuous), at the > > expense of requring more intelligence by the user to avoid applying > > it to a situation where it may fail, or to watch for failure and > > possibly take corrective action.
> So a script is a program written by an amateur?
I would say a script is lighter than a program. And I have seen programs written by amateurs (or alleged professionals) that were pretty heavy, only in the wrong way...
Erik Naggum <e...@naggum.no> wrote in message <news:3241534508231613@naggum.no>... > * Joe Marshall <j...@ccs.neu.edu> > | So a script is a program written by an amateur?
vnikolo...@poboxes.com (Vassil Nikolov) writes: > Joe Marshall <j...@ccs.neu.edu> wrote in message <news:ptv8u7mk.fsf@ccs.neu.edu>... > > vnikolo...@poboxes.com (Vassil Nikolov) writes:
> > > Or to borrow the example quoted by Kaz Kylheku for a simple > > > illustration,
> > > for f in *.foo; do > > > base=`basename $f .foo` > > > mv $f $base.bar > > > done
> > > has more the scripting nature, while
> > > for f in *.foo ; do > > > base="$(basename -- "$f" .foo)" > > > mv -- "$f" "$base.bar" > > > done
> > > has more the programming nature, as the former is less burdened > > > with provisions against undefined results (with the advantage of > > > making the essence of what is being done more conspicuous), at the > > > expense of requring more intelligence by the user to avoid applying > > > it to a situation where it may fail, or to watch for failure and > > > possibly take corrective action.
> > So a script is a program written by an amateur?
> I would say a script is lighter than a program. And I have seen > programs written by amateurs (or alleged professionals) that were > pretty heavy, only in the wrong way...
Between the two examples above, I'm not sure I see a difference in `weight', only a difference in rigor. The first program is very sloppy with regard to quoting while the second is not.