Your thoughts on how to making your own language

I am currently thinking of ways of making my own language on top of C++ so that i can make my projects more transferable. This way, if i change libraries, it could be semi-easily changed to what the equivalent to my language is. For Example, a program made in Direct x can be change to Open GL. I do understand that there probably no equivalent to most the commands used, but i can change some code.

Question 1:
Do you think it would be beneficial do the C++ code too? I personally don't think i would ever need to change from C++ to java or something so i don't think it would be necessary.

How i would do it 1:
Use the preprocessor to set a bunch of conversions of my code to the code it understands.

How i would do it 2:
Make a Compiler-ish thing to convert my language to what the libraries understand.

Question 2:
How do you think you would do it/what would you do different?

Thanks
You don't need to write a new language for that, you can write a library with a common interface but with library-specific implementation
Forgive me if I'm mistaken, but it sounds to me like what you really want to do is make a scripting language for your game projects.

In order of what I imagine the difficulty:
1. Use a 3rd party game scripting system such a Lua
2. Use a language such as python and mod it for your projects
3. Write your own interpreted scripting language
4. Write a compiled scripting language
Last edited on
Thank you both for you suggestions!
I'd recommend Lua. I am actually Intermidiate at Lua in my favorite game.
Topic archived. No new replies allowed.