Program with user editable script?

I have an idea for a program I want to start, the program is for the most part simple, and I believe I could do everything I want with it; however, one aspect of the program I am unsure if I could do, I have an idea of how it might work, but no evidence to back it.

So here is the problem:
I want to make it so that only one file in my program is editable by the user of the program, but the program will not directly change the code as the program is running, this could obviously cause several security problems, what I want instead is that the user can't edit the code, then on command in the program the program will read through the stuff coded by the user and determine if it will run correctly, after which, if it will, the program will reload silently, so that the code reloads, else, the code in the actual program will stay the same, and output an error.

Clarifications:
- When I say the program should check if the code with run correctly, I do not mean it checks that the code does what the user actually wants it to do, just that it won't cause any compile or run-time errors.

- When I say that the user should be able to edit the code, I mean that one pre-determined header or cpp file should be editable by the user of the program, not the whole program.

Examples:
A good example of what exactly I am looking for is in the XtremeWorlds 2D game engine, you can edit source to add custom things. Googling XtremeWorlds should lead you right to the engines main page.

What I am asking put simply:
I want to know where to start, example code or other forums posts, anything, making an in program script editor, that does not require the program to restart.
Last edited on
Why not go for a typical application hosted language like LUA instead?
kbw is right, you should emulate\incorporate an already existing language. Not only will it save you the time it would take to come up with the syntax and operational flow but it would help other people adapt to your application more easily.
I'm a little confused wouldn't it come out the same no matter which language I used? I mean if I write it in Lua or C++, it will function the same, the language will just be different... I am not looking to write my own language, at the absolute most, I would like to make a "Simplified" version of C++, but for now I just want them to be able to edit a file.
No. Lua is designed to plug into an application. There are examples of how to do it.

That's different from doing from scratch.
Topic archived. No new replies allowed.