News for hackers. Stuff that matters.
Re:If I ever design a first course in compilers, I'll do it ... by Swizec on Thursday August 07, 2014 @11:14AM (#8148098)
When I wrote my first compiler (really more of a transpiler), I didn't know any theory about it. I just knew how regexes worked, had an intuition that I can't just regex my way out of everything and went at it.

Started with an interpreter. Eventually turned it into a compiler. Really fun project, ran into a bunch of weird issues that would have quickly been solved had I read any theory whatsoever about compilers.

But looking back at it now, after having taken an actual compilers course in college, it did sort of have all the stages. They just happened to all be mushed together and not very cleanly separated or very cleanly defined.

The grammar, for instance, was more like a bunch of if statements and function calls that kinda sorta made the compiler do what I wanted ... but corner cases kept cropping up ...

Fun times.

There are no comments on this comment yet.