Skip to content

Split OpSpec and OpImpl #199

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

Merged
merged 14 commits into from
Jul 24, 2025
Merged

Split OpSpec and OpImpl #199

merged 14 commits into from
Jul 24, 2025

Conversation

antocuni
Copy link
Member

@antocuni antocuni commented Jul 23, 2025

This is a no-op renaming of things.
Before:

  • OPERATORs returned W_OpImpl
  • typecheck() turned a W_OpImpl into a W_FuncAdapter
  • however, the return type of typecheck() was W_Func
  • astframe and doppler had to pretend to deal with arbitrary W_Funcs when calling their w_opimpl, thus adding complexity and indirection.

This PR creates two distinct concepts:

  • OpSpec: the old OpImpl: it's what the user returns, and it's a "high-level, non-typechecked" description of how to implement an op. Usually, "call this func with these args"
  • OpImpl is the old W_FuncAdapter, to underline that it's the concrete way to execute an op
  • OpImpl are executed by calling w_opimpl.execute() as opposed to vm.fast_call(w_adapter) as it was before

@antocuni antocuni merged commit c789a0f into main Jul 24, 2025
@antocuni antocuni deleted the opspec-opimpl branch July 24, 2025 08:34
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.

1 participant