It would be curious if we could rewrite SymPy's core using MatchPy. I mean, there have been some development with a lot of code developed to properly handle the subclassing (or .kind property, that has been introduced now) the *Add* and *Mul* classes, especially their flattening algorithm. Multiple dispatch was an initial idea, but it's not quite optimal to use.
I would like to point out that all of these issues are practically solved if we use MatchPy. The pattern matcher does not just dispatch on the types of the expressions, but also on the expression substructure. More MatchPy rules could be loaded in other SymPy modules (for example, if you load *sympy.matrices* the rules for flattening on *Add* and *Mul* for matrices will be added). Postprocessors could then be done away with. For efficiency, MatchPy can generate a Python decision tree performing the rule matching (note: you lose the possibility to dynamically load more rules once the code has been generated). Furthermore, there is a code generator in SymEngine targeting C++, which could potentially be used to compile algorithms written for SymPy in Python with MatchPy's rules into C++ code compatible with SymEngine (one quick note, this module is still in its early stage). On Wednesday, October 6, 2021 at 10:50:32 p.m. UTC+2 [email protected] wrote: > On Wed, Oct 6, 2021 at 2:10 AM Francesco Bonazzi > <[email protected]> wrote: > > > > > > > > On Wednesday, October 6, 2021 at 12:46:25 a.m. UTC+2 [email protected] > wrote: > >> > >> Since we are bringing up SymPEPs again, it would be helpful to agree > >> on the actual SymPEP process itself. There hasn't been much discussion > >> on https://github.com/sympy/SymPEPs/pull/2 for a while. > >> > >> I was also hoping we could have a general PEP about dependencies and > >> conditions for when something should be added as a hard or optional > >> dependency. > > > > > > The problem with SymPEP is that we will rarely use them. I mean, it's > quite rare to have a proposal for a major change in SymPy. > > I agree SymPEPs will be rare and indeed should be rare. Such a formal > process is only needed for major changes where we should try to avoid > making bad decisions. I don't see how this is a problem though. I > would say having such a formal process only be used rarely is a good > thing. > > Aaron Meurer > > > > > > -- > > You received this message because you are subscribed to the Google > Groups "sympy" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/e0680e96-8268-4bf8-ba9e-9afc75d42697n%40googlegroups.com > . > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/61ab2404-c9f7-4eaf-9255-b790d89a298fn%40googlegroups.com.
