Comprehensive deforestation of list operations within Qi (integration branch).
This introduces a qi/list collection that includes comprehensive functional list operations resembling the ones in racket/list, but which exhibit Qi syntax even in higher order positions, and are deforested (i.e. they avoid building intermediate collections on the way to constructing the result).
There is already basic deforestation on the main branch as of Qi 4. This PR improves the architecture of deforestation so that it is:
… more general, covering a large number of common list operations (taking racket/list as a representative goal)
… extensible. Once each interface in racket/list is deforested, that will give us an idea of what the core operations really are which can express all of the others, and what a good interface to these core operations would look like that could be exposed to users for deforesting custom list operations.
… more sound. All deforestation will be done within the Qi core language, and we will discontinue optimizing host language expressions to preserve a clear separation of languages and invariants
As we continue on this work, it will hopefully also give us some idea of whether and how deforestation could be extended to datatypes more general than lists (for instance, vectors and even Qi's core values).
Public Domain Dedication
[x] In contributing, I relinquish any copyright claims on my contribution and freely release it into the public domain in the simple hope that it will provide value.
(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.)
Summary of Changes
Comprehensive deforestation of list operations within Qi (integration branch).
This introduces a
qi/list
collection that includes comprehensive functional list operations resembling the ones inracket/list
, but which exhibit Qi syntax even in higher order positions, and are deforested (i.e. they avoid building intermediate collections on the way to constructing the result).There is already basic deforestation on the main branch as of Qi 4. This PR improves the architecture of deforestation so that it is:
racket/list
as a representative goal)racket/list
is deforested, that will give us an idea of what the core operations really are which can express all of the others, and what a good interface to these core operations would look like that could be exposed to users for deforesting custom list operations.As we continue on this work, it will hopefully also give us some idea of whether and how deforestation could be extended to datatypes more general than lists (for instance, vectors and even Qi's core values).
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.)