| | |
How to write a compiler
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
>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?
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
>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.
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
•
•
Join Date: Aug 2005
Posts: 76
Reputation:
Solved Threads: 1
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?
"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?
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.
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.
•
•
Join Date: Sep 2005
Posts: 5
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- own programming language? (Computer Science)
- Problem with compiler (C)
- C++ is dying a slow death (C++)
- Browser's Language Interpreters (Computer Science)
- compilers in C (C++)
Other Threads in the Computer Science Forum
- Previous Thread: System flowchart
- Next Thread: How to find software dev partnerss?
Views: 22215 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for Computer Science
ai algorithm algorithms amazon assignment assignmenthelp assignments automata battery binary bittorrent bizarre bletchleypark blogging bomb business cern codebreaker compiler computers computerscience computertrackingsoftware connect conversion csc data dataanalysis dataintepretation development dissertation dissertations dissertationthesis dissertationtopic ebook employment energy extensions floatingpoint foreclosure foreclosuresoftware gadgets geeks givemetehcodez graphics hardware history homeowners homework homeworkassignment homeworkhelp humor ibm idea internet iphone ipod itcontracts laws lazy linkbait lsmeans mainframes marketing mining mobileapplication msaccess nano networking news os p2p parser piracy piratebay principles programming rasterizer sam-being-cute sas science sex simulation software spoonfeeding sql stephenfry student study supercomputer supercomputing sweden technology textfield tree turing turingtest uk virus warehouse ww2






