from shape-warrior-t@kbin.social to programming@programming.dev on 17 May 2024 17:04
https://kbin.social/m/programming@programming.dev/t/1036548
For some time now, I’ve been thinking about the concept of interactively manipulating mathematical expressions and equations via software. Like doing some quick algebra in Notepad or similar, except there’s no potential for arithmetic/algebra errors, typos, etc. ruining any results.
At the same time, I also wanted to experiment a bit with zippers from functional programming. You need some way of specifying what (sub)expression to perform operations on, and it seemed like this kind of data structure could help with that.
And so, I made AlgeZip, a small proof-of-concept of the whole general idea. Although this polished Python version was completed only a few days ago, there were various other versions before this one in different languages and with worse-quality code. Instructions for things are on GitHub; requires Python 3.12 to run.
For simplicity, I decided to use boolean expressions instead of generic numeric algebraic expressions/equations, and only decided to include the minimum in terms of commands and functionality. From my understanding, it should be possible to transform any boolean expression into any other boolean expression in AlgeZip (without using the r!
command except to set things up), though I could be wrong.
Thoughts, comments, and criticism on the idea as a whole, the program, or the source code are welcome, though I’m not sure if I’ll be making any changes at this time.
threaded - newest