s_dubrovich@yahoo.com wrote:   
   > ~~ other points, more broadly ~~   
   >   
   > o Small-C has structures, you will allow an array[] to qualify as a   
   primitive structure type.   
      
   No, I do not. Eqally well you can say that Unix 'cp' is C compiler,   
   just pretend that assembler is C...   
      
   > It certainly treats an array as a structure of symbol, where char sym[0..9]   
   holds a fixed length symbol name;   
   > sym[10] holds a type value, ... sym[12] holds the low byte and sym[13]    
   holds the high byte of a word sized pointer. AIR   
   > So here we have, a string, byte data, and pointer, as elements of a   
   structure, implemented as an array of char. A bit tortuous perhaps.   
   >   
   > You know, getting a HLL compiler that can compile itself, on a micro, has   
   its own allure, and 'subsets' of C was an initial solution. [*]   
      
   Going for subset is quite reasonable. But structures are absolutely   
   fundamental and need only tiny code to implement.   
      
   > [*] And, (I believe) the allure of a HLL is grant of flow control contructs   
   of {if,then,else} , {do while}, etc. ~~ which are more obscure to implement in   
   an asm program, without macro preprocessing. -- Yet there is RATFOR (Rational   
   Fortran) for    
   Fortran.   
      
   Well, first thing is artithmetic expressions (including array indexing),   
   that is basically what early Fortran was about. Than you there are   
   structures (one good thing in Cobol, copied and improved in later   
   languages). Some assemblers (IBM mainframe assember and I think   
   also MASM) have resonably good support for structures. It would   
   be silly to create "HLL" that is lower level than assemblers.   
      
   Of course, structural control statements are now also indispensable   
   part of HLL, but they came third, after expressions and structures.   
      
   > Allot of what I'm saying should be taken in historical context of the times   
   they came about, the hardware available at those times, and the solutions that   
   fit to them.   
   >   
   > o Small-C is a single pass compiler, yet other commercial products used   
   multi-pass compiling with intermediate results held in temporary files. Say a   
   first pass to collect function identifiers & their meta-data, would eliminate   
   the 'forward reference'   
    problems and the need to prototype functions in a header.h, make the   
   compiler do that.   
      
   Single pass versus multi pass is almost as old as compilers.   
   Burroughs early Algol is claimed to be single pass. Basically   
   when you want simple compiler and have enough RAM to hold   
   whole compiler + symbol table in RAM there are advantages to   
   single pass approach. You may want multiple passes for optimization   
   or to fit compiler in avaliable RAM. In ACK C there was   
   pass to eliminate unused prototypes. It was done because if   
   you include several headers symbol table may get big.   
   In ACK next pass could use much smaller symbol table,   
   freeing memory for other uses.   
      
   --   
    Waldek Hebisch   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|