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

Accept -Vprint:all, -Vprint:~tailcalls #10173

Merged
merged 2 commits into from Nov 4, 2022
Merged

Conversation

som-snytt
Copy link
Contributor

Because Scala 3 uses "all", it would be easier if Scala 2 regressed to also accepting all in -Vprint:all.

Often, one wishes to see both incoming and outgoing trees.

It is verbose and cumbersome to determine which phase precedes tailcalls, for instance, in order to -Vprint:fields,tailcalls.

The updated syntax is -Vprint:~tailcalls.

Since settings are not aware of phase order, semantics are the onus of the feature. The syntax is not supported automatically by -Vshow, for example.

Note that id syntax is -Vprint:12-13 and tilde is not supported for id. It is trivial to compute the predecessor of phase 13 (unlucky phase!).

~all does not mean before and after every phase, i.e., twice.

@scala-jenkins scala-jenkins added this to the 2.13.10 milestone Oct 1, 2022
@som-snytt som-snytt marked this pull request as ready for review October 1, 2022 23:34
@SethTisue SethTisue modified the milestones: 2.13.10, 2.13.11 Oct 2, 2022
@som-snytt som-snytt marked this pull request as draft October 2, 2022 22:00
@lrytz
Copy link
Member

lrytz commented Oct 7, 2022

Sounds good

@som-snytt
Copy link
Contributor Author

I'll work out the kinks. I think there was a kink.

@som-snytt som-snytt force-pushed the tweak/vprintem branch 2 times, most recently from 6bc1a88 to b8418ec Compare October 18, 2022 16:21
@som-snytt som-snytt marked this pull request as ready for review October 18, 2022 19:38
@som-snytt
Copy link
Contributor Author

That was quite finicky. A test failure due to checking "can I log at the phase under construction"? Very metaphysical.

Also scala/scala3#17682 in case it is picked up for a spree.

The other idea is -Vprint:^tailcalls to mean print after tailcalls and also the preceding phase at which there was a difference, which of course might not be the immediately preceding phase.

@SethTisue
Copy link
Member

Nice! Is it possible to cram doc for the ~ thing into the option's description?

@som-snytt
Copy link
Contributor Author

While cramming, I also added the default I've longed for. Not sure if I created a ticket for it previously or just tweeted about it endlessly.

Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

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

nice, thanks!

@lrytz lrytz merged commit 6e2b609 into scala:2.13.x Nov 4, 2022
@som-snytt som-snytt deleted the tweak/vprintem branch November 4, 2022 15:32
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label May 18, 2023
@SethTisue SethTisue changed the title Accept -Vprint:all, -Vprint:~tailcalls Accept -Vprint:all, -Vprint:~tailcalls May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
4 participants