Live data from Hacker News

Advanced Compilers: Self-Guided Online Course

cs.cornell.edu

231–240 of 241 posts

Re: Advanced Compilers: Self-Guided Online Course

#231

Earlier quoted context omitted.

> When was the last time a compiler bailed on the very first error it hit and refused to do anything else? Make still does this. (That's the "Stop." in the famous " * missing separator. Stop.") Many errors in Python still do this. As late as 2010 I still saw some major C compilers do this. 99% of the toy compilers written for DSLs do this, or worse. Good error recovery / line blaming is still an active field of devel…

> Good error recovery / line blaming is still an active field of development. True. But let's get terminology straight: that's not a compiler science, that's parsing science. And it's no more compiler science than parsing a natural language is.

What terminology are you talking about? Neither "compiler science" nor "parsing science" are terms I used, or that the industry or academia use.

Parsing - formal theory like taxonomies of grammars, and practical concerns like speed and error recovery - remain a core part of compiler design both inside and outside of academia.

Re: Advanced Compilers: Self-Guided Online Course

#232

Earlier quoted context omitted.

> very little of it is written down > and papers to absorb it. I smell a contradiction. But I'm glad that even well-known industry people see it like that. It's not a common flu you can pick up at university library. It's an arcane lore you need to travel faraway to dig into ruins of Library of Alexandria to find the knowledge of.

I don't see the contradiction - very little of it is written down, and so you need to spend a lot of time scraping around for the disparate parts that are written down and trying to absorb as much as possible for them. There are very few (in some parts of the field none) books that bring together all the information.

Good, good. Reminds me that stealing your https://rubybib.org/ idea for Python is on my todo list for long time ...

Actually, my own ref to the Library of Alexandria, initially done for a word of mouth, is a literal situation in some parts of the realm. Reminds me I wanted to put up a mirror of Rice' Massively Scalar Compiler Project materials somewhere. In my mental map, Cooper and guys literally saved SSA from IBM's freezing hell (quoting Kenneth Zadeck: "What Happened Next / We stopped working on SSA. / None of us actually worked on a compiler project. / We were blocked from transfering SSA to the IBM product compilers.").

Really should do that on winter holidays. By that time, we'll also know if http://ssabook.gforge.inria.fr/latest/ actually have gone down. But at least that is already mirrored...

Re: Advanced Compilers: Self-Guided Online Course

#233
post #19

Earlier quoted context omitted.

Compilers books: I'd start with "Engineering a Compiler" by Keith Cooper and Linda Torczon. http://craftinginterpreters.com/ is also a pretty great, programming-oriented intro, which may be good to work through alongside. For more on the analysis & compiler optimization side, "SSA-based Compiler Design" ( http://ssabook.gforge.inria.fr/latest/ ; GitHub Mirror: https://github.com/pfalcon/ssabook ) is a good follow-up.…

Thank you so much for this comment. It's incredibly difficult to find modern compiler learning resources – when I ask, I often get disparaging comments about the dragon book and not much more. Please, consider putting this list on your blog, or somewhere more visible than a HN comment.

> disparaging comments about the dragon book

How's that possible? It's a "keep it under your pillow" book. Whether you read it or not is a different question. I don't know anyone in the 'hood who wouldn't have.

Re: Advanced Compilers: Self-Guided Online Course

#234
post #40

Anyone interested in following the course together during the holidays? To keep each other motivated etc.

> Anyone interested in following the course together during the holidays? To keep each other motivated etc.

Hey, don't forget my little "advent of code" too:

https://github.com/pfalcon/python-ast-hacking-challenges/iss...

"Convert Python source code to SSA form"

Re: Advanced Compilers: Self-Guided Online Course

#235

Earlier quoted context omitted.

Andy Pavlo of the CMU DB fame echoed this in one of the intro video lectures to one of his courses. He said his contacts in the industry valued people, who can navigate a large codebase productively. Most uni courses seem to involve writing a "toy" solution from scratch, which is seldom the case in professional programming. He designed the course to be an exercise in working in an existing codebase that one needs to…

> Most uni courses seem to involve writing a "toy" solution from scratch, which is seldom the case in professional programming. Without writing a "toy" from scratch, one would never understand professional programming or codebases either. They wouldn't understand why they oftentimes poorly designed, full of bugs, etc. Tracing own "from scratch" steps, with self-reflection, is the best way to be prepared to "professio…

>>Without writing a "toy" from scratch, one would never understand professional programming or codebases either. They wouldn't understand why they oftentimes poorly designed, full of bugs, etc. Tracing own "from scratch" steps, with self-reflection, is the best way to be prepared to "professional" programming.

I disagree. All the toy from scratch provides is a way to get the student to go from zero to poorly designed solution during the course, which he can just forget it ever existed as soon as the grade is in.

Meanwhile, you have no experience onboarding to an unfamiliar codebase, have to find a bug and fix it, implement a feature, or refactor it to reduce technical debt and improve it according to some criteria. And that's pretty much at least 3/4ths of a developer's work.

Re: Advanced Compilers: Self-Guided Online Course

#236

Earlier quoted context omitted.

Andy Pavlo of the CMU DB fame echoed this in one of the intro video lectures to one of his courses. He said his contacts in the industry valued people, who can navigate a large codebase productively. Most uni courses seem to involve writing a "toy" solution from scratch, which is seldom the case in professional programming. He designed the course to be an exercise in working in an existing codebase that one needs to…

I am currently in this class and can confirm that navigating the codebase is a nightmare. The specifications we are given in the relevant assignments are vague or wrong and the code itself is pretty questionable. I spend more time trying to understand the assignment and current code than actually writing anything myself. If that's what he's going for, I guess he succeeded.

> the code itself is pretty questionable

Sounds like you got yourself a high quality code base!

It's normal for a code base to be over a decade old, during which time it was worked on by a team of a dozen positions, each of which turned over on average every 3 years. So now you've had a few dozen people, each with their own ideas of what's a clear way to express a problem, trying to solve evolving business requirements under tight deadlines. And there's a 50/50 chance the project originally started as a 'throwaway' proof of concept.

Re: Advanced Compilers: Self-Guided Online Course

#237

Earlier quoted context omitted.

Andy Pavlo of the CMU DB fame echoed this in one of the intro video lectures to one of his courses. He said his contacts in the industry valued people, who can navigate a large codebase productively. Most uni courses seem to involve writing a "toy" solution from scratch, which is seldom the case in professional programming. He designed the course to be an exercise in working in an existing codebase that one needs to…

I am currently in this class and can confirm that navigating the codebase is a nightmare. The specifications we are given in the relevant assignments are vague or wrong and the code itself is pretty questionable. I spend more time trying to understand the assignment and current code than actually writing anything myself. If that's what he's going for, I guess he succeeded.

What strategies do you find most effective to understand what’s going on in the codebase then?

How informative is git log/blame?

Re: Advanced Compilers: Self-Guided Online Course

#238

Earlier quoted context omitted.

> No offence, but parsing (in a compiler, not in general) is probably the most boring part of a compiler. Not if you're writing an IDE. Writing a batch mode parser that takes an entire correct source file and produces an AST is easy. Writing a parser that instaneously handle producing an updating AST while the user is typing in the middle of the program while still allowing semantic analysis to occur and without vomi…

> Not if you're writing an IDE. Phew, how boring! I know compiler people who (apparently) spend their time at dayjobs writing IDEs, then get back home and write books on ol' good "batch mode" processing. Can't wait for them to add a JIT chapter. But imagining they would work instead on "writing IDE" chapter would be rather funny ;-).

Heh. :)

You could consider this an observation that writing a batch mode parser is so much easier that I'm comfortable writing a book about it, but I still don't know enough to write about IDE-grade parsers and analyzers.

Re: Advanced Compilers: Self-Guided Online Course

#240
post #59

I’ve worked on multiple compilers (optimizations expert) at MSFT on VS and CUDA and gave developed a DSL and worked on Database Compilers. I can’t hire compiler people with right skills. We’re building an IDE and those parsers are written differently, and we use Scala packrat parser combinators. These courses teach very little judgement or industry relevant stuff. When do you use packrat parser vs LALR vs LL? Good lu…

Those mean academics! How dare they teach anything else than what you need right now.
Post reply on HN