Thread: How did they write the C and C++ languages?

  1. #1
    Shadow12345
    Guest

    How did they write the C and C++ languages?

    how did they write the C and C++ languages? Did they use other lower languages such as assembly or something? I've been wondering about how hard it would be to write your own language (and no, not just using a whole crapload of #define statements).

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    it's not like you have to compile the C/C++ language. They were sketched out as a syntax, probably on paper. Once it was finalized, a parser and compiler had to be written for the language, but the language already existed at that point.

    If I'm not mistaken, there are a bunch of C compilers that were written in C. Let that rattle around in your skull for a bit!
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Shadow12345
    Guest
    Okay I know you don't know where I live so you can't hit me: What's a parser?

    I have more posts than you, haha! I must be better

    *shrug*

    oh crap I just realized I posted where I live in my profile

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    uh.... ok.... you scare me, but let's not talk about that just now.

    parser is something that can make its way through a text file ( cpp file ) and figure out exactly what the ascii text is trying to do. It'll basically reads the code and allows the compiler to understand what you wrote.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    Shadow12345
    Guest
    Oh, that's pretty cool actually. I should write one in C++. I am not really very scary.

  6. #6
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Good question. I can see the source file being parsed, but than it has to be assembled into an object file, and then linked with the operating system dynamic libraries.

  7. #7
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    I know some books that talk about the C++ object model.


    Inside the C++ Object Model
    Design & Evolution of C++

  8. #8
    Shadow12345
    Guest
    That really does sound like an awesome idea too, but I am in another 'project' (I'm programming a human)

    who are the authors of those books, not Ivor Horton by any slight chance (Ivor is cool)

  9. #9
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    I think that you would need a special license to write a compiler for the Micrsofts OS because you would have to see the implementation of the API Win32. On Linux your ability is not limited.

  10. #10
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Originally posted by Troll_King
    Good question. I can see the source file being parsed, but than it has to be assembled into an object file, and then linked with the operating system dynamic libraries.
    ya, aside from some optimizations and such, this is all you're compiler/linker is really responsible for. A lot of people, spoiled by borland and MS, think the IDE is the compiler when in reality it's just an advanced text editor geared toward programming. Yes, it happens to have a "build" or "compile" button that activates the compiler but the environment itself is not part of the compiler. Fun huh?
    Originally posted by Shadow12345
    Oh, that's pretty cool actually. I should write one in C++. I am not really very scary.
    Shadow are you talking about actually making a compiler?
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  11. #11
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Originally posted by Troll_King
    I think that you would need a special license to write a compiler for the Micrsofts OS because you would have to see the implementation of the API Win32. On Linux your ability is not limited.
    That wouldn't stop him from making a DOS compiler that would run on windows. What you're saying applies to his supporting the Win32 API. But I'm not sure if those licensing issues exist. What does Bloodshed Dev do? Did they have a problem with that?
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  12. #12
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    They almost certainly have access to the implimentation of the Microsoft OS under a strict licensing agreement. Everything works through Win32 on the MS OS. DOS is a virtual environment.

  13. #13
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    dos is a virtual environment but you can run real dos programs in there.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  14. #14
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    It might be enough to just know Win32 though. I'm not a compiler writer. I can imagine though that there are tons of roadblocks. If Jeffery Richter (who has access to the MS source) and the MSDN library are enough, than maybe you can get by.

  15. #15
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Originally posted by FillYourBrain
    dos is a virtual environment but you can run real dos programs in there.
    It's not 100% compatible with true DOS. All of the calls are translated into Win32. Since I don't bother with Win32 I don't know all the details, maybe ask Fordy about it.

Popular pages Recent additions subscribe to a feed