I am wondering how I would create my own programming language using C++? I am still learning C++ and know a little up to loops (for, while, do). My questions include:
Can I even create a programming language with C++?
What skills would I need to learn (if the answer is a big amount that is fine)?
What other programs would I need to use and learn?
Do you have any recommendations on where to start?
Can I even create a programming language with C++?
Yes, you can. C++ can do anything that can be done on the computer.
What skills would I need to learn (if the answer is a big amount that is fine)?
Language theory, compiler design, c++, and more. Remember that to actually run a program you have to compile it to machine code, so you can either read in your language and write out assembly, C, or c++, or something else, or you can directly write executable files which is harder. Even generating assembler is tricky.
What other programs would I need to use and learn?
Not sure, but there are compiler compilers out there, the one I used a million years ago was called PCCTS and it was great for making a little parser (I never wrote a full language, but used its power to make a parser for a complex data stream).
Do you have any recommendations on where to start?
Any of the above, or dig in with google. There are books on the subject, projects that do it, tools that assist in doing it, and more out there.
Creating an interpreted language is generally easier that creating a language that compiles into a machine executable. With an interpreted language, you have complete control over the "instruction set". You can make the instruction set as simple or complex as you like. With careful thought, an interpreted language can be portable across platforms, while a machine executable is not.
Pieces you will need:
- A lexer that reads tokens from your input file.
- A parser that reduces tokens into productions.
- A code generator.
As jonin mentioned there are tools that can help considerably with this.
Google: LEX for a lexer, YACC for a parser generator and LLVM for X86 instruction generation.