XPost: alt.folklore.computers   
   From: robin_listas@es.invalid   
      
   On 2026-01-05 21:35, Scott Lurndal wrote:   
   > Peter Flass writes:   
   >> On 1/3/26 01:31, The Natural Philosopher wrote:   
   >>> "The statement "Pascal has no I/O" originates from   
   >>> Brian Kernighan’s 1981 essay, "Why Pascal is Not My Favorite Programming   
   >>> Language".   
   >>>   
   >>> Kernighan argued that the original 1970 definition of Pascal was   
   >>> severely limited for systems programming because:   
   >>>   
   >>> No Low-Level Access: The language lacked a way to override its   
   >>> strict type system, making it impossible to write its own I/O systems or   
   >>> memory allocators *within the language itself*.   
   >>>   
   >>> Fixed Array Sizes: Because array size was part of the type, a   
   >>> function could not be written to handle strings or arrays of different   
   >>> lengths, complicating general-purpose file I/O.   
   >>>   
   >>> Lack of Portability: Standard Pascal’s I/O was considered   
   >>> "primitive," and any real-world use required implementation-specific   
   >>> extensions that broke portability between compilers."   
   >>>   
   >>   
   >> Actually, many systems programming languages have no I/O, the idea being   
   >> that non-OS programs call the OS to do the I/O, and the OS interacts   
   >> directly with the hardware.   
   >   
   > I did quite a bit of systems programming in VAX-11 Pascal. Digital   
   > had extended the language to include the ability to call all the standard   
   > system services directly from Pascal.   
   >   
   > [INHERIT('SYS$SHARE:STARLET'),   
   > IDENT('V03-001')]   
   >   
   > PROGRAM Users( OUTPUT );   
   >   
   > TYPE   
   > Unsigned_byte = [BYTE] 0..255;   
   > Signed_word = [WORD] -32768..+32767;   
   > Unsigned_word = [WORD] 0..65535;   
   >   
   > jpi$item = [BYTE(12)] PACKED RECORD   
   > Buffer_length: [POS(0)] Unsigned_word;   
   > Item_code: [POS(16)] Unsigned_word;   
   > Buffer_address: [POS(32),LONG,UNSAFE] UNSIGNED;   
   > Buflen_address: [POS(64),LONG,UNSAFE] UNSIGNED;   
   > END;   
   >   
      
   ...   
      
      
   They did not teach us any of that when we learnt Pascal in a vax at uni.   
   Thanks for that insight.   
      
      
   --   
   Cheers, Carlos.   
   ES🇪🇸, EU🇪🇺;   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|