On 13/12/2022 22:21, Aaron Meurer wrote:
Data classes are a nice syntactic convenience, and it's useful to have
them if you are using something like that so you don't have to rewrite
all the boilerplate. But I've never really found the "objects
representing a tree of expressions" as being the hard part of symbolic
computation. A competent Python programmer could easily rewrite all
the logic of dataclass (or the most basic logic of Basic) from scratch
in an hour.
The only real challenges are 1) making things as syntactically nice as
possible. I think SymPy does pretty well here, although there are
places where things could be improved. And 2) the overall performance.
>From what I've heard, dataclasses aren't particularly performant, so I
don't think they specifically are a good choice in that regard.
I find it interesting as an outsider, to read discussions from insiders
as to the ideal structure of SymPy and (perhaps) its long term development.
My suspicion is that object oriented programming is rarely as useful as
it is claimed. I wonder if that is what you are implying here.
Put another way, what would be your preferred computer language if you
were SymPy starting again? There would obviously need to be an interface
to Python, but would you write the rest in C++?
C++ does contain object oriented constructs - indeed its objects can
inherit from more than one parent - but of course it can be used without
accessing that complexity.
David
--
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/4675d9df-67ff-062c-1b84-ed78b0b68e27%40dbailey.co.uk.