-
Notifications
You must be signed in to change notification settings - Fork 213
Add helper for specializing parametric functions #3141
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
base: main
Are you sure you want to change the base?
Conversation
could this potentially also be used to add a flag to |
@proppy yeah, are you thinking about using a parametric function as the top function, and specialize with some parameters? |
This PR is now blocked by #3061 as the test suite is referring to functions defined there |
👍 yes, this can easily be done w/ a wrapper function today, but is cumbersome to do w/o code generation when you want to instanciate a lot of function variants w/ different sizes. /cc @richmckeever |
Yeah. I used to do code generation to serve my purpose, but replacing all the invocation sites is hard to do without a programmatic way to manipulate the DSLX. |
This pull request adds a helper for specializing a parametric function with a given environment. The resulting function will be inserted back to the source module.
The C API exposed a "batched" specializing helper that takes an typechecked module and return a cloned typechecked module with all specialized functions inserted. This is needed as our current use of C APIs is assuming that a module is immutable.