I'm making my own language! Not that hard if you think about it.
The trick is to make a
*very* simple language (bytecode), like:
1. push 3
2. push 4
3. add
4. goto 1
Then, you just have to figure out how to convert your code to that. In mine so far it has two stages, the normal code, like:
void main()
{
if (i_rule == 1)
{
print "lol";
}
}
which is converted into this:
function - void - "main" - 0
1 - if - "i_rule == 1"
2 - print - "lol"
And that ofcourse, you easily be transformed into some form of bytecode, which ofcourse is superbly easy to execute.
Java and all the .NET things do this too, rather than executing as a .exe, they form their own bytecode and a 'virtual machine' (just a computer program) executes that code. This is good for 2 things: Firstly, once you have made the bytecode, there's no need for compilation again unless you need to change something. Second, it makes is more portable, just aslong as you have the virtual machine on every computer that is going to execute it (which is why people ask if your computer is 'Java capable').
The easy way to do these conversions is to make a tokenizer, basically, splitting a string into chunks, like "hello world?" would look like "hello", "world","?" which can also be applied to code, like: "int hi = 3;" would be "int", "hi", "=", "3", ";". Alot of people seem to over-do these tokenizers, with 1000s of lines of code. I just tend to do mine in a few hundred
[edit]
You would have a hard time doing this in DBP though. C++ may sound hard, but it's easier to do it in that. Mostly because it can handle data much better than DBP, and not all arrays are global