teikalang / teika

MIT License
318 stars 7 forks source link

teika: use slightly more principled shifts #221

Closed EduardoRFS closed 2 months ago

EduardoRFS commented 2 months ago

Goals

More principled and easier to invert shifts.

Context

The current solution for shifts is quite ad-hoc, it is more or less a level's-like approach to shifting but in an indices setting, which is weird.

Here I move to a more principled approach where a shift may be the actual shift or a lift, making so that shifts always have the following form M[↑by : depth] this allows to propagate shifts down by increasing the depth, while making them completely relative and not level dependent.

Also, for some reason it makes the tests 2.5x faster, combining shifts makes it improve a bit, but I'm not sure on why it increases that much.

Related