compilers

exabyte

New Member
From what i understand compilers are briefly what converts a user given source code into a
machine level code.
And what i understand is that this compiler is a program itself.And there should be a different
compiler for every programming language for every machine.

i have some questions here.mainly regarding compilers.

1>Since the hardware for every machine is diferent, a compiler then must
take into account the machine architecture.So how does a compiler do it?
Does the creator of the compiler manually tell the compiler about the hardware or does the
compiler itself interacts with the machine and figures out its H/W?

2>can i download copilers?
if so can i use 2 compilers for the same programming language in a machine?

3>how are compilers created?(and what kinds of programs are they?)just a basic overview please.

4>i am interested in the c language,i have heard that a lot of games are created using c/c++.
but then games use sound and graphics.What are library files that contain graphic functions?

5>can i update a compiler? is it possible to add extra functions to a library?How?

6> C is a middle level language since it has features of both a high level language and
low level languages.Does compilers work differently for different levels of abstraction
present in a language?what kind of language are used to create operating systems?

please help me out with these questions.

If possible,please answer as many questions as possible and refer to the numbering(of questions) so that
it becomes easy for me to understand.thanks.
 
Last edited:
I don't have any experience in programming, But for your first question "1)" It's not necessary for a software developer to know what hardware a computer is using, Because hardware manufactures follow standards so all software is compatible with it.

For your other questions, I suggest taking a look at this article, Or waiting till someone more experienced sees your post.

http://en.wikipedia.org/wiki/Compiler
 
1. 'Machine code' is the same for a given OS instruction set (unix x86, windows x86 etc).
2. Yes, there are a quite a few open source compilers.
3. It's complicated.
4. Most games use the DirectX library for graphics and sound. OpenGL and OpenAL are alternatives.
5. You can create your own libraries but libraries are written in c or whatever language you happen to be using, not extensions to the compilier.
6. OSes are written in different languages. Unix is written in C.
 
Back
Top