Click here to Skip to main content
15,902,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Compilers Pin
Dave Kreskowiak3-Feb-23 11:32
mveDave Kreskowiak3-Feb-23 11:32 
GeneralRe: Compilers Pin
trønderen3-Feb-23 12:40
trønderen3-Feb-23 12:40 
AnswerRe: Compilers Pin
trønderen2-Feb-23 13:54
trønderen2-Feb-23 13:54 
GeneralRe: Compilers Pin
Calin Negru2-Feb-23 22:27
Calin Negru2-Feb-23 22:27 
GeneralRe: Compilers Pin
Richard MacCutchan2-Feb-23 23:16
mveRichard MacCutchan2-Feb-23 23:16 
GeneralRe: Compilers Pin
Calin Negru4-Feb-23 5:47
Calin Negru4-Feb-23 5:47 
AnswerRe: Compilers Pin
jschell3-Feb-23 5:21
jschell3-Feb-23 5:21 
AnswerRe: How it came to be. Pin
Jeremy Falcon6-Feb-23 9:11
professionalJeremy Falcon6-Feb-23 9:11 
The very short version...

In the beginning there was machine language very closely tied to the CPU. It worked with numeric opcodes that programmers has to literally memorize or look up. This got old real quick.
ML Pseudocode:
Instruction Operation
00000000 Stop Program
00000001 Turn bulb fully on
00000010 Turn bulb fully off
00000100 Dim bulb by 10%
00001000 Brighten bulb by 10%
00010000 If bulb is fully on, skip over next instruction
00100000 If bulb is fully off, skip over next instruction
01000000 Go to start of program (address 0)
Enter assembly. It's not a compiler. It's an assembler and also a linker as part of a toolset. There's a difference. A compiler will translate code into something that's a one-to-one correlation with machine instructions. Assembly is already that. It's a language that basically gave human-memorable mnemonics to the opcodes. It was originally written in machine language. It's very CPU specific too. This too got old.

There were a ton of other languages made, presumably written in ASM, but this is where a compiler kicks in. To make a really long story short, I'll just mention C's history. C was based on B and B was based on BCPL. I don't know what BCPL was written in, but the first B compiler was written in BCPL. Eventually, the B compiler was re-written in B itself and then the first C compiler was written in that version of B.

A language written its own compiler happens more than you'd think. Anyway, these are still native compilers and eventually they still make their own down to machine code. Now, things like Java and C# I suspect are still written in native languages for obvious reasons, but don't be surprised if a native language's compiler is written in the same language.

Calin Negru wrote:
a standard should be required where the numbers/machine instructions for MOV are recognized everywhere. I mean it should work like a hardware resource with the same ID present on old and new processors.
This sounds great in theory, but if you look at how bloated and not-fun the Win32 API is, if you always have to maintain backwards compatibility then you keep things bloated when attempting to advance. I mean, it's good on one level, but it's also good to wipe out the old and try something new, like Apple is doing with the M1 chips (even though nothing is every really new, but you get the idea).

Do we really want processors in 100 years having similar constraints as one designed in the 1960s? Rather than enforce that on the CPU, the industry has (correctly so) to rather have compiler targets implemented. You use your preferred language and it compiles down to whatever the CPU expects with optimizations, etc.
Jeremy Falcon

GeneralRe: How it came to be. Pin
jsc426-Feb-23 23:14
professionaljsc426-Feb-23 23:14 
GeneralRe: How it came to be. Pin
Jeremy Falcon7-Feb-23 3:25
professionalJeremy Falcon7-Feb-23 3:25 
AnswerRe: Compilers Pin
BernardIE53179-Feb-23 8:51
BernardIE53179-Feb-23 8:51 
QuestionMessage Closed Pin
1-Feb-23 14:01
Member 149687711-Feb-23 14:01 
AnswerRe: English , please.... Pin
Victor Nijegorodov1-Feb-23 20:25
Victor Nijegorodov1-Feb-23 20:25 
QuestionRe: English , please.... Pin
CPallini1-Feb-23 20:50
mveCPallini1-Feb-23 20:50 
AnswerRe: English , please.... Pin
Richard MacCutchan1-Feb-23 21:07
mveRichard MacCutchan1-Feb-23 21:07 
AnswerRe: English , please.... Pin
Calin Negru2-Feb-23 1:03
Calin Negru2-Feb-23 1:03 
AnswerRe: English , please.... Pin
Gerry Schmitz2-Feb-23 6:57
mveGerry Schmitz2-Feb-23 6:57 
GeneralRe: English , please.... Pin
Richard MacCutchan3-Feb-23 1:08
mveRichard MacCutchan3-Feb-23 1:08 
AnswerRe: English , please.... Pin
k50542-Feb-23 9:18
mvek50542-Feb-23 9:18 
QuestionClang/LLVM support in Visual Studio projects Pin
ForNow31-Jan-23 10:25
ForNow31-Jan-23 10:25 
AnswerRe: Clang/LLVM support in Visual Studio projects Pin
Dave Kreskowiak31-Jan-23 10:54
mveDave Kreskowiak31-Jan-23 10:54 
AnswerRe: Clang/LLVM support in Visual Studio projects Pin
Mircea Neacsu31-Jan-23 12:18
Mircea Neacsu31-Jan-23 12:18 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
ForNow31-Jan-23 12:44
ForNow31-Jan-23 12:44 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
Mircea Neacsu31-Jan-23 12:54
Mircea Neacsu31-Jan-23 12:54 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
ForNow31-Jan-23 12:56
ForNow31-Jan-23 12:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.