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

Sequentialize parallel let-bindings #30

Open
2 tasks
j-hui opened this issue Oct 22, 2021 · 1 comment
Open
2 tasks

Sequentialize parallel let-bindings #30

j-hui opened this issue Oct 22, 2021 · 1 comment
Labels
good first issue Good for newcomers

Comments

@j-hui
Copy link
Contributor

j-hui commented Oct 22, 2021

The user may write:

let x = xdef
    y = ydef
xyscope

for brevity. Of course, this isn't a lazy language, so xdef cannot actually reference y and ydef cannot actually reference x, but so long as that is the case, this is semantically equivalent to writing:

let x = xdef
let y = ydef
xyscope

Indeed, LowerAst will only work on the second form but not the first. We need to implement a desugaring pass that does this for us.

Furthermore, something like:

let f x = if x { h x } else { () }
    g x = if x { h x } else { () }
    h x = if x { g x } else { () }
fghscope

can also be partially sequentialized:

let g x = if x { h x } else { () }
    h x = if x { g x } else { () }
let f x = if x { h x } else { () }
fghscope

This may make type-checking/inference much easier, depending on how mutual recursion is deal with, so this is something we would want done too.

In summary:

  • sequentialize parallel variable bindings
  • best-effort sequentialize parallel function bindings
@j-hui j-hui added the good first issue Good for newcomers label Nov 18, 2021
@j-hui
Copy link
Contributor Author

j-hui commented Aug 25, 2022

This is being dealt with in #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant