• Log in or sign up for an account here: https://www.sythe.org/login

how do you write a program that writes a program?

  • Thread starter Thread starter pvtrades
  • Start date Start date
Status
Not open for further replies.
you would need to...... know what you want the program to do.... it would be much easier to just write the program....
 
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
Not easy.
 
If you want to develop an IDE, then you will need to learn a programming language for one, so you can program the IDE.
 
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.
 
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.
 
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).
 
If you want to develop an IDE, then you will need to learn a programming language for one, so you can program the IDE.

Simplifyed, You'il have to make commands connected to the real commands as shortcuts. Hard and takes a while...
 
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.
 
Member of the Month Winner
Sythe's 10th Anniversary
Well, I believe you are talking about a compiler there, son.

There are already many out.
 
Well, I believe you are talking about a compiler there, son.

There are already many out.
If he's talking about compilers, then SICP is a good book to read, although it's a different language.
 
C-o-m-p-i-l-e-rrrrrrrrrrrrr
 
Old, yes.. but some added input might be nice. A program that writes a program? Easy, write a Lisp Macro :D
 
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.
 
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.
 
Don't grave dig.
 
Status
Not open for further replies.
Runescape Gamblingrunescape gambling
Back
Top