»» Basic-C-Compiler
Newsgroups: 
comp.compilers
From: 
beckmann@das.harvard.edu (Gary Beckmann)
Keywords: 
design
Organization: 
Compilers Central
Date: 
Fri, 9 Nov 90 11:41:59 EST
This should maybe go into alt.hack, but since I didn't do it myself 
and since I know how long it took I'm sending it to comp.compilers. 
This was not a production quality compiler. 
I introduced a friend of mine to the wonders of C a few years back. 
His company (whose name and location will remain secret--for obvious 
reasons as you read on) would not support the buying of a compiler for 
his ibm-pc clone.  All he had was basic.  So he wrote a C compiler in 
basic.  Took him seven months working on the side. 
He was dissatisfied with the performance of the compiler so he then 
proceeded to write a basic compiler in C !! (My neck still aches from 
the head-shaking I did when he informed me of his plans.)  That took 
him only three months -- he claimed that the speed was due to his 
familiarity with basic and the relative simple flavor of basic with 
which he was working. 
He was pleased with this "project" and decided to port it all to an 
Apple II which he had.  This port was never completed-- I believed he 
failed due to the radical differences in basic. 
To repeat: this was NOT a production quality compiler (I think he even 
had some restrictions on the syntax 
Hope I haven't horrified to many . . . 
					Gary Beckmann 
					beckmann@das.harvard.edu

:-)) Ich glaub' Gary erzählt hier von mir. Also hier Peter's Version:

Das ganze spielte sich in der RCA-1802/Cosmac-Zeit ab. Für den 1802 gabs als einzige "höhere" Sprache Cosmac-BASIC. Als Gary mir Kopien (!) vom K&R-Buch machte, war ich sofort begeistert von "C". Ich schrieb also wirklich einen C-Compiler in Basic (hab das Listing noch! Der Code versteckt sich auf mittlerweile unlesbaren 8"-Disketten). Was ich dazu "erfinden" mußte war v.a. wie ich in Basic einen Stack implementiere. Einen riesen Haken hatte das Projekt jedoch: Da die Kopien nicht sonderlich gut waren, erkannte ich damals nicht, was ja das urtümlich C-ische ist - die geschweiften Klammern { und } erschienen auf der Kopie als ( und ) - und so implementierte ich damals auch "mein" C ...

Das mit dem C-Basic-Compiler kann ich jedoch nicht bestätigen. Vielmehr war mein Plan, mit dem Basic-C-Compiler und einem Subset von "C" den eigentlichen SubsetC-C-Compiler zu schreiben (eine Art "bootstrapping"). Wie lang ich daran werkelte, kann ich nicht mehr genau sagen (ich hatte ja was anderes auch zu tun).

Jedenfalls war dann beim Apple ][ bereits ein BDS-C dabei. Wir bauten damals aus zwei Potentiometern übrigens etwas was man heute als "Maus" bezeichnen würde. Und ich schrieb dafür eine Art "Paint" (konnte Linienstile und Füllmuster!). Das muss so 1985/86 gewesen sein.


Ich arbeitete damals (1983) übrigens noch mit 8"-Disketten ohne Dateiverzeichnis - der C-Compiler ist auf den Spuren 0 bis 6 gespeichert. Der Linker auf Spur 8. D.h. Auf Spur 7 hätte noch etwas Platz - aber wehe das ist länger als eine Spur - dann ist der Linker überschrieben.

Impressum: Ing.DSA Peter Grobner, A-3508 Paudorf 142
Version vom 2019-03-25 20:08:24 von Peter