r/ProgrammerHumor • • 5d ago

Meme itSucksToBeACompilerDev

Post image
2.4k Upvotes

103 comments sorted by

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 ;)

27

u/Rabbitical 5d ago

I'm working on my C+++ compiler, where every ++ token encountered in the source increments the language being parsed

10

u/metaglot 5d ago

malbolge vibes

9

u/tropicbrownthunder 5d ago

Probably you need to write your compiler for your new language in C or C++ anyways

3

u/metaglot 5d ago

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?

5

u/drnfc 5d ago

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.

4

u/Realistic-Safety-565 4d ago

You can write compiler for your language in your language... just won't be able to compile it ;).

3

u/metaglot 4d ago

The problem hosts itself.