From: antispam@fricas.org   
      
   Lawrence D’Oliveiro wrote:   
   > On Sat, 06 Dec 2025 11:42:47 +0100, Marc Van Dyck wrote:   
   >   
   >> User written lexical functions, on the other hand, would be a real   
   >> bonus. There are, for one, still many parts of the operating system for   
   >> which you need to get information, and the only possible way to do it is   
   >> to parse some output (think of everything TCP/IP, for example), while   
   >> there is a callable interface available to get the info properly.   
   >   
   > POSIXish shells seem to feel less need for such built-in extensions.   
   >   
   > Is this a reflection on the ease of doing command substitutions in them,   
   > vis-à-vis DCL?   
   >   
   > Some newer commands in the Linux world have the option to produce output   
   > in JSON format, which also helps.   
      
   First, backwards compatibility is a powerful force blocking   
   possible improvement. I was using Sun OS and Solaris in   
   nineties. Later I looked at Solaris from 2007. In 2007   
   they shipped crappy '/bin/sh' which had exactly the same   
   problems as I remembered from my earlier use. I suspect   
   that it was bug-for-bug compatible with '/bin/sh' which   
   they shipped in 1984. And I suspect that if you get   
   current Solaris from Oracle, you will get the same crappy   
   '/bin/sh'.   
      
   The same forces that prevent improvments to '/bin/sh' work   
   for DCL, so chance of change here is very small.   
      
   Second, early Unix had relatively cheap process creation,   
   but some implementations (PDP-11 and 16-bit Xenix) had   
   thight limit on process size. So, there was preference   
   to using external commands for extentions. Unix provides   
   commands (and /proc filesystem in Linux) so that information   
   is available in textual form, meaning less need for   
   libraray API.   
      
   Third, Unix shell does not play as distingished role as   
   DCL in VMS, users can have different shells. There are   
   scripting languages and for programming shell is just   
   one of available scripting languages. Some scripting   
   languages (like Perl) give access to system calls, most   
   have FFI, so that one can call code in shared libraries.   
      
   --   
    Waldek Hebisch   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|