averycrespi / yolk

Numerical computing for Yolol
https://yolk.crespi.dev
Apache License 2.0
1 stars 0 forks source link

Optimize nested operations #57

Closed averycrespi closed 5 years ago

averycrespi commented 5 years ago
import a
let b = 1 + (2 + a)
export b

produces b=1+2+a, but should produce b=3+a.

Can add match case to optimizer. Need to handle both (2+a) and (a+2), as well as all other commutative operations.

averycrespi commented 5 years ago

Too difficult to integrate into the optimizer for now