meander

wilkerlucio 2021-09-24T17:51:37.110800Z

I’m starting to look at meander rewrite fn as a “reduce via pattern matching”, do you think this a good/valid way to think about it?

noprompt 2021-09-27T20:42:15.114100Z

@wilkerlucio I should probably jot this down somewhere because I’ve been asked about this a few times, but several things influenced/inspired me toward the project and it’s difficult to pin down a single inspiration. Pattern matching/substitution; regular expression; the perpetual labor of having to read programs to understand what they doing; the numerous asymmetries between constructing and deconstructing data in virtually all mainstream programming languages; the fact data as represented by literal notation requires virtually no “reasoning” and the assumption that the closer code can be to data — in the literal data sense — the easier it should be to “reason” about; the fact semantically equivalent data can be constructed infinitely many ways with functions but finitely many ways as with literal notation; it’s a big list.

👍 1
noprompt 2021-09-27T20:53:34.114300Z

In the past couple years, I’ve spent much more time reflecting on my sensitivity to situations connected to writing software. When we’re reading code we have to hold this mental model of what something “looks like” in our minds. I have poor executive function and often have to rely on writing things down to keep track of something that I’m reading. Other people might have a better executive function than myself but, generally speaking, it’s not that much better.

2021-09-24T18:05:08.111Z

🤔

2021-09-24T18:09:54.111200Z

rewrite + cata

markaddleman 2021-09-24T18:59:21.111400Z

"reduce via pattern matching" - do you mean some form of optimization?

markaddleman 2021-09-24T19:00:20.111600Z

fwiw, I'm using meander to generate SQL queries and perform some optimizations on them . in general it works very well.

2021-09-24T19:43:45.111800Z

probably the point, at least as I understand it, is that rewrite + cata can be simplified as reduce, where you laboriously build up the output data using pattern matching

2021-09-24T19:43:55.112Z

and I think it is accurate

markaddleman 2021-09-24T20:19:18.112200Z

Oh, yes. I completely misunderstood wilker's comment

noprompt 2021-09-24T23:47:22.112400Z

I think so. Rewrite systems are also known as “reduction systems”.

noprompt 2021-09-24T23:50:08.112600Z

Normally the pattern matching/substitution bit is assumed in that context.

noprompt 2021-09-24T23:50:32.112900Z

So I think the “via” bit is useful. 🙂

wilkerlucio 2021-09-25T01:31:42.113200Z

@noprompt the more I use Meander more I get amazed by it, its such a different level of thinking, I love it ❤️, I’m getting more curious about the underlying idea, can you tell me what inspired you to do it? is there another language in a library doing something similar? or you just had some eureka moment to get to it?

noprompt 2021-09-28T16:13:09.114500Z

I meant to complete these thoughts yesterday but got pulled away. Anyway, the sum total of all of this and some other stuff (I didn’t say more about the writing part of software) contributed to starting on the project about 5ish years ago.