Hacker News new | ask | show | jobs
by jheriko 559 days ago
nice work.

if you want more of a challenge try a compiler compiler that can compile itself... :)

i got pretty far with this myself, although it doesn't work for weirdo languages like Python that need an exceptional lexer. i keep meaning to revisit this problem, since the tools in this space are pretty much non-existent or trash quality.

https://github.com/semiessessi/cp2

1 comments

> if you want more of a challenge try a compiler compiler that can compile itself... :)

Is that not what OP did?

No (if the parent really meant ‘compiler compiler’ which, I think, would be what yacc/bison is).
Ah, thanks. My brain actually did not see that second "compiler" when reading, now it makes sense.
How could you tell the difference between missing it and your brain filtering it out?
Isn’t that the same now?

By the way, I dislike the term “compiler compiler”, because that’s not really what it does. I like “parser generator” for tax/bison, and “lexer generator” for flex.

yacc calls it's a compiler compiler, but it's a parser compiler.
I'd go further and say "parser generator", the generated parser will be compiled by a C compiler after all.