Sign in to follow this  
gamechampionx

Compiler Project

Recommended Posts

gamechampionx    140
I started a compiler project last fall, with the purpose of manually writing a compiler for a procedural language which was self-invented. It's about 80% complete, and I'm wondering if anyone would have any interest in seeing the finished product. I'm unsure as to whether I plan on finishing it.

Share this post


Link to post
Share on other sites
tstrimp    1798
Why would anyone use it when there is so many others already out there that have much better documentation and an established community? What do you offer that is better then other languages of it's kind?

Share this post


Link to post
Share on other sites
CTar    1134
Quote:
Original post by gamechampionx
Probably nothing.

Just the fact that I sat down and wrote the whole thing witout the use of a compiler compiler or any such tools.


If you can't find a single way in which your language is better than existing languages, then people probably won't use it. What tools you chose to write the compiler doesn't really matter to the user of the compiler.

You might still consider finishing anyway though, since you might learn a lot about finishing a product. If it was me I would probably finish the project, but if you don't think it's better than current languages, then just do it as a learning exercise.

Share this post


Link to post
Share on other sites
Trillian    410
Quote:
Original post by CTar
If you can't find a single way in which your language is better than existing languages, then people probably won't use it.


Well, there ARE people programming in brainf**k! =)

Share this post


Link to post
Share on other sites
CTar    1134
Quote:
Original post by Trillian
Well, there ARE people programming in brainf**k! =)


The brainf**k language has one feature that was essential for its "success" which is an extremely obscure syntax. There exists hundreds of esoteric languages yet very few actually gain the fame of brainf**k because they don't have any additional features that brainf**k doesn't.

Brainf**k is better than most languages before it at forcing the programmer to express very simple programs in complex terms.

Share this post


Link to post
Share on other sites
T1Oracle    100
Quote:
Original post by gamechampionx
I started a compiler project last fall, with the purpose of manually writing a compiler for a procedural language which was self-invented.

It's about 80% complete, and I'm wondering if anyone would have any interest in seeing the finished product. I'm unsure as to whether I plan on finishing it.

Finish it. It doesn't matter that no one will use it, a finished project is something you can brag about in a job interview. An unfinished project is one that you probably shouldn't mention.

If time is an issue then I could understand why you may stop when you're so close to the finish line.

Personally I would like to see such a project just to get a better understanding of compiler theory. I tried to make a script engine once and I got stuck on expression parsing (I still think I need to learn how to do that properly) and quite. When I was trying to learn how to do it most resources I found kept pointing at compiler compiler's and I didn't want non-stl compliant code let alone C code.

If you don't finish then I graciously request that you write a tutorial on writing an expression parser.

Share this post


Link to post
Share on other sites
gamechampionx    140
The expression-parsing was the part of the project that took the most planning and also held most of the "power" of the project. Once that was working, I knew things were going right.

I'm actually quite satisfied with myself after writing something that both parses expressions including order of operations, function calls, and all that and does full error-reporting on top of everything. This is why I think my project might be worth looking at as a learning opportunity, even if the language it parses is somewhat dumb. Writing a YACC or CUP complier just doesn't compare to this kinda of accomplishment in my books.

Share this post


Link to post
Share on other sites
Steadtler    220
What kind of syntaxic grammer does your language have?

LL? LR? LALR? How many lookaheads?

What about your semantic grammar, what platform do you target? What kind of semantic grammar parsing do you use?

Share this post


Link to post
Share on other sites
Sneftel    1788
In my experience, the learning experience one gets from finishing 100% of a project is five times that of finishing 90% of the project. Definitely keep at it.

Share this post


Link to post
Share on other sites
gamechampionx    140
Quote:

What kind of syntaxic grammer does your language have?

LL? LR? LALR? How many lookaheads?


This is a rather difficult question to answer. The project does not use the standard methods for doing the job but uses a more intuitive approach. It would be understandable by someone who does not know what LALR grammars are.

Quote:

What about your semantic grammar, what platform do you target? What kind of
semantic grammar parsing do you use?


The targeted platform is the Intel processor, but it's not really set in stone. I use my own methods for grammar parsing. The program logically breaks down the code into the different types of statements in an intuitive top-down manner.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this