Skip to content

Remove double lowering#534

Merged
LPTK merged 10 commits into
hkust-taco:hkmc2from
AnsonYeung:remove-double-lowering
Jun 26, 2026
Merged

Remove double lowering#534
LPTK merged 10 commits into
hkust-taco:hkmc2from
AnsonYeung:remove-double-lowering

Conversation

@AnsonYeung

Copy link
Copy Markdown
Contributor

Make :sjs more accurate. The old code was using a separate compilation pass which does not use the same IR. Now both :ssjs and :sjs shares the same lowered IR and only differs in the final step.

Notable changes from test:

  • implicit return are mapped to assignment
  • worker wrapper transformation is also applied
  • JS output now appears after IR
  • Lowered IR no longer contains sanity check (see first commit in this PR)

@LPTK LPTK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very nice! But I have some minor change requests.

Comment thread hkmc2/shared/src/main/scala/hkmc2/codegen/Block.scala Outdated
Comment thread hkmc2/shared/src/test/mlscript/backlog/NonReturningStatements.mls Outdated
Comment thread hkmc2/shared/src/test/mlscript/opt/CaseOfCase.mls

@LPTK LPTK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thx!

@LPTK LPTK merged commit f95da63 into hkust-taco:hkmc2 Jun 26, 2026
1 check passed
@LPTK LPTK deleted the remove-double-lowering branch June 27, 2026 13:23
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