On Wednesday, February 2, 2022 at 12:37:10 AM UTC-6, Rod Pemberton wrote:   
   > On Sun, 30 Jan 2022 20:31:21 -0800 (PST)    
   > "muta...@gmail.com" wrote:    
   >    
   > [snip]   
   > > We have to work within this natural phenomenon.   
   > That's why I keep bringing up open source code.    
   >    
   > I'm not really a fan of open source, but one    
   > needs to have plenty of tools available, and    
   > there are only so many choices out there. Most    
   > of the free stuff has migrated to open source.    
   > So, if you don't have a lot of money ...   
   > > There is a small number of people, close to 1, who have the    
   > > skills required to write a C compiler and a willingness to    
   > > release that unconditionally.    
   > >    
   > > Then there are a small number of people, possibly also    
   > > close to 1, who actually appreciate that and are willing to    
   > > use that inferior product rather than gcc/Visual C/clang.    
   > >   
   > What I've been hoping for - about a decade now - is a    
   > transpiler for C. A transpiler is a source-to-source    
   > compiler, e.g., Fortran-to-C etc.    
   >    
   > Specifically, I'd like a C-to-C compiler. The compiler    
   > would take modern C99 or C11 etc and output the code as    
   > C89 or maybe even K&R C. Ideally, a valid subset of C    
   > for C89 would be even better.    
   >    
   > It would be great if the CompCert C compiler project    
   > had this feature. Then, you could "dumb-ify" any piece    
   > of C code, so that it would bootstrap and compile with    
   > any old simple C compiler. Other projects that might    
   > be ideal for this could be LLVM or Necula's CIL or    
   > maybe even TCC. Maybe even GCC with a new machine    
   > description could work.    
   >    
   >    
   > --    
   > Is Biden up to his neck, soon to drown?   
      
   Well, for a start, there is this.. (I think you may be aware of..)   
      
   /* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises. All rights   
   reserved. */   
      
   /*$Id: ansi2knr.c,v 1.14 1999/04/13 14:44:33 meyering Exp $*/   
   /* Convert ANSI C function definitions to K&R ("traditional C") syntax */   
      
   /*   
   ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY   
   WARRANTY. No author or distributor accepts responsibility to anyone for the   
   consequences of using it or for whether it serves any particular purpose or   
   works at all, unless he says so in writing. Refer to the GNU General Public   
   License (the "GPL") for full details.   
      
   Everyone is granted permission to copy, modify and redistribute ansi2knr,   
   but only under the conditions described in the GPL. A copy of this license   
   is supposed to have been given to you along with ansi2knr so you can know   
   your rights and responsibilities. It should be in a file named COPYLEFT,   
   or, if there is no file named COPYLEFT, a file named COPYING. Among other   
   things, the copyright notice and this notice must be preserved on all   
   copies.   
      
   We explicitly state here what we believe is already implied by the GPL: if   
   the ansi2knr program is distributed as a separate set of sources and a   
   separate executable file which are aggregated on a storage medium together   
   with another program, this in itself does not bring the other program under   
   the GPL, nor does the mere fact that such a program or the procedures for   
   constructing it invoke the ansi2knr executable bring any other part of the   
   program under the GPL.   
   */   
      
      
   ~~ other points, more broadly ~~   
      
   o Small-C has structures, you will allow an array[] to qualify as a   
   primitive structure type.   
   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. [*]   
      
   o In the 8080/8086 world the pointer & int are treated as the same type in   
   Small-C, ah because they are ~~ until you choose to deal with 'far pointers'   
   of segment:offset.   
      
   [*] 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.   
   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.   
      
      
   Steve   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|