INTL 3:770/1 3:770/3   
   REPLYADDR tnp@invalid.invalid   
   REPLYTO 3:770/3.0 UUCP   
   MSGID: bc0e99f3   
   REPLY: 5adde74c   
   PID: SoupGate-Win32 v1.05   
   On 30/12/2023 21:02, Björn Lundin wrote:   
   > On 2023-12-30 21:19, Richard Kettlewell wrote:   
   >> Björn Lundin writes:   
   >>> The Natural Philosopher wrote:   
   >>>   
   >>>> To people like me who migrated from assembler to C, it was heaven.   
   >>>   
   >>> And the intention of the language. To be portable assembler.   
   >>   
   >> I’m not sure that’s born out by the history (e.g. [1]).   
   >   
   > Hmm, me surprised and some googling later, I see that.   
   > I've heard a lot of times about c was created because   
   > they (K&R) wanted to write a portable OS to one of   
   > the early PDPs, instead of rewriting it in assembler for that particular   
   > CPU. But it seems to be an urban legend.   
   > I stand corrected   
   >   
   >   
   IIRC they needed a language that was better than assembler to write   
   their new OS in.   
   So being primarily an engineer and a comp sci, they threw it together   
   based on previous languages like ALGOL, B, and BCPL.   
      
   And you should remember the distinction between C as syntax, and the   
   standard libraries it had.   
      
   Malloc() and free[() are arguably NOT part of the C language, but its   
   standard implementation.   
      
   Certainly in my case programming 8 and 16 bit micros, they didn't come   
   with the compilers! Nor did any file I/O.   
      
   I think stdlib was all we got. String handling mainly. And possibly   
   floating point but on a 6809? Seriously?   
      
   On those platforms it WAS simply a fast way to write assembler. They   
   didn't have a whole lot of registers, and if I/O was memory mapped. I/O   
   calls were simple pointer dereferences.   
      
   At that level as far as I was concerned I could wrote e.g. bios code   
   about 4-10 times faster than assembler in a far more readable fashion   
   with almost no performance overheads.   
      
   If (weather==wet) take(umbrella);   
      
   is, in the assembler of then, a huge series of memory accesses and   
   compare and jump instructions which don't make the idea of what the   
   program is trying to do, any clearer at all.   
      
   In fact in general I would write two lines of comments for every line of   
   assembler.   
      
   They only time you needed assembler was in handling Intel style I/O and   
   probably some interrupt service routines, or writing things like context   
   switchers where you had to mess around with the stack pointers   
      
   Now at that level, we didn't need to be reminded of the fact that we   
   were dealing with hardware, not some compscis wet dream of a Turing   
   machine abstraction. Stomp on some other routines memory and it will   
   bite you in the bum. Stomp on the stack and all bets are off.   
      
   So we took extreme care not to.   
      
   The problem was really that C was *so* good, that people did start to   
   write hugely complex stuff in it, and using people who wouldn't know a   
   register or a stack pointer if it poked them in the eye or how DMA   
   worked...to write them.   
      
      
      
      
   --   
   How fortunate for governments that the people they administer don't think.   
      
   Adolf Hitler   
      
   --- SoupGate-Win32 v1.05   
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)   
   SEEN-BY: 15/0 90/1 105/81 106/201 128/260 129/305 135/225 153/757   
   SEEN-BY: 153/7715 218/700 840 220/70 221/1 6 242 360 226/17 30 100   
   SEEN-BY: 227/114 229/110 112 113 200 206 307 317 400 426 428 452 470   
   SEEN-BY: 229/550 616 664 700 230/0 266/512 267/800 280/5003 282/1038   
   SEEN-BY: 291/111 292/854 8125 301/1 310/31 320/219 322/757 335/364   
   SEEN-BY: 341/66 342/200 396/45 410/9 423/81 460/58 633/280 712/848   
   SEEN-BY: 770/1 3 100 330 340 772/210 220 230 5020/400 5058/104 5075/35   
   PATH: 770/3 1 218/840 221/6 1 292/854 229/426   
      
|