Skip to content

Decide upon Compiler Plugin architecture #1519

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

Closed
felixmulder opened this issue Sep 16, 2016 · 1 comment
Closed

Decide upon Compiler Plugin architecture #1519

felixmulder opened this issue Sep 16, 2016 · 1 comment

Comments

@felixmulder
Copy link
Contributor

No description provided.

@liufengyun
Copy link
Contributor

I'd like to work on the plugin architecture, which will open the door for a lot of experiments & research on Dotty without changing the compiler.

There are mainly two categories of plugins in Scalac: Phase plugins & Typer plugins.

For Phase Plugins, we need them as well, no question here. We can more or less follow the same design in Scalac for phase plugins.

There are also Typer Plugins: AnalyzerPlugin and MacroPlugin. We definitely don't want MacroPlugin. For AnalyzerPlugin, maybe we can begin with something simple without polluting too much the Typer:

  1. the opportunity to expand untyped trees in Namer
    • usage: transform macro definitions, annotation based code generation
  2. the last effort to work on type adaptation failure (?)
  3. the last effort to work on implicit search failure (?)
  4. the last effort to work on subtyping failure (?)

The last 3 items are contentious, they are just for discussion. Initially, I think it's fine to not support them.

With only PhasePlugin and NamerExpansion, a blackbox macro system can be supported without changing the compiler.

WDYT? cc/ @odersky

allanrenucci added a commit that referenced this issue Mar 26, 2018
Fix #1519: Port compiler Plugin from scalac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants