Replies: 2 comments 2 replies
-
@rocky inspired a few thoughts I have about Mathics and what the team might consider for improvements to pattern matching and parsing and operator support. Pattern matchingMy own project Loris isn't the right choice for pattern matching in Mathics. What is interesting about the algorithm in Loris is not that it is performant but that it can handle infinitary theories–but not as I've implemented it! However, I am working on something that might be a good fit, but it's a ways off from being functional, I'm afraid. It is a reimplementation of the fastest known expression matching algorithms and focuses on performance and on packaging the algorithms in a generic library. I am also interested in implementing many-to-one matching, but I haven't really started down that road yet. (Many-to-one is especially important for computer algebra where multiple patterns need to be matched against the subject at once.) I'm aware of the recent literature on the subject, though. For a pure Python pattern matching library, you probably want MatchPy—at the very least talk to its developers. MatchPy is the most capable expression matching library in Python as far as I know. |
Beta Was this translation helpful? Give feedback.
-
Regarding this, it seems that at least for the attributes, the evaluation context is just needed at the time in which the rule is created.
This makes it more feasible to use the scheme with the light proxy that @rljacobson suggested. Still, for |
Beta Was this translation helpful? Give feedback.
-
Mathics3 Pattern Matching is slow and it is on a critical path in M-expression evaluation. It has long been noted that it needs to be rethought/rewritten/revised.
Mathics3/mathics-omnibus#14 has some thoughts on ths.
Beta Was this translation helpful? Give feedback.
All reactions