2009/3/20 Raul Miller <[email protected]>: > On Fri, Mar 20, 2009 at 10:41 AM, Boyko Bantchev <[email protected]> wrote: >> I did not include the Unix family of sh-like languages, because >> they cannot be used the way REXX can be, and is being used. >> REXX comes with an API, through which one can call script chunks >> from within a compiled program and pass data between the script >> and the program. > > Well... where explicit support of certain coroutine functionality > is critical, then I agree that rexx scripts can be cleaner than > shell scripts. However, I am reluctant to equate a specific > coroutine implementation with "o.s. command (shell) language, > and a system-scripting-and-integration language" > > Also, anything sort of integration work you can do with > coroutines you can also do without coroutines: Any data > which needs to be passed can be passed in files. And > processing which needs to occur can occur in newly spawned > processes. If this is a problem then it is a problem introduced > by the os. > > Also, you can use pipes (named or not), when they are > convenient. In many cases this is good enough. > >> Also, most Unix shells are not full-featured languages (lacking, >> e.g., f.p. arithmetic). REXX is. > > Shell scripts routinely delegate such tasks to spawned > processes, and /bin/sh has rich support for spawning > various kinds of processes. For example, > > :|awk 'END{print 1.2+2.3}' > 3.5 > > This of course is crude, but /bin/sh was designed > to integrate a system with a standard set of system > utilities available for its use. This seems to me to > be a good design in the context of a systems > integration language.
The point is that sh is a commmand-line interpreter (a job control language), but not an extension language. It doesn't do scripting in the sense of extending a compiled program. REXX is both a c.l. interpreter and a scripting language in this sense. And as sh was designed as (only) a c.l. interpreter, it lacks features that would have made it a programming language per se; so in this respect, too, it is inferior to REXX. Spawning a process to compute a single value just because it happens to be non-integer, and then communicating this value through a pipe or a file to another process is a replacement to true scripting only in the sense in which all computers are Turing machines and all programming languages are the same. Were it not so, there would be no point in creating and using Tcl, Perl etc., and game programmers would have used sh and piping where they really use, e.g., Lua. That aside, I don't believe the word ‘coroutine’, as used above, is in place here. The interaction between a (compiled) program and a script chunk does not necessarily possess the symmetricity characteristic of coroutines. Besides, the term ‘coroutine’ is normally used to designate a feature of a certain programming language, such as e.g. Simula, Icon or Lua, and does not extend to, say, communication between processes or programs within an operating system. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
