Closed WardBrian closed 2 years ago
FYI, IIRC Labeled was meant as a possible replacement for the MIR data structure in analysis/optimization, but the switch was never made
On Thu, May 26, 2022, 11:08 AM Niko Huurre @.***> wrote:
@.**** approved this pull request.
— Reply to this email directly, view it on GitHub https://github.com/stan-dev/stanc3/pull/1204#pullrequestreview-986370677, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGAMRLEKE3LQPAGRGQZIDLVL6HUPANCNFSM5XBLUZPA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
That would explain why the Non_recursive
specialization is labeled as "a temporary replacement". Unless someone is dedicated to finishing that change, I don't think it will end up happening (much like how the AST never got the same treatment as the MIR).
Perhaps it is just different sensibilities, but my instinct is to go directly in the opposite direction and define untyped_ast
and typed_ast
patterns which are distinct from each other. The current structure means we have a fair number of illegal states which the type system is unaware of, such as Promotion
AST nodes being in the untyped AST, which logically can never happen.
We've had two MIR specializations (
Labelled
andNoMeta
) which have been there since the refactor in #346 but are never instantiated. Removing them requires no additional code changes to the compiler, and it is unclear what they were intended for.I believe removing these also clears up any circular dependency issues which would arise if we wanted to move things like
SizedType
andUnsizedType
fromMiddle
toCommon
in the future.Submission Checklist
Release notes
Simplified internal representations in the compiler.
Copyright and Licensing
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)