Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm curious, why focus entirely on parsing? I only read parts of the Dragon Book, but it didn't go in much detail about other topics, such as types, either. Couldn't you just use a very simple syntax such as S-expressions or even start from an AST directly?


people hyperfocus on parsing because it's far and away the easiest part of a compiler - type inference, optimization, target codegen are infinitely harder and deeper wells to plumb.


A few reasons, although you are only seeing part of the picture with the project. The lectures were all theory-based (more along what you would find in the book).

1. I had a whopping three weeks to prepare this course from scratch (welcome to Uni teaching) and it was what I could scrape together in that time.

2. Parsing is highly useful, and I felt my students could benefit from it.

3. It was what I did in undergrad.

4. It was not too difficult to accomplish, and a project like this can easily get out of hand for a semester project.


I agree with you that parsing, for most people, or even most software engineering people, are much more useful then the other stages. Code generation is also interesting and could be useful too but that's pretty much the two of them. All the "interesting" stuffs people spoke about (e.g. optimization) actually has very few use cases unless you are working on it directly.


FORTH ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: