Fork me on GitHub
#meander
<
2021-09-24
>
wilkerlucio17:09:37

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?

ribelo18:09:08

:thinking_face:

ribelo18:09:54

rewrite + cata

markaddleman18:09:21

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

markaddleman19:09:20

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

ribelo19:09:45

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

ribelo19:09:55

and I think it is accurate

markaddleman20:09:18

Oh, yes. I completely misunderstood wilker's comment

noprompt23:09:22

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

noprompt23:09:08

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

noprompt23:09:32

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

wilkerlucio01:09:42

@U06MDAPTP 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?

noprompt20:09:15

@U066U8JQJ 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
noprompt20:09:34

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.

noprompt16:09:09

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.