Skip to content

[JuliaLowering] Misc. cleanup: symboliclabel, flatten_blocks#61166

Open
mlechu wants to merge 3 commits intoJuliaLang:masterfrom
mlechu:jl-cleanup
Open

[JuliaLowering] Misc. cleanup: symboliclabel, flatten_blocks#61166
mlechu wants to merge 3 commits intoJuliaLang:masterfrom
mlechu:jl-cleanup

Conversation

@mlechu
Copy link
Member

@mlechu mlechu commented Feb 26, 2026

Misc:

  • Use _typeof_captured_variable in closure conversion
  • Don't erase ex.toplevel_pure in scope resolution
  • Add and use flatten_blocks to make debug output more readable.
  • Remove zero-argument return from the validator and a new macro (has never been
    an accepted form in flisp lowering).

Fixups to #60481 and #61016

  • Consistently use symbolic labels in break/continue instead of identifiers
  • Symbolic labels don't participate in scope resolution, so don't need to be
    special-cased
  • Clean up break/continue desugaring. Claude seems quite confused as to what
    forms can show up where. I can sympathize, and will hopefully have that
    written down sometime this week.
  • Remove provenance-preserving @label macro---I could fix the mistakes, it's
    just certain that we need everything to work without them, and having them was
    masking some problems.
    • Naming it loop-cont/loop-exit in the normal macro and
      loop_cont/loop_exit was pretty devious

For future reference, these are the invariants we have and want to maintain:

  • The expansion of any macro in syntax_macros.jl should be equal to
    expr_to_est(equivalent_old_expansion) (modulo scope layer nonsense)
  • The result of Expr-macro expansion should always be lowerable by
    JuliaLowering
    • The reverse is nearly true, but requires implementation of
      scope_layer/name-mangling equivalence
  • If we see a tree in desugaring, we know it passed valid_st1 and went through
    est_to_dst; no other forms are possible

Atop #61133

@mlechu mlechu requested a review from Keno February 26, 2026 02:18
@Keno
Copy link
Member

Keno commented Feb 26, 2026

(reviewed the labeled break specific parts only)

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