Notices
Results 1 to 4 of 4

Thread: Compiler/Programming Language Creation (Final Year Project)

  1. #1 Compiler/Programming Language Creation (Final Year Project) 
    New Member
    Join Date
    Jul 2009
    Posts
    1
    Hello all, this is my final semester. I am currently an undergraduate studying at Monash University taking Computer Science degree. In the final semester we are obliged to take a final project and I decided I wanted to do something that is related to compiler theory.

    I can say I have a strong background in programming, I have known C++ for about 5 years since highschool and have programmed in various programming and scripting languages. I also have a good understanding of algorithm and data structures (trees, graph, etc)

    .
    I'm thinking of doing some research on the field of compilers and computer programming language. To tell you the truth, I have never take a compiler theory subject before and are kind of vague with the idea, but I had taken some theory of computation subject which taught me the basics of parsing.

    I had an idea of creating a basic Python compiler, but my intuition tells me that with my current state of knowledge that would be too impossible to do. What I currently have in mind is to simply create a basic language with basic control structure such as if/else and while loop, few primitive datatypes (probably only char and int) and some way to link a statement into a print function in say, C library or java library because creating print function would not be feasible.

    But it all seems to standard and basic and I want my project to be more interesting while still standing in the field of compiler/programming language.

    Oh and my effective time is only one semester ,which is 13 weeks/about 3 months. Can you please give suggestion about what I should do, and probably some remarks about how feasible it is what I am trying to complete?

    Thank you very much,

    Ganeshwara Herawan Hananda


    Reply With Quote  
     

  2.  
     

  3. #2  
    New Member
    Join Date
    Aug 2009
    Posts
    1
    instead of writing a compiler/interpreter, it's easier to write a code beautifier or a translator (e.g. in order to create a new language with interesting new syntax features and then just automatically translate it into an existing language like Java for execution). This would still require you to do parsing of a computer program to various extent, but you wouldn't bother with assembly issues.

    If interested, I can tutor you in parsing and compiling issues very inexpensively. This is my major area of expertise.

    Cheers,

    Michael


    Reply With Quote  
     

  4. #3  
    Forum Sophomore
    Join Date
    Mar 2009
    Posts
    139
    This is NOT my area of expertise, and as such, please take my information with a grain of salt. My area is electromagnetics.

    However, having completed my own "Senior Design Project" in the recent past, I can tell you that given a year and 4 people, what seems like it should be easy or too little will often feel like a 10 year project with no end in sight.

    If you are dead set on creating your own language perhaps you should propose the following to your professor, and I think it a very feasible 1 semester project for a talented programmer or two, but no more than 3.

    Instead of making your own language and linker, create a program that will use your own specific syntax (like LOLCode), to assemble pre-defined, optimized bits of code in ASM. Once your program is "translated" to ASM, translate it to a .386 byte code (actual machine code), and then use the MASM32 linker to link it into an executable.

    An example would be:

    Give Me An Integer named Ted
    Make Ted 10
    Subtract 5 from Ted
    End Program

    Where "Give Me An <Type>" is used to create a variable of type <type> with name <name> (this case being Ted-- you'd allocate space in your ASM code here)

    Make sets the proceeding variable to the value after it (mov ptr, 10)

    Subtract subtracts <value> from <variable>

    and then End Program is the end of the ASM program

    From your ASM you should be able to have a routine that can look up the ASM command and translate into machine code via lookup table (probably not the most efficient), and then finally invote the linker.

    If you do do it this way, I would say only create a simple for loop, an if/else structure, and integers/strings. Once you get those done you can always add more.

    Good luck! (Oh and taking experienced people up for their offer of advice is always highly recommended.)
    --
    -M

    "Those that would give up essential liberty to obtain a little temporary
    safety deserve neither liberty nor safety."

    -Benjamin Franklin, An Historical Review of Pennsilvanya, 1759
    Reply With Quote  
     

  5. #4  
    Forum Freshman scubagirl's Avatar
    Join Date
    Aug 2009
    Location
    United States
    Posts
    12
    Yeah, parsing is definitely easier. You might look into using a language like Scheme for your project. Take a look at this page, one of my old CS profressor's Programming Languages course website. I'm not sure how useful the lecture slides actually are, but they may give you an idea of how to get started.
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •