Lawrence D'Oliveiro
2024-05-23 04:16:57 UTC
The traditional DEC concept of a “command line” is a simple string/array
of characters. For example, you see this in the “foreign” command buffer
in VMS, which can be passed from one program to another.
VMS really wants you to use a DCL-style syntax for your command lines. It
does weird things like uppercasing text in the command buffer, except for
parts in quotes, which are left as-is, but then the quotes are also left
in place, so command-line parsers have to worry about dealing with text
that might or might not be quoted.
And also implicit in all this is that the command will be executed by
sending a request to some CLI/shell.
Compare the Unix concept of a command line: it is not a “line” at all, but
an array of strings. One program can directly execute another without
having to go through a shell: it can construct and pass this argument
array without having to worry about “special” characters that might be
(mis)interpreted by some CLI/shell intermediary -- unless you choose to go
through such an intermediary.
One might argue that DCL-style syntax is much more sophisticated than what
is supported by your typical *nix command-line program. But then again,
the sheer wealth of *nix command-line tools, compared to what is available
on VMS, shows that the *nix-style command line is far more versatile. In
*nix, most of the sophistication is delegated to the shell language that
is used to invoke these programs, while the programs themselves can
usually parse their arguments using a fairly modest amount of code, with
little or no need for some more sophisticated command-line-handling
library.
And just to add to the fun, CP/M, MS-DOS and then Windows NT all copied
the basic DEC-style command line architecture, while neglecting the
crucial part of a built-in command parser to handle more sophisticated
syntax. So Microsoft’s recent rediscovery that “the command line is cool”
remains hampered by this brain-dead underlying architecture.
of characters. For example, you see this in the “foreign” command buffer
in VMS, which can be passed from one program to another.
VMS really wants you to use a DCL-style syntax for your command lines. It
does weird things like uppercasing text in the command buffer, except for
parts in quotes, which are left as-is, but then the quotes are also left
in place, so command-line parsers have to worry about dealing with text
that might or might not be quoted.
And also implicit in all this is that the command will be executed by
sending a request to some CLI/shell.
Compare the Unix concept of a command line: it is not a “line” at all, but
an array of strings. One program can directly execute another without
having to go through a shell: it can construct and pass this argument
array without having to worry about “special” characters that might be
(mis)interpreted by some CLI/shell intermediary -- unless you choose to go
through such an intermediary.
One might argue that DCL-style syntax is much more sophisticated than what
is supported by your typical *nix command-line program. But then again,
the sheer wealth of *nix command-line tools, compared to what is available
on VMS, shows that the *nix-style command line is far more versatile. In
*nix, most of the sophistication is delegated to the shell language that
is used to invoke these programs, while the programs themselves can
usually parse their arguments using a fairly modest amount of code, with
little or no need for some more sophisticated command-line-handling
library.
And just to add to the fun, CP/M, MS-DOS and then Windows NT all copied
the basic DEC-style command line architecture, while neglecting the
crucial part of a built-in command parser to handle more sophisticated
syntax. So Microsoft’s recent rediscovery that “the command line is cool”
remains hampered by this brain-dead underlying architecture.