How to write a compiler

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Jul 2005
Posts: 19
Reputation: egoleo is an unknown quantity at this point 
Solved Threads: 0
egoleo egoleo is offline Offline
Newbie Poster

How to write a compiler

 
0
  #1
Aug 26th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,867
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 755
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: How to write a compiler

 
0
  #2
Aug 26th, 2005
>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?
New members chased away this month: 5
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 19
Reputation: egoleo is an unknown quantity at this point 
Solved Threads: 0
egoleo egoleo is offline Offline
Newbie Poster

Re: How to write a compiler

 
0
  #3
Aug 26th, 2005
yeah what i want is the operating systems.
and also some free links to get the compiler tutorials from?
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,867
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 755
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: How to write a compiler

 
0
  #4
Aug 26th, 2005
>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.
New members chased away this month: 5
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 19
Reputation: egoleo is an unknown quantity at this point 
Solved Threads: 0
egoleo egoleo is offline Offline
Newbie Poster

Re: How to write a compiler

 
0
  #5
Aug 28th, 2005
Yeah what i want to do is POSIX systems.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster
Join Date: Aug 2005
Posts: 76
Reputation: leelee is an unknown quantity at this point 
Solved Threads: 1
leelee leelee is offline Offline
Junior Poster in Training

Re: How to write a compiler

 
1
  #7
Sep 9th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: How to write a compiler

 
1
  #8
Sep 11th, 2005
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 5
Reputation: garraeth is an unknown quantity at this point 
Solved Threads: 0
garraeth garraeth is offline Offline
Newbie Poster

Re: How to write a compiler

 
0
  #9
Sep 23rd, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 3
Reputation: nidhi.juneja has a little shameless behaviour in the past 
Solved Threads: 0
nidhi.juneja nidhi.juneja is offline Offline
Newbie Poster

Re: How to write a compiler

 
-1
  #10
Oct 17th, 2008
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
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Computer Science Forum


Views: 22215 | Replies: 11
Thread Tools Search this Thread



Tag cloud for Computer Science
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC