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

More featureful define-inline #4835

Open
usaoc opened this issue Nov 22, 2023 · 2 comments
Open

More featureful define-inline #4835

usaoc opened this issue Nov 22, 2023 · 2 comments
Labels
feature request Feature Request performance Related to how fast things run

Comments

@usaoc
Copy link
Contributor

usaoc commented Nov 22, 2023

Recent experiment of deforestation in Qi (see https://racket.discourse.group/t/todays-qi-meeting-notes/2323 for the context) points out that define-inline can be quite useful in a higher-order combinatory context, where the functions (serving as combinators) are always expected to be inlined and further optimized. There are things that it can do better:

  1. The support for case-lambda is lacking;
  2. Variable-reference case cannot be inlined.

I’m interested in looking into this at some point, so this issue serves as a note.

@samth
Copy link
Sponsor Member

samth commented Nov 22, 2023

For references as a variable, are you thinking of having it inline the lambda with the body? An alternative would be to have an expansion-time API that could get the function definition, that Qi could use as needed.

@usaoc
Copy link
Contributor Author

usaoc commented Nov 22, 2023

Yes, that’s the straightforward way (“inline the lambda with the body”). Ideally, the change should not change the behavior of existing code, say by requiring an #:aggressive directive (and the programmer’s care!). Other approaches are welcome, though.

@shhyou shhyou added feature request Feature Request performance Related to how fast things run labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature Request performance Related to how fast things run
Projects
None yet
Development

No branches or pull requests

3 participants