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

Bugfix/parse once #185

Merged
merged 57 commits into from
Mar 27, 2023
Merged

Bugfix/parse once #185

merged 57 commits into from
Mar 27, 2023

Conversation

leissa
Copy link
Member

@leissa leissa commented Mar 8, 2023

Fixes:

Changes

  • All the bits and pieces which have been passed around manually to make the plugin architecture work are now streamlined and centrally manged in Driver.
  • File names & paths now use fs::path - including Loc.
  • The c++ sources now use the term plugin instead of dialect
  • more migration from const Def* -> Ref
  • a little bit more of Infer magic
  • Wrapper assert_emplace(container, val) to assert that an insertion actually took place
  • Wrapper lookup(map, key) that returns a pointer to value if found or nullptr otherwise.

Remarks

Although we can define now all kind things in our imports, I'm reluctant to actually use this feature because right now everything lives in a global namespace. We probably want to have sth smarter.

@leissa leissa mentioned this pull request Mar 10, 2023
@leissa leissa marked this pull request as ready for review March 23, 2023 13:57
@NeuralCoder3
Copy link
Collaborator

NeuralCoder3 commented Mar 27, 2023

For clarification:

plugin
=> make passes normalizers ... available
import
=> makes axioms, local definitions, ... in thorin available

Is this correct?

And the relation would be:
plugin -> import
but not import -> plugin
.

In other words:
import remains as it is and
plugin = import + -d name.

@NeuralCoder3
Copy link
Collaborator

Although we can define now all kind things in our imports, I'm reluctant to actually use this feature because right now everything lives in a global namespace. We probably want to have sth smarter.

Prefixes like %name.name are reserved for axioms (we can not prefix other declarations/definitions), right?

@NeuralCoder3
Copy link
Collaborator

Is it currently just not necessary that dialects load other dialects using plugin or should this be avoided in general?

cmake/Thorin.cmake Show resolved Hide resolved
thorin/dump.cpp Outdated Show resolved Hide resolved
cli/main.cpp Show resolved Hide resolved
@leissa
Copy link
Member Author

leissa commented Mar 27, 2023

For clarification:

plugin => make passes normalizers ... available import => makes axioms, local definitions, ... in thorin available

Is this correct?

And the relation would be: plugin -> import but not import -> plugin .

In other words: import remains as it is and plugin = import + -d name.

For clarification:

plugin => make passes normalizers ... available import => makes axioms, local definitions, ... in thorin available

Is this correct?

And the relation would be: plugin -> import but not import -> plugin .

In other words: import remains as it is and plugin = import + -d name.

correct.

@leissa
Copy link
Member Author

leissa commented Mar 27, 2023

Although we can define now all kind things in our imports, I'm reluctant to actually use this feature because right now everything lives in a global namespace. We probably want to have sth smarter.

Prefixes like %name.name are reserved for axioms (we can not prefix other declarations/definitions), right?

correct. I'd like to change this but this is sth for another PR.

@leissa
Copy link
Member Author

leissa commented Mar 27, 2023

Is it currently just not necessary that dialects load other dialects using plugin or should this be avoided in general?

So right now, you can load a plugin via CLI or via .plugin XXX. In a perfect world, I would remove the -d (or -p) switch entirely but there is this thing that e.g. the clos plugin has some bugs and will break some test cases if loaded. For this reason, our standard opt plugin cannot just blindly load the clos plugin. But yes, using .plugin XXX is the preferred way. When I later on touch all test cases because we want to rename -d -> -p I will use .plugin XXX instead, if possible.

@leissa
Copy link
Member Author

leissa commented Mar 27, 2023

One more remark: In bootstrap mode .plugin has the same effect as .import. I also thought to make bootstrapping more explicit in the CLI. So our bootstrap command would look like this:

thorin --bootstrap mem.thorin --output-h mem.h --output-md mem.md

But this is again sth for another day.

There was also a bug that the name was replaced.
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.

None yet

2 participants