Showing posts with label compiler. Show all posts
Showing posts with label compiler. Show all posts

Wednesday, December 1, 2010

STUB: TechTalk: C++ : What happens during compilation?

A) Phases of compilation:
1) compiler,
Process of compilation ,
2) linker, linking, preprocessor, preprocessing, assembler, assembling,

B) Different types of Outputs
1) object-file (.o/.obj),
library(.a/.so (Linux), .lib/.dll - Windows),
static-library (.a, .lib),
dynamic-library(.so, .dll),
name-mangling

G++:
shared-object-file, --save-temps

VC++:
release/debug,
multi/single threaded,
dll,
importlibrary,
.defs file,
export/import symbols

Wednesday, July 11, 2007

BookReview: Object Oriented Analysis and Design with Applications (Second Edition) by Grady Booch

THE book which opened my eyes to design, types, interfaces using OOPS/OOAD.
Till then C++ meant coding.

This book introduced how to model what you can imagine into code. Configurable, flexible, orthogonal....

The design of the book with each chapter starting with different quotations and interspersed with meaningful dry humour cartoons makes this a memorable book.

Thank you Grady Booch.

BookReview: Inside the C++ Object Model by Stanley Lippman

One of the Best books on C++ internals/under-the-hood.

NOTE: The author was hired by Microsoft as Architect to clean up its extremely non-standard/buggy VC++ compiler to conform to the C++ Standard.

0) The original Cfront preprocessor/compiler converted C++ into C.
That means that almost every C++ code "could" be converted into C.
Note: Modern C++ compilers no longer convert to C, but it helps to make the compilation process more easy to understand. This book connects the dots.
1) Virtual tables/functions turn into simple function pointer table lookups.
Simple data structures show how this is implemented in different compilers.
2) Generated functions like default constructors etc. finally start to make sense.
3) Inheritance starts looking more like compiler controlled composition of objects.
4) Gives you X-Ray vision right from compiler data-structures to actual assembly code.

5) Watch out for the typos and the mismatch between some of the diagrams and the explanation.

You start seeing the source code "through the compiler's eyes". A lot of work from the compiler goes into making your Object-oriented code run.

A Must have book for any person wanting to really know how the compiler works with C++.