google-research / dex-lang

Research language for array processing in the Haskell/ML family
BSD 3-Clause "New" or "Revised" License
1.58k stars 107 forks source link

Rewrite general_integer_power with a `for` because Dex can't differentiate through `while` #1210

Closed axch closed 1 year ago

axch commented 1 year ago

There is still a while in there, to compute the number of iterations of the squaring loop, but

Differentiating through general while is a problem because the tape becomes a recursive ADT (namely List), and Dex doesn't support those yet.

Fixes #1195.