Skip to content

Core streams QIP and POC - #210

Open
countvajhula wants to merge 2 commits into
drym-org:mainfrom
countvajhula:qip-core-streams
Open

Core streams QIP and POC#210
countvajhula wants to merge 2 commits into
drym-org:mainfrom
countvajhula:qip-core-streams

Conversation

@countvajhula

@countvajhula countvajhula commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

Qi Improvement Proposal (QIP) for modeling streams in the core language, along with an accompanying proof-of-concept.

Describe Qi's "core performance issue" and remedies for cases of specific arity, proposing a unified stream runtime in the core language to address the general, variadic case.

👉 Rendered HTML
🎛 Performance Report for Unified Runtime
🎛 Performance Report for Tripartite Runtime

Public Domain Dedication

  • 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.)

@countvajhula countvajhula added research A topic requiring further study or innovation developer Relevant only to Qi developers compiler labels Jun 19, 2026
@countvajhula countvajhula changed the title Add core streams QIP Core streams QIP Jun 19, 2026
@countvajhula
countvajhula force-pushed the qip-core-streams branch 3 times, most recently from 16ca6b0 to e2d01b4 Compare June 19, 2026 23:44
@countvajhula countvajhula changed the title Core streams QIP Core streams QIP and POC Jun 19, 2026
Describe Qi's "core performance issue" and remedies for cases of
specific arity, proposing a unified stream runtime in the core
language to address the general, variadic case.
@countvajhula

Copy link
Copy Markdown
Collaborator Author

The part of this design that we discussed and accepted is modeling streams in the core language in general, and in particular, having separate producer, transformer, and consumer runtimes. This achieves rough parity with the naive Pac-Man implementation (which is itself comparable to qi/list performance while being more general) which implements each list operation manually rather than via parameters.

The unified runtime was a later development that I came to while working on the QIP after our verbal discussions and is still to be considered in "DRAFT" status, as it currently performs worse than the tripartite runtimes. I have updated the QIP to reflect this. I did not spend much time trying to optimize it, and it's possible it can be addressed directly in our implementation. Otherwise, it would be very worthwhile to understand the cause of the performance shortfall by studying the compiled Chez output, and attempt to address it in the Chez compiler. If either of these approaches fails, we can fall back to using the proven tripartite model, which is treated in the QIP alongside the unified model.

@countvajhula
countvajhula marked this pull request as ready for review August 21, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler developer Relevant only to Qi developers research A topic requiring further study or innovation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant