I want to make a basic new peogramming language and the Compiler for it. Where I should start and how should proceed?
-
first of all, sorry if my english isn't perfect, still working on it. Now, I want to make a Compiler for a new programming language in a very basic level, and do it in C++, the problem here is that I don't know a lot about working with C++ in a low level as a Compiler works, so: 1) What I should know in C++ to achieve a full operating Compiler?, what librarys I should use?, what I should advoid? 2) I'm open to learn Python if the way to program a Compiler in pure C++ is to hard for my experience. Is possible to meld Python and C++ to ease the workload?, if that is, What should I know about Python?, what I should advoid? 3) Anything else, materials, courses to learn about Compilers, anything that you can recommend, advices, anything. I need to do it in 6 to 9 months, it doesn't need to be a full operational Compiler, but I want to do it, for myself, I know is a big challenge but I want to take the risk to do a fully operational one. I already know a couple of things, very basic stuff, so I need help, from the theory to the practice and the tools for work. So... where I should start and how I should proceed? Thanks in advance!
-
Answer:
Compilers is one of the courses which touches upon multiple engineering and mathematics topics. It takes time and expertise to build a relatively bug free compiler. That being said, you should learn the basic of compilers from the red book (http://www.amazon.com/Compilers-Principles-Techniques-Tools-Edition/dp/0321486811) and from the compilers course in coursera ( https://www.coursera.org/course/compilers). Completion of the book and the course will help you succeed building a basic compilers. Advanced compilers will require additional programming knowledge and compiler technologies.
Lokesh Amarnath at Quora Visit the source
Other answers
I would start with this 3 videos about showing how to make a parser for a very simple 'toy' language in python using the LLVM toolkit. Although it's not C++ the LLVM interfaces that he calls to actually make the executable code can also be called from C++. It should allowyou to have some sort of compiler up and running quickly.
Christopher Stern
To add to all the answers above , yes llvm approach is good but you can get the real feel of how a parsers and scanners work (concept that you will have to learn for writing your own compiler) you can use the toy language that comes as an example in the flex and bison packages. These packages are available on any Linux distribution and you can easily play around with the toy language and turn the grammar into something which you can call ur own programming language. Hope it helps!!
Kumar Aakash
Related Q & A:
- How do i delete my old profile, but not my account or ID. I just want to make a new profile?Best solution by Yahoo! Answers
- I want to start a BPO.Best solution by Yahoo! Answers
- I want to make a video from "Windows Movie Maker.Best solution by Yahoo! Answers
- I want to make a longboard, what type of wood should I make it out of.Best solution by Yahoo! Answers
- I want to make a free slide show.Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.