inducer / pymbolic

A simple package to do symbolic math (focus on code gen and DSLs)
http://mathema.tician.de/software/pymbolic
Other
106 stars 24 forks source link

Implements `ToPythonASTMapper` #107

Closed kaushikcfd closed 1 year ago

inducer commented 1 year ago

What's your take on the CI failures?

kaushikcfd commented 1 year ago

What's your take on the CI failures?

Was just fixing those! :)

kaushikcfd commented 1 year ago

@inducer: This is ready. (TIL the ast package is awfully unstable across versions.)

inducer commented 1 year ago

Thanks! Could you say a bit about the motivation for this, and why it's worth it to deal with the instability of ast?

kaushikcfd commented 1 year ago

Thanks! Could you say a bit about the motivation for this, and why it's worth it to deal with the instability of last?

In PyOP2, we need to cache a part of the Loopy's "host code" on the disk (to be able to compute the computational grid sizes). The other option was to use genpy for it. But I've generally felt that ast is more complete and comes with extra batteries to process these trees.

inducer commented 1 year ago

The discussion in https://github.com/OP2/PyOP2/pull/574#discussion_r918938833 has echos of https://github.com/inducer/loopy/pull/650 to me, in the sense that it's indicative of a potentially missing "invoker" level, where these (presumably) grid sizes likely should reside. Could you explain a bit more how they're used?

(Commented there instead of here, since that discussion has very little to do with this PR.)

inducer commented 1 year ago

Thx!