News for hackers. Stuff that matters.
Re:Pure Programming Language by bloaf on Tuesday February 27, 2024 @05:31PM (#39531063)
Its a shame, because there is a lot of really cool stuff you can do when you're able to work with your code in algebraic terms.

Just as one simple example:

Suppose you have defined some expressions that describe how to read/write data from a database, and you have used them to define a workflow-expression that retrieves a bunch of data, does some math on it, and displays the result.

In Mathematica, you can plug that whole workflow-expression into the "Simplify" function and it will potentially eliminate entire database calls if it realizes you've got stuff like "GetData[y]*(GetData[x]-GetData[x])" in your result that will always evaluate to 0.

You can even do things like define a high "complexity" of your GetData functions to make the Simplify function look for an algebraic form that will minimize calls to the database, even if it has to make the algebra look uglier.

Re:Pure Programming Language by elbear on Wednesday February 28, 2024 @03:56AM (#39535621)
Wow, this sounds like something with a lot of potential.

It also makes me think the book Algebra-Driven Design[1]. That coupled with what you're describing sounds like a powerful combination.

[1]: https://reasonablypolymorphic.com/blog/algebra-driven-design...