Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Optimizations #76

Merged
merged 149 commits into from
Dec 8, 2023
Merged

Conversation

countvajhula
Copy link
Collaborator

@countvajhula countvajhula commented Sep 16, 2022

Summary of Changes

The goals for this PR are:

  1. to validate that the core language does not change the semantics of the full language, i.e. there is no information lost in rewriting down to the core language (even taking side effects into account, and e.g. in terms of short-circuiting).
  2. to implement a small number of "proof of concept" optimizations.
  3. Ideally, the PR should also define the overall structure of "compiler passes," if it is possible to define that at this stage.

I believe (1) is necessary in order to support the introduction of a do form which would abstain from doing optimizations. If the core language already loses information, then this form would not be able to preserve the meaning of the input syntax (including side effects).

Some approaches to consider for optimizations:

  • attempt to implement "list-like" operations on values using lists internally instead of values (e.g. investigate loop)
  • potentially adding list-oriented core forms that present a list input and output interface, see Core values or core lists?
  • identify cases where a small number of arguments may be assumed up front (e.g. amp) and handle those without generic values<->list conversions
  • define distinct handling for small vs large number of arguments in the core forms (may require an arity annotating compiler pass) to avoid generic values<->list conversions
  • identify other cases of values<->list conversions that could be avoided (e.g. map-values, fold-values)

See A Core Performance Issue Identified for more background.

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.

@countvajhula countvajhula mentioned this pull request Sep 16, 2022
29 tasks
@countvajhula countvajhula temporarily deployed to test-env September 16, 2022 05:13 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 16, 2022 05:15 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 16, 2022 06:00 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 16, 2022 06:02 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 16, 2022 06:14 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 16, 2022 06:15 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 16, 2022 16:40 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 16, 2022 16:40 Inactive
@countvajhula countvajhula force-pushed the lets-write-a-qi-compiler branch from 06c0e24 to d8616bc Compare September 24, 2022 20:31
@countvajhula countvajhula temporarily deployed to test-env September 24, 2022 20:42 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 24, 2022 20:42 Inactive
@countvajhula
Copy link
Collaborator Author

@michaelballantyne Feature request: the ability to use ~> as a core form without it colliding with bindingspec production syntax, since it'd be preferable to use ~> in optimization rules in the core language instead of thread.

@countvajhula countvajhula temporarily deployed to test-env September 29, 2022 04:06 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 29, 2022 04:08 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 30, 2022 17:01 Inactive
@countvajhula countvajhula temporarily deployed to test-env September 30, 2022 17:02 Inactive
@countvajhula countvajhula temporarily deployed to test-env October 5, 2022 01:46 Inactive
@countvajhula countvajhula temporarily deployed to test-env October 5, 2022 01:46 Inactive
@countvajhula countvajhula temporarily deployed to test-env October 12, 2022 02:24 Inactive
@countvajhula countvajhula temporarily deployed to test-env October 12, 2022 02:25 Inactive
@countvajhula countvajhula temporarily deployed to test-env October 12, 2022 04:01 Inactive
@countvajhula countvajhula temporarily deployed to test-env October 12, 2022 04:02 Inactive
This was referenced Mar 4, 2023
dzoep and others added 25 commits November 30, 2023 11:39
…sformer0 and add missing esc in range producer test
I don't recall if there was a reason why these were different
ratios. Maybe it was just what I observed to be useful in
practice. But it seems more rigorous to have them be the same.
(wip from last week's meeting)
@countvajhula countvajhula merged commit 2467932 into lets-write-a-qi-compiler Dec 8, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants