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).
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).
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
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
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
Oh, that's pretty cool actually. I should write one in C++. I am not really very scary.
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.
I know some books that talk about the C++ object model.
Inside the C++ Object Model
Design & Evolution of C++
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)
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.
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 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.
Shadow are you talking about actually making a compiler?Originally posted by Shadow12345
Oh, that's pretty cool actually. I should write one in C++. I am not really very scary.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
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?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.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
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.
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
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.
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.Originally posted by FillYourBrain
dos is a virtual environment but you can run real dos programs in there.