How was C++ or any language like that made

Soldato
Joined
22 Aug 2010
Posts
4,870
I know what the program is, but what I can't get my head around is how did Bjarne Stroustrup make the program. How did he tell each syntax what to do?


my head /explode
 
If i understand the question correctly, the idea is that when you write your program and hit compile, the compiler takes what you've written and 'translates' it into machine code. So if you write

int main()
{
int myinteger = 1;
..
}

Then the compiler will construct the machine code necessary to define this 'main' function and within it, put a value we interpret as '1' in a 32-bit register and move it to an allocated area 32-bits wide on the stack. Or something, for example. Rinse and repeat for the entire C++ syntax :p. That I imagine is how it was done, constructing it step by step. A lot of it was done on top of existing C syntax so some of the 'basic' groundwork was done in that respect.

Thinking a bit more, you're right it's certainly a mammoth task thinking about how much there is in C++! :D
 
Last edited:
This might give you a little more information on programming language design, but the main thing you would want to study is Compiler design for how to create programming languages. People often fear these courses at University. Lets Build a Compiler
 
Back
Top Bottom