ezyang’s blog

the arc of software bends towards understanding

October, 2020

The hidden problem(?) with basic block procedures in SSA

Years ago, Nadav Rotem related to me this story about why basic block procedures in Swift are not as good as they seem. Nelson Elhage reminded me about this on Twitter and so I thought this should be put into the public record. Basic block procedures make certain optimizations more difficult. Consider this program: block […]

  • October 24, 2020

Idiomatic algebraic data types in Python with dataclasses and Union

Greetings from 2024! An official pattern matching PEP has been accepted https://peps.python.org/pep-0636/ and is available in Python 3.10. Class patterns are tested using isinstance, with no inheritance structure necessary, making the pattern described in this post 100% forward compatible to real pattern matching. One of the features I miss most in non-Haskell programming languages is […]

  • October 14, 2020