Adblock breaks this site

how do you write a program that writes a program?

Discussion in 'Programming General' started by pvtrades, Nov 7, 2007.

Thread Status:
Not open for further replies.
  1. pvtrades

    pvtrades Guest

    Referrals:
    0
    how do you write a program that writes a program?

    title says it all
     
  2. rogue poser

    rogue poser Member

    Joined:
    Jul 10, 2005
    Posts:
    51
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    you would need to...... know what you want the program to do.... it would be much easier to just write the program....
     
  3. IRockJoo

    IRockJoo Guest

    Referrals:
    0
    how do you write a program that writes a program?

    TO INJECT A KEYLOGGER, DUH?
     
  4. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    how do you write a program that writes a program?

    Not easy.
     
  5. Terrankiller

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1
    how do you write a program that writes a program?

    If you want to develop an IDE, then you will need to learn a programming language for one, so you can program the IDE.
     
  6. speedster239

    speedster239 Forum Addict
    Java Programmers

    Joined:
    Jan 21, 2007
    Posts:
    313
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    I'm not sure what your getting at here but I get the idea that you want to actually write a computer programming language.

    In that case I have two words:
    You won't.
     
  7. Varreon

    Varreon Member

    Joined:
    Nov 23, 2007
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    I hope im not too late. You could have your program write to a .c file, then distribute it with a compiler to compile it.
    ie:
    #include <stdio.h>
    int main(){
    FILE *f;
    f=fopen("file.c");
    fprintf(f,code here);
    fclose(f);
    system("gcc -c file.c");
    }

    don't criticize my code, its just an example of how you might do this.
     
  8. KANEL

    KANEL Active Member

    Joined:
    Aug 10, 2005
    Posts:
    163
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    Wow, you guys (except varreon, who helped more than anyone else) are a bit pessimistic ><
    -First write the code that gets out the basics of every program.
    -Create commands that will create functions. Have open and close brackets. Make it so anything written into this function will be written right before the close bracket. Do the same for if-then/case-switch statements, loops, blah, blah.
    -Write a code that can read input and turn them into commands (these commands will write specific code to a file). You can do that with simple string functions and case statements.

    None of those steps should be hard, tedious at most.
    If you want, you can save functions to recycle into other programs (save them in a separate file, have your program read and rewrite them into new programs).
     
  9. Shlorine

    Shlorine Guest

    Referrals:
    0
    how do you write a program that writes a program?

    Simplifyed, You'il have to make commands connected to the real commands as shortcuts. Hard and takes a while...
     
  10. moork

    moork Member
    Banned

    Joined:
    Feb 12, 2007
    Posts:
    83
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    Write a program that writes a program?
    Simple, just include the program to a resource and then extract the resource =p
    If you want sources just Pm me.
     
  11. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    how do you write a program that writes a program?

    Well, I believe you are talking about a compiler there, son.

    There are already many out.
     
  12. Faskist

    Faskist Tuxhead
    Banned

    Joined:
    Apr 25, 2005
    Posts:
    1,869
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    If he's talking about compilers, then SICP is a good book to read, although it's a different language.
     
  13. Olan14

    Olan14 Forum Addict

    Joined:
    Jan 26, 2007
    Posts:
    581
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    C-o-m-p-i-l-e-rrrrrrrrrrrrr
     
  14. Michael3455

    Michael3455 Active Member

    Joined:
    Sep 11, 2005
    Posts:
    134
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    Old, yes.. but some added input might be nice. A program that writes a program? Easy, write a Lisp Macro :D
     
  15. [OneWhoSighs]

    [OneWhoSighs] Guest

    Referrals:
    0
    how do you write a program that writes a program?

    Code:
    unsigned char binary[] = {0xEB,0xFF,0x bla bla the entire code};
    
    /* Do file open - write binary - save */
    
    Ofcourse if you wanna write binary to a file, if it's an executable you would have to set up the import table and everything, which can be tricky if your a newcomer. If it's a dynamic link library or anything else, you can just write the binary.

    You can retrieve the binary through ollydbg or any hex editor.
     
  16. thepieman1

    thepieman1 Active Member

    Joined:
    Mar 30, 2008
    Posts:
    140
    Referrals:
    0
    Sythe Gold:
    0
    how do you write a program that writes a program?

    Well there are thinks called CASE*tools which aid in the development of a program, and some of the more modern ones can write some of the source code for you as well.
     
  17. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    how do you write a program that writes a program?

    Don't grave dig.
     
< Java Basics | looking for someone to help me improve my vb abilty >
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site