How can I write a program that makes another program?

I want to write a program that produces another program (i.e. a game creator or something of the like). I've done a bit of research and from what I've come up with it seems that this is a very hard thing to do. It won't be anything nearly as complex as a game creator, but I'm a relative beginner so I was wondering if there is a way to easily accomplish this. If someone could explain how to do this, or point me to a good resource, I would be delighted. Thanks for your time.

Diego


Answer this question

How can I write a program that makes another program?

  • Steven P.

    You could use the System.CodeDom to build components of the code directly, which I wouldn't advise, as it's probably a bit heavyweight for what you want. I'd personally generate the C# code as text and then use the CSC compiler to build the assemblies required.
  • marthew

    As far as I can tell, yes. I haven't been able to compile anything (haven't yet implemented multi-file compiles) but I don't get any Exceptions when I run it.

  • Roy mm

    naiad wrote:
    I want to write a program that produces another program (i.e. a game creator or something of the like). I've done a bit of research and from what I've come up with it seems that this is a very hard thing to do. It won't be anything nearly as complex as a game creator, but I'm a relative beginner so I was wondering if there is a way to easily accomplish this. If someone could explain how to do this, or point me to a good resource, I would be delighted. Thanks for your time.

    Diego

    Sounds like you should be getting a closer look at:

    • DSL
    • MDD
    • AOP


  • Kashif Haqqani

    I think I'll try the text -> compiler method. Gabriel, for my current project I'm not looking for methodologies, but thanks for taking the time to respond, I'm sure it will help someone else.

    Diego

  • XImplosionX

    I've investigated, and I think I'm going to use the Microsoft.CSharp namespace to compile a .cs file that my program generates.

    More Info

    Diego

  • NoEgo

    Has the CSharpCodeProvider been implemented yet It used to just throw a NotImplemented exception.
  • How can I write a program that makes another program?