Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > C compiler internals

Reply
Thread Tools

C compiler internals

 
 
Dave Vandervies
Guest
Posts: n/a
 
      05-27-2007
In article <(E-Mail Removed) .com>,
Guru Jois <(E-Mail Removed)> wrote:
>Hai,
>
> Can I get some docs or links to learn the C compiler internals
>from basic to advanced. It must contains good documentation of how
>compilers allocates memory to variables.


Take a look at the Dragon Book.

If that doesn't tell you what you're looking for, you could always
try Knuth.


dave

--
Dave Vandervies http://www.velocityreviews.com/forums/(E-Mail Removed)

Where should I turn in my certificate of infallibility?
--CBFalconer in comp.lang.c
 
Reply With Quote
 
 
 
 
Malcolm McLean
Guest
Posts: n/a
 
      05-28-2007

"Guru Jois" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hai,
>
> Can I get some docs or links to learn the C compiler internals
> from basic to advanced. It must contains good documentation of how
> compilers allocates memory to variables.
>

If want the very basics about how to get into the compiler construction
game, read my book MiniBasic - how to write a script interpreter. It is an
interpreted rather than a compiled language, but the principles of variable
usage are similar, however interpreters are easier to write and understand
than compilers. It is only $2.50.

If you already know how to write a Basic, try the dragon book by Aho, Sethi
and Ullman. This is a much more advanced text.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

 
Reply With Quote
 
 
 
 
Guru Jois
Guest
Posts: n/a
 
      05-28-2007
On May 27, 11:46 pm, Barry Schwarz <(E-Mail Removed)> wrote:
> On 27 May 2007 04:52:52 -0700, Guru Jois <(E-Mail Removed)> wrote:
>
> >Hai,

>
> > Can I get some docs or links to learn the C compiler internals
> >from basic to advanced. It must contains good documentation of how
> >compilers allocates memory to variables.

>
> Your posts indicate you are a relative newcomer to C and programming.
> It is much too early for you to be jumping into a topic this complex.
>
> Why do you care how one particular compiler allocates variables? It
> may have nothing to do with how your compiler does so. It may change
> completely in the next version of the compiler.
>
> At this stage in your development, you should not be writing code that
> depends on a particular allocation technique. Concentrate on the
> portable features of the standard language, which is the area this
> newsgroup deals with.
>
> Remove del for email


Yaeh, I am new to C, but I expect questions about compiler activities
in interviews. So I need docs.
Bye
Guru

 
Reply With Quote
 
Chris Hills
Guest
Posts: n/a
 
      05-28-2007
In article <(E-Mail Removed) .com>, Guru
Jois <(E-Mail Removed)> writes
>Hai,
>
> Can I get some docs or links to learn the C compiler internals
>from basic to advanced. It must contains good documentation of how
>compilers allocates memory to variables.


Hi,

Compilers are in two parts the front end parser and the target specific
back end. Where the variables are put and how the memory is allocated
will depend on the target which is handled in the back end. It won't be
the same for an 8061 as a 68000 MCU. Some turn out assembler and some
object code.

I can send you a PDF book on compiler design but no book on compiler
design goes from basic to advanced. They go from advanced to very
advanced.

Then you have the assembler and linker do contend with

also books on compiler design are standard technology. Most commercial
compilers use many proprietary tricks and techniques.

The best place to start is probably GCC. You get the source and a lot of
people know how it works internally.

I would suggest that the way you have asked the question indicates that
you probably do not have the experience to delve into compiler design
just yet unless it is just for interest. Though I expect you will find
it very heavy going..
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ (E-Mail Removed) www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



 
Reply With Quote
 
Chris Hills
Guest
Posts: n/a
 
      05-28-2007
In article <(E-Mail Removed) om>, Guru
Jois <(E-Mail Removed)> writes
>On May 27, 11:46 pm, Barry Schwarz <(E-Mail Removed)> wrote:
>> On 27 May 2007 04:52:52 -0700, Guru Jois <(E-Mail Removed)> wrote:
>>
>> >Hai,

>>
>> > Can I get some docs or links to learn the C compiler internals
>> >from basic to advanced. It must contains good documentation of how
>> >compilers allocates memory to variables.

>>
>> Your posts indicate you are a relative newcomer to C and programming.
>> It is much too early for you to be jumping into a topic this complex.
>>
>> Why do you care how one particular compiler allocates variables? It
>> may have nothing to do with how your compiler does so. It may change
>> completely in the next version of the compiler.
>>
>> At this stage in your development, you should not be writing code that
>> depends on a particular allocation technique. Concentrate on the
>> portable features of the standard language, which is the area this
>> newsgroup deals with.
>>
>> Remove del for email

>
>Yaeh, I am new to C, but I expect questions about compiler activities
>in interviews. So I need docs.
>Bye
>Guru
>


You will not get questions about compiler internals at interviews. If
you do you are applying for the wrong job.

What sort of jobs are you applying for?

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ (E-Mail Removed) www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



 
Reply With Quote
 
Chris Hills
Guest
Posts: n/a
 
      05-28-2007
In article <(E-Mail Removed) om>, Guru
Jois <(E-Mail Removed)> writes
>On May 27, 11:46 pm, Barry Schwarz <(E-Mail Removed)> wrote:
>> On 27 May 2007 04:52:52 -0700, Guru Jois <(E-Mail Removed)> wrote:
>>
>> >Hai,

>>
>> > Can I get some docs or links to learn the C compiler internals
>> >from basic to advanced. It must contains good documentation of how
>> >compilers allocates memory to variables.

>>
>> Your posts indicate you are a relative newcomer to C and programming.
>> It is much too early for you to be jumping into a topic this complex.
>>
>> Why do you care how one particular compiler allocates variables? It
>> may have nothing to do with how your compiler does so. It may change
>> completely in the next version of the compiler.
>>
>> At this stage in your development, you should not be writing code that
>> depends on a particular allocation technique. Concentrate on the
>> portable features of the standard language, which is the area this
>> newsgroup deals with.
>>
>> Remove del for email

>
>Yaeh, I am new to C,


The missing lines are:-

"I am Master of Computer Application graduate and currently studying
"Advanced C and Unix" course in Uttara, Bangalore, India."

>but I expect questions about compiler activities
>in interviews. So I need docs.
>Bye
>Guru
>


--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ (E-Mail Removed) www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



 
Reply With Quote
 
David Wade
Guest
Posts: n/a
 
      05-28-2007

"Guru Jois" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> On May 27, 11:46 pm, Barry Schwarz <(E-Mail Removed)> wrote:
> > On 27 May 2007 04:52:52 -0700, Guru Jois <(E-Mail Removed)> wrote:
> >
> > >Hai,

> >
> > > Can I get some docs or links to learn the C compiler internals
> > >from basic to advanced. It must contains good documentation of how
> > >compilers allocates memory to variables.

> >
> > Your posts indicate you are a relative newcomer to C and programming.
> > It is much too early for you to be jumping into a topic this complex.
> >
> > Why do you care how one particular compiler allocates variables? It
> > may have nothing to do with how your compiler does so. It may change
> > completely in the next version of the compiler.
> >
> > At this stage in your development, you should not be writing code that
> > depends on a particular allocation technique. Concentrate on the
> > portable features of the standard language, which is the area this
> > newsgroup deals with.
> >
> > Remove del for email

>
> Yaeh, I am new to C, but I expect questions about compiler activities
> in interviews. So I need docs.
> Bye
> Guru
>


If you want to prepare for an interview have a look through the archived
copy of this newsgroup at groups.google.com. I would start by searching for
threads that contain "undefined behaviour". Most other documentation
concentrates on "how to do" something. These topics will help you understand
why some things don't work, and also how the compiler works...

I am pretty sure the information in here is more enlightening than any crib
sheet,,,,


 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      05-28-2007
"David Wade" <(E-Mail Removed)> writes:
[...]
> If you want to prepare for an interview have a look through the archived
> copy of this newsgroup at groups.google.com. I would start by searching for
> threads that contain "undefined behaviour". Most other documentation
> concentrates on "how to do" something. These topics will help you understand
> why some things don't work, and also how the compiler works...


You may need to search for both "undefined behaviour" and "undefined
behavior" (UK vs. US spelling); I'm not sure whether Google is smart
enough to translate automatically. It's sometimes also referred to as
"UB".

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      05-28-2007
In article <(E-Mail Removed)>,
Keith Thompson <(E-Mail Removed)> wrote:
>"David Wade" <(E-Mail Removed)> writes:


>> If you want to prepare for an interview have a look through the archived
>> copy of this newsgroup at groups.google.com. I would start by searching for
>> threads that contain "undefined behaviour".


>You may need to search for both "undefined behaviour" and "undefined
>behavior" (UK vs. US spelling); I'm not sure whether Google is smart
>enough to translate automatically. It's sometimes also referred to as
>"UB".


Search also for nasal and demons (or daemons)
--
Programming is what happens while you're busy making other plans.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.Net VC++ Java C++ Windows Internals Unix Internals Jobs Gooogle Java 2 05-11-2007 02:23 PM
.Net VC++ Java C++ Windows Internals Unix Internals Jobs Gooogle C++ 1 05-10-2007 06:53 PM
.Net VC++ Java C++ Windows Internals Unix Internals Jobs Gooogle C Programming 0 05-10-2007 06:39 PM
.Net VC++ Java C++ Windows Internals Unix Internals Jobs Gooogle Javascript 0 05-10-2007 06:38 PM
Good book on the asp.net internals? Abhishek Srivastava ASP .Net 2 04-21-2004 04:52 PM



Advertisments