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

wip: scratch compiler plugin #44950

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

wip: scratch compiler plugin #44950

wants to merge 8 commits into from

Conversation

aviatesk
Copy link
Member

Trying to prototype a minimum compiler plugin system on top of #44197:

  • dynamic dispatch
  • OC-related segfaults
  • static dispatch

@aviatesk aviatesk marked this pull request as draft April 12, 2022 09:11
Base automatically changed from jb/ircode2oc to master April 28, 2022 22:26
@MasonProtter
Copy link
Contributor

What is needed to make progress on this PR?


# TODO more composable way
global PLUGIN_INTERPRETER::AbstractInterpreter = NativeInterpreter()
isplugin(interp::AbstractInterpreter) = let
Copy link
Contributor

@MasonProtter MasonProtter May 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we just write

isplugin(interp::AbstractInterpreter) = false

and then when someone writes a plugin, they add an overload

CC.isplugin(interp::MyInterpreter) = true

I tested this locally and it appears to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see the problem, this doesn't work with your way of dealing with dynamic dispatch. Is that the background for #46220 then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants