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

feat(compiler): Allow function re-exports to use regular call instruction #1176

Merged
merged 3 commits into from
Apr 21, 2022

Conversation

ospencer
Copy link
Member

No description provided.

@ospencer ospencer requested a review from a team March 22, 2022 13:29
@ospencer ospencer self-assigned this Mar 22, 2022
Copy link
Member

@peblair peblair left a comment

Choose a reason for hiding this comment

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

Looks good (I think); just a couple of questions.

{
val_repr: ReprFunction(args, rets, _),
val_fullpath: Path.PIdent(id),
} as vd,
) => {
switch (Ident_tbl.find_opt(func_map, id)) {
| Some({name: Some(name)}) =>
| Some(internal_name) =>
let external_name = Ident.name(vid);
Copy link
Member

Choose a reason for hiding this comment

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

What's the significance of changing to vid instead of id here (and line 1293)?

Copy link
Member Author

Choose a reason for hiding this comment

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

This way is "guaranteed" to be correct, since it's the name that's included in the module signature rather than the name that's a part of the full path (which is something internal). 1293 was really just a bug 😶

I guess it wasn't really a bug since it doesn't affect anything, but id could potentially be incorrect.

/* Exports are already reversed, so keeping the first of any name is the correct behavior. */
List.filter(
({ex_name}) =>
if (Hashtbl.mem(exported, Ident.name(ex_name))) {
fun
Copy link
Member

Choose a reason for hiding this comment

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

Is this just removing duplicates (this question probably belongs on the other PR)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's it. The work it does is a bit different now since the names are already supplied.

Copy link
Member

@marcusroberts marcusroberts left a comment

Choose a reason for hiding this comment

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

I've read the code through, and LGTM but I don't understand some of the deeper concepts yet, so take with a pinch of salt !

Copy link
Member

@phated phated 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 soooooo awesome! I looked at a couple snapshots and they look 🔥

I only had a couple comments.

compiler/src/codegen/transl_anf.re Outdated Show resolved Hide resolved
compiler/src/codegen/transl_anf.re Outdated Show resolved Hide resolved
Base automatically changed from oscar/call-known-across-modules to main April 21, 2022 14:57
@ospencer ospencer requested a review from phated April 21, 2022 15:09
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

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

Approved! Just need CI to turn green

@ospencer ospencer merged commit afce3aa into main Apr 21, 2022
@ospencer ospencer deleted the oscar/function-reexport branch April 21, 2022 21:46
@github-actions github-actions bot mentioned this pull request May 16, 2022
@github-actions github-actions bot mentioned this pull request May 31, 2022
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.

4 participants