drym-org / qi

An embeddable flow-oriented language.
58 stars 12 forks source link

Reduce chirality to templates #121

Closed countvajhula closed 9 months ago

countvajhula commented 9 months ago

Summary of Changes

This reduces (implicit) chirality of forms as indicated by left- or right-threading to an explicit use of a blanket template (i.e. __) in the expander, as discussed in A Fine-grained Migraine. This simplifies the core language by eliminating the #%partial-application form, and should reduce the number of patterns we need to match in deforestation and other compiler optimizations.

Note that we still retain the concept of chirality in the compiler for handling clos, for now.

Public Domain Dedication

(Why: The freely released, copyright-free work in this repository represents an investment in a better way of doing things called attribution-based economics. Attribution-based economics is based on the simple idea that we gain more by giving more, not by holding on to things that, truly, we could only create because we, in our turn, received from others. As it turns out, an economic system based on attribution -- where those who give more are more empowered -- is significantly more efficient than capitalism while also being stable and fair (unlike capitalism, on both counts), giving it transformative power to elevate the human condition and address the problems that face us today along with a host of others that have been intractable since the beginning. You can help make this a reality by releasing your work in the same way -- freely into the public domain in the simple hope of providing value. Learn more about attribution-based economics at drym.org, tell your friends, do your part.)

countvajhula commented 9 months ago

@dzoep This translates everything inside the compiler to use blanket templates instead of chirality (which by that point is already translated to a blanket template by the expander). It simplifies a lot of patterns, but I haven't modified the patterns for the producer yet, and not sure what kind of complex vindaloo you might be cooking up there. Should I just leave that unchanged in this PR if you are already working on that?

dzoep commented 9 months ago

I propose you merge it as-is, I will get my branch in sync and merge my current work with it. Shouldn't be a big problem.