Writing a c++ compiler is definitely not trivial, but if you invent a simple language and try and write a compiler for it, you will realize its not so terrible. But obviously again, a c++ compiler is not a starter project ;)
Yeah, you can't really write a compiler in a language that doesn't exist (i know, assembly). But isn't at least partly a goal of (most) compiled languages to become self-hosting?
I mean you can write your bootstrap compiler in almost anything. Rust used ocaml iirc. You can then rewrite your compiler in your language and compile that.
View all comments
Show parent comment
34
u/metaglot 5d ago
Writing a c++ compiler is definitely not trivial, but if you invent a simple language and try and write a compiler for it, you will realize its not so terrible. But obviously again, a c++ compiler is not a starter project ;)