1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

In which language was C compiler written | 10 Sep 2009

Discussion in '$1 Daily Competition' started by shabbir, Sep 10, 2009.

  1. shabbir

    shabbir Administrator Staff Member

    In which language was the first ever C compiler written?
     
  2. Kshiteej

    Kshiteej New Member

    Re: In which language was C compiler written | 11 Sep 2009

    C language
     
  3. Kshiteej

    Kshiteej New Member

    Re: In which language was C compiler written | 11 Sep 2009

    BTW today's date is 10 september not 11 september. :D
     
  4. Mridula

    Mridula New Member

    Re: In which language was C compiler written | 11 Sep 2009

    First version was written in Assembly Language !!
     
  5. Mridula

    Mridula New Member

    Re: In which language was C compiler written | 11 Sep 2009

    Yes. It is 10th Sept :)
     
  6. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    Re: In which language was C compiler written | 11 Sep 2009

    I guess, the first C compiler was written in "B Language", which can be "thought of as C without types".

    The first B compiler was written in TMG

    Source :: http://plan9.bell-labs.com/who/dmr/chist.html
     
  7. shabbir

    shabbir Administrator Staff Member

    Re: In which language was C compiler written | 11 Sep 2009

    My Apology
     
  8. xpi0t0s

    xpi0t0s Mentor

    Bizarrely enough I reckon kshiteej is correct, reading carefully through http://cm.bell-labs.com/cm/cs/who/dmr/chist.html and specifically "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.' "

    It seems from this that as NB was developed further, there came a point where he decided to call the new language C:

    "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"

    So the question really hinges on whether or not the compiler itself used the type system and syntax mentioned here. If it did, then the compiler itself would have been a C compiler. So the answer is either C as kshiteej says, or it's NB, if you can't accept the mildly paradoxical view that the first C compiler was written in C.

    I guess we'd need DMR's view on the question to be certain what the correct answer is.
     
  9. naimish

    naimish New Member

    Comp1 is the compiler for C written in C
     
  10. naimish

    naimish New Member

    But I think it's obvious that the very first C compiler ever written was not written in C, but more probably in assembly language or possibly in a predate language like BCPL.
     
  11. shabbir

    shabbir Administrator Staff Member

    In the book of kernighan Ritchie its mentioned C language as well.
     
  12. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    But how can C be written in C ?? :undecided
    It must be written in a language that is a predecessor to C, but not C.

    Anyway, if you think the answer is C; I don't have anything to say :mean: -- I already mentioned the source according which it was in B.

    So, congratz Kshiteej.
     
  13. xpi0t0s

    xpi0t0s Mentor

    If the language is renamed from its original prototype name of NB meaning New B then it's entirely possible that the very first C compiler was written in C. Remember, with the now extensive differences between B and C, DMR decided it was time for a new name. So if what defines C, specifically the types etc, existed in the NB compiler at the time that NB was renamed to C, then there is no logical problem with saying that the first C compiler was written in C, because it was all originally NB/New B, and just renamed.

    Anyway as I said I think only DMR can answer this question definitively. Maybe I should ask him...
     
  14. dolphin@work

    dolphin@work New Member

    Is there any relation between yacc and C compiler? I was going through an interview of Stephen Johnson, the developer of YACC, which mentions about the involvement of Dennis Ritchie during the development of C. If anyone has any idea please share.
     

Share This Page