Was the original C compiler written in some old assembly language and now later flex and bison are used instead?
C didn't spring into being suddenly, but was created by slowly modifying the B language--which was written in itself. Therefore you might say that C was always written in itself, but at first it was just a slightly modified B.
Dennis Ritchie describes the evolution of C in The Development of the C Language. He started by making small improvements to the B language:
In 1971 I began to extend the B language by adding a character type and also rewrote its compiler to generate PDP-11 machine instructions instead of threaded code. Thus the transition from B to C was contemporaneous with the creation of a compiler capable of producing programs fast and small enough to compete with assembly language. I called the slightly-extended language NB, for `new B.'
Eventually, he made enough changes that the language deserved a new name:
After creating the type system, the associated syntax, and the compiler for the new language, I felt that it deserved a new name; NB seemed insufficiently distinctive. I decided to follow the single-letter style and called it C, leaving open the question whether the name represented a progression through the alphabet or through the letters in BCPL.
3So was there also a language called "A" that B was originally written in?– user5318Jul 2, 2017 at 22:30
4@cat +1 to your comment for your punny smiley. I typically don't favor the :D variation of a smiley, but in this case it was the most appropriate. Kudos.– TOOGAMJul 4, 2017 at 6:36
6@TOOGAM Oh, I appreciate your PhD thesis of a comment on why you upvoted ;) Jul 4, 2017 at 9:14
As is evident from its name, YACC (Yet Another Compiler Compiler) was not the first compiler writing aid. Its predecessor was the TMG tool.
TMG was the compiler definition tool used by Ken Thompson to write the compiler for the B language on his PDP-7 in 1970. B was the immediate ancestor of C.
tmg executable can still be seen on the UNIX V6 disks, along with
yacc. In UNIX V7, AFAIR,
tmg was already omitted.
2There were many many others besides TMG. Floyd described one in the Floyd Production Language paper around 1963; WIlliam Waite had one in the late 1960s; many others. Hence 'yet another'. Jul 4, 2017 at 1:21
2@EJP Sure, but it was specifically TMG that figured in the development lineage of the C language.– Leo B.Jul 5, 2017 at 19:23
1The original "compiler compiler" (by that name) was written by Tony Brooker and Derrick Morris in 1960. Jan 21, 2021 at 13:13
gccnormally don't use generated lexers and parsers anymore.