944,193 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Aug 26th, 2005
0

How to write a compiler

Expand Post »
I want to learn how to write a compiler. Can someone help with the path, what
i need to be able to write a compiler. Any tutorial links?
And can someone help me with becoming a system programmer. What i need
and some tutorial links?
thnx.

egoleo.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
egoleo is offline Offline
19 posts
since Jul 2005
Aug 26th, 2005
1

Re: How to write a compiler

>I want to learn how to write a compiler.
Okay, you need to know the language that the compiler processes inside and out, as well as assembly for all of the machines that the compiler will be run on (assuming you're compiling to machine code, it's easiest to output assembly and then assemble it into machine code). You need to figure out the grammar for the language, then design a parsing scheme. Naturally, any decent compiler will also have extensive error checking abilities so that it can produce useful diagnostic messages. Those tasks should give you a start.

>Any tutorial links?
Not off the top of my head, but you might consider picking up the dragon book as well as something more modern for a fairly thorough introduction.

>And can someone help me with becoming a system programmer.
What system? Systems programming is a very broad category that includes operating systems, networking, and databases. We implement the tools that applications programmers use to build and run applications. So what exactly do you want to do?
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Aug 26th, 2005
0

Re: How to write a compiler

yeah what i want is the operating systems.
and also some free links to get the compiler tutorials from?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
egoleo is offline Offline
19 posts
since Jul 2005
Aug 26th, 2005
0

Re: How to write a compiler

>yeah what i want is the operating systems.
Okay, do you want to write operating systems or maintain them? Are you more interested in working on the bare metal kernel or the system control operations that are delegated away from the kernel? Do you want to work with Windows based systems or POSIX based systems? Have you considered mainframes and embedded development?

>and also some free links to get the compiler tutorials from?
...What part of "not off the top of my head" is difficult for you? If I knew of any good tutorials I would mention them, but I have yet to see a systems or compiler programming tutorial that's worth a damn. Look at the books I suggested. For systems programming, there are plenty of books out there, but Richard Stevens' books are an excellent first step for UNIX systems programming, and the various "we can write a kernel!" books focused on Linux are informative. MSDN is a good reference for Windows systems programming, but you're not likely to find any material on the kernel or other back end stuff unless you make their OS development team.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Aug 28th, 2005
0

Re: How to write a compiler

Yeah what i want to do is POSIX systems.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
egoleo is offline Offline
19 posts
since Jul 2005
Aug 31st, 2005
0

Re: How to write a compiler

Reputation Points: 19
Solved Threads: 5
Junior Poster
Stoned_coder is offline Offline
164 posts
since Jul 2005
Sep 9th, 2005
1

Re: How to write a compiler

I'm only new here, but it seems that a lot of the posts in the forum are from people who say things like:

"I want to learn how to do ray tracing in cobol on a palm pilot; I don't know anything about programming yet, and clearly I'm not able to use a search engine either, but I want to be able to complete my project by noon tomorrow".

Is this as common as it appears?
Reputation Points: 31
Solved Threads: 1
Junior Poster in Training
leelee is offline Offline
76 posts
since Aug 2005
Sep 11th, 2005
0

Re: How to write a compiler

yes, it's extremely common.
And the last few years it's getting ever worse, and seems to be coming more and more from people whose names and/or locations identify themselves as Indians.

They're basically only interested in getting a piece of paper showing themselves programmers, then cheating past a recruitment interview not much more involved than spelling out the word "computer", and then taking our jobs for their own.

But it's always been there, many kids have no idea what it takes to create software.
This is perfectly apparent from the many excuses they have for piracy, often hinging around "software costs only $1 for the CD".
They think writing something like Doom 3 or Photoshop takes a single person a few days at most, not realising it's teams of dozens or hundreds of people who need years.
And even if they did they don't know economics (never having had to pay the rent or bring in money to buy their own food and clothes) so they don't know what the cost of running such a team is.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Sep 23rd, 2005
0

Re: How to write a compiler

I wrote one back in college. My partner and I used BNF to initially describe it. From there, it was simply a matter of constructing it (we used C++ and Assembly).

Here's a good BNF tutorial: http://www.garshol.priv.no/download/text/bnf.html

It doesn't tell you everything, but it's a good starting point.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
garraeth is offline Offline
5 posts
since Sep 2005
Oct 17th, 2008
-1

Re: How to write a compiler

pls if u get this answer then PM mmmmme too <snipped email>
Last edited by Ancient Dragon; Oct 17th, 2008 at 8:11 am. Reason: snipped email
Reputation Points: 4
Solved Threads: 0
Newbie Poster
nidhi.juneja is offline Offline
3 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Computer Science Forum Timeline: how to get running time
Next Thread in Computer Science Forum Timeline: i'm new and i need same help in oracle





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC