Earlier quoted context omitted.
What strikes me as weird about this is that our intent is to do something to the array of strings, so we are looking for a function that takes this array and transforms it into something else. But we are obligated to invert our intuition here, and write this as if we are doing something to the punctuation that we want to insert between the array elements. It’s backwards, and causes us (me, anyway) to keep forgetting…
> It could even be written in a way where the order of arguments didn’t matter Well, 'hello'.join(', ') does not produce the same output as ', '.join('hello'), so the order of the arguments does matter.
Doing Symbolic Math with SymPy
41–50 of 81 posts
Re: Doing Symbolic Math with SymPy
#42SymPy's problem is that it is based on an object-oriented language. This results in SymPy (and friends) demanding that users abandon hundreds of years of math notation, to conform to the whims of a programming language. In SymPy you do M.diagonalize(), which makes no sense. The matrix M does not have a property diagonalize. Rather, you should apply a choosen diagonalization algorithm like Diagonalize(M) to produce a…
May be the way mathematicians notate is frankly ambiguous and confusing, and recent decades of programming experience have given good insight into more expressive methods of notation.
Structure and Interpretation of Classical Mechanics [1] walks through ambiguity in physics and math. The first interesting note I found was footnote 2 in the preface [2], citing the ambiguity in the statement of the chain rule.
I am ignorant about some of the insight coming from recent decades of programming and would love to hear it.
[1]: https://mitpress.mit.edu/sites/default/files/titles/content/...
[2]: https://mitpress.mit.edu/sites/default/files/titles/content/...
Re: Doing Symbolic Math with SymPy
#43Earlier quoted context omitted.
What strikes me as weird about this is that our intent is to do something to the array of strings, so we are looking for a function that takes this array and transforms it into something else. But we are obligated to invert our intuition here, and write this as if we are doing something to the punctuation that we want to insert between the array elements. It’s backwards, and causes us (me, anyway) to keep forgetting…
> It could even be written in a way where the order of arguments didn’t matter Well, 'hello'.join(', ') does not produce the same output as ', '.join('hello'), so the order of the arguments does matter.
Re: Doing Symbolic Math with SymPy
#44SymPy is fantastic and impressive and I am a fan. It however does few things better than the program it is directly trying to compete with, namely Mathematica. This gives me scary flashbacks to the early 'Linux on the desktop' advocates, whose main argument was that it was all 'free' in every sense of the word. As we know now, that simply was not enough to switch the majority of users. Do people see a space where Sym…
Maxima plus Sage Math wrappers works more appropriately, I think. Though I would prefer a faster language than Python for such systems. Something like Sage but with Julia.
Re: Doing Symbolic Math with SymPy
#45Earlier quoted context omitted.
Exactly, it has been refined over millennia.
Right, and it's important to remember that mathematics is sharply optimized for human understanding, whereas programming languages strike a careful compromise between human understanding and efficient execution by machines. I don't think anyone could seriously argue that programming languages are "more expressive" than mathematical notation, which has the powers of ambiguity and hand-drawn graphics.
Re: Doing Symbolic Math with SymPy
#46SymPy's problem is that it is based on an object-oriented language. This results in SymPy (and friends) demanding that users abandon hundreds of years of math notation, to conform to the whims of a programming language. In SymPy you do M.diagonalize(), which makes no sense. The matrix M does not have a property diagonalize. Rather, you should apply a choosen diagonalization algorithm like Diagonalize(M) to produce a…
This is problem I have with Python in general; that even if you prefer to use it in a functional style, most libraries are written by real Python programmers, and using them will force you to grapple with the object-oriented inversion of common sense ( https://lee-phillips.org/pythonhate/ ). My favorite example is: ','.join(['a', 'b'])
Re: Doing Symbolic Math with SymPy
#47Earlier quoted context omitted.
This is problem I have with Python in general; that even if you prefer to use it in a functional style, most libraries are written by real Python programmers, and using them will force you to grapple with the object-oriented inversion of common sense ( https://lee-phillips.org/pythonhate/ ). My favorite example is: ','.join(['a', 'b'])
You tried Coconut? http://coconut-lang.org/
Re: Doing Symbolic Math with SymPy
#48The trouble with SymPy is it's, well, buggy. I tried it a few years ago, and as soon as I got serious, I quite quickly ran into problems that I reported, some of which I now see they apparently still haven't gotten around to addressing. [1] [2] Symbolic math is hard ; they have my sympathies. I don't think I could do better. But as long as bugs like these exist, it's going to be hard to convince people to switch away…
I do get that it is a hard problem, but I would then recommend they not have an option for "real" if they can't get it right. Users will expect it to work (unless the docs point out it is unreliable).
Re: Doing Symbolic Math with SymPy
#49The trouble with SymPy is it's, well, buggy. I tried it a few years ago, and as soon as I got serious, I quite quickly ran into problems that I reported, some of which I now see they apparently still haven't gotten around to addressing. [1] [2] Symbolic math is hard ; they have my sympathies. I don't think I could do better. But as long as bugs like these exist, it's going to be hard to convince people to switch away…
Yikes those are bad. As a non-user interested in it, I must confess that seeing those issues (especially the 2nd one) makes me not want to use it! I do get that it is a hard problem, but I would then recommend they not have an option for "real" if they can't get it right. Users will expect it to work (unless the docs point out it is unreliable).
Re: Doing Symbolic Math with SymPy
#50Earlier quoted context omitted.
Yikes those are bad. As a non-user interested in it, I must confess that seeing those issues (especially the 2nd one) makes me not want to use it! I do get that it is a hard problem, but I would then recommend they not have an option for "real" if they can't get it right. Users will expect it to work (unless the docs point out it is unreliable).
Yeah. For what it's worth (not sure if it makes you feel better or worse...) I've found similarly bad bugs in SciPy too.