15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

86<br />

Choosing a Compiler<br />

• By creating front-ends <strong>for</strong> different languages, programmers can<br />

make the GCC compiler compile more <strong>programming</strong> languages.<br />

✦ The back-end of the compiler finishes translating the intermediate code<br />

into actual machine code.<br />

Evaluating the technical features of a compiler<br />

After you choose a particular <strong>programming</strong> language and pick which operating<br />

systems you want your programs to run on, your list of compiler choices<br />

is likely narrowed down to one or two choices. Given two compilers that<br />

both meet your needs, you can pick the “best” compiler by examining their<br />

technical features.<br />

The technical features of a compiler are meaningless if<br />

✦ The compiler stops being developed and supported.<br />

✦ The compiler can’t run under the operating system or processor you<br />

need in the future.<br />

✦ A particular technical feature is something you don’t need or care about.<br />

Supported language standards<br />

No two compilers are alike, even those that compile the same <strong>programming</strong><br />

language, such as C++. The problem is that every <strong>programming</strong> language has<br />

an official “standard,” but the standard <strong>for</strong> most <strong>programming</strong> languages is<br />

usually far behind what people in the real world are actually using. (By the time<br />

an official standards committee agrees on the features of a given <strong>programming</strong><br />

language, programmers have already created new features that eventually<br />

become standards in future versions of that language.)<br />

As a result, most compilers support a given language standard plus additional<br />

features that programmers have developed. There<strong>for</strong>e, every compiler<br />

actually works with a different dialect of a <strong>programming</strong> language. So C++<br />

programs that run under the Microsoft Visual C++ compiler may or may not<br />

run the same when compiled under the GCC compiler, even though both<br />

compilers claim to support the “standard” C++ <strong>programming</strong> language.<br />

Language standards are nice but generally useless when comparing compilers.<br />

What’s more important is whether a particular compiler offers the specific<br />

features you need or want, regardless of whatever particular standard it may<br />

follow.<br />

Code generation and optimization<br />

Every compiler converts source code into machine language, but some compilers<br />

can translate source code into more efficient machine language commands

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!