Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Creating own language and compiler

  1. #1
    Davide's Avatar
    Davide is offline Programming God
    Join Date
    Dec 2009
    Location
    Manchester, UK
    Posts
    507
    Blog Entries
    8
    Rep Power
    11

    Creating own language and compiler

    Ok, i know (a bit) assembly. I know how i can make a language (that's not hard). But how the hell can i write a program that makes .exe files?

    I mean, what i have to do is to take the text from the .programming_language file, and turn it to and .exe. How do i make an .exe? I DON'T want to convert to .asm and compile it again, i want to make the compiler myself.

    Anybody know how?
    Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2009
    Location
    Santa Clarita, CA
    Posts
    2,111
    Blog Entries
    47
    Rep Power
    31

    Re: Creating own language and compiler

    That requires you to write an assembler, which is a program that takes assembly source code and converts it to it's hexadecimal representation. I wouldn't know the first thing about writing an assembler, but I know there are several open source assemblers out there you can look at.

    Quote Originally Posted by Davide
    I know how i can make a language (that's not hard).
    This is one of the few places where I find "LOL" to be highly appropriate. The assembler should be trivial compared to the compiler and language semantics.
    Wow I changed my sig!

  4. #3
    outsid3r's Avatar
    outsid3r is offline Programming God
    Join Date
    Jul 2008
    Posts
    621
    Rep Power
    19

    Re: Creating own language and compiler

    Quote Originally Posted by Davide View Post
    Ok, i know (a bit) assembly. I know how i can make a language (that's not hard). But how the hell can i write a program that makes .exe files?
    This statement is really interesting. First you say that making a programming language is easy, and just after that, you ask "how to make an .exe file?" (the really easy part). I assume that you have absolutely no idea of what a file really is. Have you heard about file headers, which describe the file information?
    Another thing is, you must know more than a bit of assembly to make a programming language. You must really know assembly, architectures, the differences between them, parsing (tokenization, syntactic analysis, parse trees), compilation, optimizations, file formats, operating systems... just to name a few things. You must have a very good knowledge about programming, the most single mistake in compilation immediately leads to an invalid executable.

  5. #4
    Davide's Avatar
    Davide is offline Programming God
    Join Date
    Dec 2009
    Location
    Manchester, UK
    Posts
    507
    Blog Entries
    8
    Rep Power
    11

    Re: Creating own language and compiler

    An interpreted programming language is completly different, it doesnt require an exe, and guess what? I managed to make one, it's just that i don't like it like that.
    A bit doesn't describes all my experience with assembly.

    I found my answer guys btw, thanks for your help.
    Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

  6. #5
    Phoenixz is offline Programming Professional
    Join Date
    Dec 2008
    Posts
    256
    Blog Entries
    1
    Rep Power
    13

    Re: Creating own language and compiler

    Glad that you found your answer Davide, I'd be quite interesting to see a bit of your language just from curioisity.

  7. #6
    Ewe Loon's Avatar
    Ewe Loon is offline Learning Programmer
    Join Date
    Feb 2010
    Posts
    49
    Rep Power
    0

    Re: Creating own language and compiler

    I wrote a programming language (scripts) in delphi for a project im still working on
    its very simple but adequate for its job,
    originally everything was done as functions, however i have taught the compiler to handle + - * / and brackets
    since it only uses floating point numbers and the Scripts aren't used outside the application all function are pre-coded into the application
    although its very limited it is the basis of a fully functional language

    I am working on a more advanced version for another project

  8. #7
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,513
    Blog Entries
    8
    Rep Power
    59

  9. #8
    Shephard is offline Newbie
    Join Date
    Jun 2010
    Posts
    6
    Rep Power
    0

    Re: Creating own language and compiler

    I think that might be another one of those "LOL" moments

  10. #9
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,513
    Blog Entries
    8
    Rep Power
    59

    Re: Creating own language and compiler

    Seriously, x42, you need to spend some time looking on the Internet before you make claims like that. It's misleading.
    sudo rm -rf /

  11. #10
    outsid3r's Avatar
    outsid3r is offline Programming God
    Join Date
    Jul 2008
    Posts
    621
    Rep Power
    19

    Re: Creating own language and compiler

    This is like "he got owned". I have 6 big intel manuals that i have requested long time ago for free, 2 of them were posted by dargueta. It's pretty obvious that each processor have manuals that covers everything we need to know about them.

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Intermediate Creating A Simple Compiler: Part 6
    By dargueta in forum C Tutorials
    Replies: 10
    Last Post: 03-04-2011, 12:02 PM
  2. Creating a Simple Compiler: Part 5
    By dargueta in forum C Tutorials
    Replies: 1
    Last Post: 08-08-2010, 10:58 AM
  3. Creating A Simple Compiler: Part 4
    By dargueta in forum C Tutorials
    Replies: 7
    Last Post: 04-19-2010, 04:19 PM
  4. Creating A Simple Compiler: Part 2
    By dargueta in forum C Tutorials
    Replies: 3
    Last Post: 01-08-2010, 12:25 AM
  5. Creating A Simple Compiler: Part 3
    By dargueta in forum C Tutorials
    Replies: 4
    Last Post: 01-06-2010, 03:57 PM

Tags for this Thread

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