Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Remove subroutine support from the VM and L3-0. This significantly
simplifies the VM and brings the target languages closer together, thus
reducing future work and simplifying the overall compiler architecture.
Details
obsolete and thus removed
err_goto
grammar and associated testsSubroutine
grammar from L3-0Subroutine
andList
node kindsMotivation
The motivation behind removing low-level subroutines is two-fold:
them -, which complicates the compiler architecture
Number 1 is the main reason for the removal. Languages without low-
level subroutines need a local +
Select
dispatcher to emulate them.This lowering would be best be implemented at a higher-level, so that
the optimization passed can take the locals' data-flow into account,
but this requires all ILs below to support two dialects: one with and
one without subroutines.
Alternatively, the lowering could be done at a lower level, but this
would result in the same dialect problem as the other approach
(although to a lesser degree), and it'd also result in worse code
generation.
Since low-level subroutines are only an optimization, and the VM is the
only target out of the planned ones to support it, removing them is the
overall better choice, as it reduced the surface area of ILs and the
VM, as well as making lowering passes from subroutines into dispatchers
unnecessary.