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

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    In which language was the first ever C compiler written?
     
  2. Kshiteej

    Kshiteej New Member

    Joined:
    Jul 6, 2009
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    Mumbai
    Re: In which language was C compiler written | 11 Sep 2009

    C language
     
  3. Kshiteej

    Kshiteej New Member

    Joined:
    Jul 6, 2009
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    Mumbai
    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

    Joined:
    Mar 5, 2008
    Messages:
    316
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    S/w proffessional
    Location:
    Bangalore
    Re: In which language was C compiler written | 11 Sep 2009

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

    Mridula New Member

    Joined:
    Mar 5, 2008
    Messages:
    316
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    S/w proffessional
    Location:
    Bangalore
    Re: In which language was C compiler written | 11 Sep 2009

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

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

    Joined:
    May 5, 2009
    Messages:
    1,342
    Likes Received:
    55
    Trophy Points:
    0
    Occupation:
    STUDENT !
    Location:
    Orissa, INDIA
    Home Page:
    http://www.crackingforfun.blogspot.com
    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

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Re: In which language was C compiler written | 11 Sep 2009

    My Apology
     
  8. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    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

    Joined:
    Jun 29, 2009
    Messages:
    1,043
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
    Comp1 is the compiler for C written in C
     
  10. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,043
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
    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

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    In the book of kernighan Ritchie its mentioned C language as well.
     
  12. SaswatPadhi

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

    Joined:
    May 5, 2009
    Messages:
    1,342
    Likes Received:
    55
    Trophy Points:
    0
    Occupation:
    STUDENT !
    Location:
    Orissa, INDIA
    Home Page:
    http://www.crackingforfun.blogspot.com
    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

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    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

    Joined:
    Jul 8, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice