views:

254

answers:

11

I want to go backwards and learn more about how compilers, processors and memory operate on my programs. I am also interested in the physics on which all of this depends. Any good references or books would be appreciated...

+2  A: 
Martin Beckett
That's the book I was going to suggest.
Steve Rowe
Great book. I wish I had it when I started out. Then again, not having it forced me to learn a lot on my own.
Ferruccio
+1  A: 

I don't normally think of physics and compilers at the same time.

This link might get you thinking.

duffymo
That looks very interesting!
Aaron C
+3  A: 

For compilers, the ultimate book is the Dragon Book, aka Principles of Compiler Design. It is a bit heavy going at first, but it becomes easier with each pass you make at it. It's a classic and should be read by all serious students of programming/computer science.

Travis
+1  A: 

Write a simple emulator for something like C64. By thinking of how to emulate the CPU, Memory and other Chips you will learn how these simple machines worked. Today's computers pretty much operate in the same manner with a lot more complexity but the basic idea is the same.

Your emulator doesnt have to be super fast - try and get the C64 welcome message up and if you did your code right - you should be able to POKE and write basic programs and have them work :)

10 PRINT "DONT LISTEN TO ME - APPLE //E's RULE"

20 GOTO 10

mP
+1  A: 

I would suggest learning enough assembler to be able to write a simple Hello World program in assembler.

This will teach you exactly how the CPU works at the register and memory level.

It will also give you a good introduction into how source code is converted to object files and how the linker brings together all these object files together to create a working program.

jussij
Anyone can write a Hello world program. It doesnt mean you actually understand the language it just shows you can copy some text from somewhere and run a compiler.
mP
And anyone can learn a lot by studying a program as simple as hello world, provided they are prepared to take the time to try to understand the code they are copying. I am not an assembler programmer, but I can read assembler thanks to the one or two simple hello world programs that I have written.
jussij
A: 

Pick up a book on "Computer Organization" or "Computer Architecture" on Amazon. This is what we used when I was in college. It's not too thick, and will give you the basics, from the gate level all of the way up to how memory is organized and programs are written. If, after this, you want to look deeper into the physics, then you'll want to pick up a book on semiconductor physics. (But if I were you I'd just start by looking up "logic gate", "diode", and "transistor" on wikipedia!)

Dave Markle
Anyone can read a book - it doesnt prove you understand it. A practical example such as programming something real shows you truely understand...
mP
+3  A: 

My first suggestion was going to be Code which has been suggested already. A better, but harder, book on the subject of processors is Computer Organization & Design by Hennessey & Patterson. You might look for an older edition on Amazon or Half.com. They'll be a lot cheaper and have basically the same information.

These will both teach you the basics of how a processor works, assembly language, etc. This will help you understand how your program will be interpreted and thus, what sort of performance bottlenecks might exist based on your design.

Steve Rowe
+1  A: 

Pick up any of the Hennessy & Patterson books. Computer Architecture - A Quantitative Approach or Computer Organization & Design - The Hardware Interface

scurial
A: 

If you really want to get into the physics of processors/ IC's, you need to have a solid electromagnetics/circuit analysis background. It's certainly not easy stuff, and won't really make you a better programmer. If you're really interested, borrow some books from an EE friend!

An abstraction up from that is the gate level, which programmers can usually grok since it's all about logic.

temp2290
A: 

It sounds to me like you want to get a Computer Science degree. :-)

T.E.D.
A: 

Feynman has a nice bit on the Physics of Computation:

which addresses the second part of your question.

dmckee