cpsc411 / cpsc411-book

The WIP book for CPSC 411
Other
58 stars 7 forks source link

rewrite structured control flow chapter #88

Open wilbowma opened 2 years ago

wilbowma commented 2 years ago

This chapter confuses students a lot, more than I think can be attributed to workload. It confuses TAs. It confuses me. I feel it's worse than my other chapters. Just started rereading the tail calls chapter and bam, that's good stuff. This one? pf.

I think one major problem is the bottom-up presentation. I think the right approach is to follow the tail call structure. Design the abstractions we need first, then proceed top-down.

The big abstract we're introducing is basic-blocks, and expose-basic-blocks is hard. We need to spend some time working on examples, maybe even walking through parts of the design of the function.

It's also a big chapter, and contains some things not relevant to the main abstraction. The predicates are cool, but aren't completely necessary. (Although, are easy to add once you've got that basics). It might be worth splitting some of the predicate stuff out into a separate chapter.

There's a bunch of mentions of optimizations, but in an off-hand way. These should go into separate chapters too. abstract interpretation could be its own chapter (it's own book, really), and trace-scheduling could as well.

wilbowma commented 2 years ago

Best things to split out are probably linking and abstract interpretation. Should probably move abstract interpretation to version 2. Maybe linking too.