I just parse my language, translate it to C, and use C compiler errors.
I don't add new semantics, I just add many things like strings, map, etc to make it usable and fast.
I don't know if it's a good idea and how difficult this will be.
I just parse my language, translate it to C, and use C compiler errors.
I don't add new semantics, I just add many things like strings, map, etc to make it usable and fast.
I don't know if it's a good idea and how difficult this will be.
Its a valid approach.
That sounds like a good approach, concentrate on the things you want to do/learn and let the C compiler pick up the rest. You can then be finished, add to your front end, or start replacing the backend.
My language compiles to Javascript. I wanted to concentrate on the frontend tasks like type checking and elaboration, and I wanted a web playground (the language is now self-hosted). Javascript got me a runtime with closures and garbage collection for free.
It is a great idea, if you want to learn about languages!
(But if money is your goal, you may want to reconsider)