Compiler Design... Anyone That Can Help! Please!

Hi,

I am looking to make a compiler… I know about virtual machines and all and i like the idea behind it all but I want to make a true compiler… It really compiler the high-level code into low-level assembly code…

I really don’t have a lot of money to buy a book (I Wish I did) do you know of any ONLINE tutorials? Free ones? I know the compiler will not be the best… But I think that there is some one out there that can make a very good compiler and has taken a compiler class has made a web site showing other people how to with not going into real big detail on theory because you don’t have to 100% know theory to make a compiler it makes it easier but you dont…

Please anyone that knows of one please let me know!,
Thanks A Lot!!!,
Andrew

Church Punks! Truth Rebellion! Audio A!

I don’t know of any tutorials, but I’d suggest
googling for assembly tutorials… once you can
understand assembly, you can lookup the bytecodes,
allowing you to create your first compiler: an
assembly compiler (aka translates written assembly to
binary executable). Oh yeah, and to do that, you’ll
need to look up some about executable formats as well.

Taking a higher level language down to assembly is
trickier. You have to manage all the memory…
including that of the memory manager. No simple ‘gimme
20k of memory please’ calls allowed. Well, not without
creating the memory manager.

Then there’s taking the concepts down to a more basic
level. As a good source/reference point, try
downloading the source for gcc. It’s open source, you
know… and would let you see the source code of a
good, working compiler. Plus you can stop the
compiling of a sample program at all sorts of
different points of preprocessing to get an idea of
how gcc translates, say, a virtual function into the
basics of it’s call, which are more easily translated
into assembly from there.> Hi,

I am looking to make a compiler… I know about
virtual machines and all and i like the idea behind
it all but I want to make a true compiler… It
really compiler the high-level code into low-level
assembly code…

I really don’t have a lot of money to buy a book (I
Wish I did) do you know of any ONLINE tutorials?
Free ones? I know the compiler will not be the
best… But I think that there is some one out there
that can make a very good compiler and has taken a
compiler class has made a web site showing other
people how to with not going into real big detail on
theory because you don’t have to 100% know theory to
make a compiler it makes it easier but you dont…

Please anyone that knows of one please let me know!,
Thanks A Lot!!!,
Andrew

Church Punks! Truth Rebellion! Audio A!


Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

I am looking to make a compiler…
I really don’t have a lot of money to buy a book (I Wish I did) do you know
of any ONLINE tutorials? Free ones?

For starters try:
http://www.compilers.net
http://www.holub.com/compiler/compiler.html
http://www.southern-storm.com.au/portable_net.html (look for treecc)
http://sdcc.sourceforge.net
http://www.delorie.com/djgpp
http://www.mathcs.sjsu.edu/faculty/louden

Google for free compilers and you’ll likely find a lot more.

you don’t have to 100% know theory to make a compiler it makes it easier
but you dont…

Actually, yes, you do. Without understanding the theory, the best you can
hope to do is make a buggy, difficult to maintain, toy compiler. But hey,
that can be fun too :wink: However, if you want to make a real compiler, I’d
strongly suggest that you learn automata theory. Really well.

Hope this helps,
JeffOn Friday 26 September 2003 08:52 pm, Andrew Balmos wrote:

Can we please keep discussions that have nothing to do with SDL off the
SDL mailing list?

Thanks,
–ryan.

Andrew,

Many many years ago a gentleman by the name Jack Crenshaw wrote a very good compiler tutorial that you might find of interest called “Let’s build a compiler”. It was originally written using Pascal but another gent also made a C version of it. It’s rather dated but the concept is not. If this is your first foray into compiler design you’ll get something out of it. This link contains not only that tutorial but many other compiler references that I think you’ll find adequate.

http://www.bloodshed.net/compilers/

Don’t forget that you also have access to the source code for existing compilers should you wish to see how they did it. I’m assuming that you wish to compile to binary rather than devise some p-code system so if you are using an Intel CPU you can get the assembler specs for the actual object code directly from Intel.

To see assembly source to binary in action you could dig into an assembler projects such as gnu gas or nasm:

http://www.gnu.org/

Hope that helps…

Andrew Balmos <SDL_Newsgroup at cox.net> wrote:
Hi,

I am looking to make a compiler… I know about virtual machines and all and i like the idea behind it all but I want to make a true compiler… It really compiler the high-level code into low-level assembly code…

I really don’t have a lot of money to buy a book (I Wish I did) do you know of any ONLINE tutorials? Free ones? I know the compiler will not be the best… But I think that there is some one out there that can make a very good compiler and has taken a compiler class has made a web site showing other people how to with not going into real big detail on theory because you don’t have to 100% know theory to make a compiler it makes it easier but you dont…

Please anyone that knows of one please let me know!,
Thanks A Lot!!!,
Andrew

Church Punks! Truth Rebellion! Audio A!---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

I am looking to make a compiler

Please keep the messages on the list on-topic. If you want to reply to someone
who has sent an off-topic message, please reply directly to the poster.

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment