I want to make my own online c++ compiler

Hey everyone, I’m a beginner programmer, but I have an idea for a long-term project I want to start.

I want to design an online compiler/runner for c++ to make it easier for students to understand errors in their code. I want to do this by giving a special output for certain errors.

However, I have no idea where to start or how this project is going to come together. What steps should I take first? How does this work?

Thank you! And please, if need be, ask me for more details.

Welcome to FreeCodeCamp forums, I’m by no means an expert on this topic, but hopefully someone here is, or at least knows enough to point you to the right answers. I’ll provide what I know on the topic, but by no means am I an expert on this :slight_smile:

To build a compiler in the browser, you first need to know how to build a compiler, or know how to port a existing compiler into the browser. Porting an existing compiler is easier so I assume that’;s the route you want to go.

I think something like webassembly could be able to “run” a C++ compiler in the browser. If its powerful enough to run windows 95 in a browser, then I don’t see why it could already exists (or already exist!)

Now if you wanted to build your own C++ compiler I’d say good luck! I recommend reading about how compilers work. Its a fascinating topic, but I do think the “building a compiler” seems like re-inventing the wheel and not the core goal.

Hope that helps :smile:

1 Like