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

Remove repr #2

Merged

Conversation

goldfirere
Copy link

Rebasing my remove-repr patch was pretty easy. I think this is probably worth reviewing and merging quickly to avoid future conflicts.

Copy link
Owner

@ccasin ccasin left a comment

Choose a reason for hiding this comment

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

This is nice! I put a few minor comments / suggestions in the code.

I think the main downside of this approach is that the division of labor between Types.Layout and Type_layout is now pretty unclear. I think this is an improvement anyway, but I'd like to discuss what the right division is before merging.

One example is that it seems odd for equate to be in Layout while intersection is in Type_layout. Maybe all of the basic operations on the lattice should go in Types? I suspect the primary reason you didn't move them is that you didn't want to move Violation. Maybe it's just fine to move it? I see we also have some error information for modes in Types.

Alternatives: If we're concerned about cluttering types.ml, we could move the Layout and Sort modules to their own file, to be included by Types. (One could imagine doing the same for the mode stuff). Or we could move equate back into Type_layout - I think for this you just need to expose a way to modify Sort.vars?

It also feels a bit murky to me why things like Type_layout.of_const_layout and the void defaulting functions belong in that module rather than Types.

typing/types.mli Outdated Show resolved Hide resolved
typing/types.mli Show resolved Hide resolved
typing/type_layout.ml Outdated Show resolved Hide resolved
typing/ctype.ml Outdated Show resolved Hide resolved
typing/type_layout.ml Outdated Show resolved Hide resolved
typing/types.mli Outdated Show resolved Hide resolved
typing/types.mli Outdated Show resolved Hide resolved
otherlibs/dynlink/Makefile Show resolved Hide resolved
Copy link
Author

@goldfirere goldfirere left a comment

Choose a reason for hiding this comment

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

Thanks for the review.

The short answer to your "why is the division the way it is" is that I was trying to disturb as little earth as possible. But you seem to be encouraging me to disturb more earth, and so I'll take another more maximal spin. I think various module dependencies will stop us from fully merging Type_layout into Types, but I'll try to make this all more rational.

By the way, the idea of moving this stuff out of Types and into a module under Types is plausible, but I don't think all that necessary -- I'm not particularly worried about bloat in Types. It's a good move to have in mind, though, if it looks like it will solve a problem.

otherlibs/dynlink/Makefile Show resolved Hide resolved
typing/ctype.ml Outdated Show resolved Hide resolved
typing/type_layout.ml Outdated Show resolved Hide resolved
typing/type_layout.ml Outdated Show resolved Hide resolved
typing/types.mli Outdated Show resolved Hide resolved
typing/types.mli Outdated Show resolved Hide resolved
@ccasin
Copy link
Owner

ccasin commented Jan 29, 2023

The short answer to your "why is the division the way it is" is that I was trying to disturb as little earth as possible. But you seem to be encouraging me to disturb more earth, and so I'll take another more maximal spin. I think various module dependencies will stop us from fully merging Type_layout into Types, but I'll try to make this all more rational.

Totally reasonable - and I'm happy to be told the current split is the best compromise - but it's worth a little thought about whether moving more or less stuff would make it easier to guess where to look for a given function.

@goldfirere
Copy link
Author

OK. Ready for re-review. The second new commit moves everything out of Type_layout and into Types. I'm not 100% sure this is the best, but I couldn't come up with a good reason to separate things, and the move seemed in keeping with the treatment of e.g. Alloc_mode at the bottom of the Types module.

@ccasin
Copy link
Owner

ccasin commented Feb 4, 2023

Thanks. This looks good - merging. I won't be surprised if we get told later to move some stuff back out of types, but I agree it's hard to come up with an intuitive division of labor.

@ccasin ccasin merged commit 46710b8 into ccasin:unboxed-clean-rebase Feb 4, 2023
@ccasin ccasin deleted the rae/no-layout-repr-rebase branch February 4, 2023 00:17
ccasin pushed a commit that referenced this pull request Oct 17, 2023
* Parse `#0`, `-#1`, `#2.7`, and `-#3.1`, treating them as boxed

* Fix parsing of unsuffixed unboxed int literals

* Rewrite CR comment

* Update comment

* promote-menhir

* Unboxed literal tests

* Adjust error for unsuffixed unboxed integers
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.

2 participants