Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Trigger TCO even when there are some self references in non-tail positions#3968

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
radrow wants to merge1 commit intopurescript:master
base:master
Choose a base branch
Loading
fromradrow:feature/occasional-tco

Conversation

radrow
Copy link
Contributor

Fixes#3967

Tests are passing on my side.

gorbak25 and radeusgd reacted with heart emoji
@hdgarrood
Copy link
Contributor

Unfortunately it's very easy to introduce bugs when working on this code, so I think we need to be really careful about this (searching through this repo's issue history for TCO should provide a bit more context). It's unfortunately quite possible that our tests don't cover as many cases here as they should, so the fact that the tests are passing is not enough for me to be confident. The tests in this PR only check that the program finishes; they don't check the results of the TCO-transformed functions, which I think is also needed.

For me, this would need a much more developed justification of why it works and would not break existing programs before we can consider it. In any case I think this needs to wait until 0.14.0 has been released.

@JordanMartinez
Copy link
Contributor

In any case I think this needs to wait until 0.14.0 has been released.

I agree with this.

@radrow
Copy link
ContributorAuthor

I couldn't find any semantics testing suite. Do we have such a thing? If so, I can write some tests to make it more clear that this approach doesn't break anything.

@hdgarrood
Copy link
Contributor

I’m not sure what you mean by “semantics testing suite.” More tests might help but they aren’t really a substitute for an explanation of your reasoning and approach.

@rhendric
Copy link
Member

(Attempting to move discussion of the proposal, as distinct from this implementation, to#3967.)

hdgarrood reacted with thumbs up emoji

@radrow
Copy link
ContributorAuthor

My approach is just to alter the conditions for the TCO to trigger while leaving the present loopifier unchanged. Indeed, the only thing I changed was replacing "allInTailPosition" with "anyInTailPosition". The algorithm for resolving the tail calls remains as it was before – so if it was working back then, then should it work now as well. The only issue I can think of is that it may be a bit too much of artificial loops, but this discussion is continued in#3967

By "semantics teseting suite" I meant some already defined way of validating if the generated code evaluates in a desired way. I suspect I could do it by throwing errors on failing assertions in thepassing set, but I didn't see this approach around the code, so I haven't decided to go for it.

@rhendric
Copy link
Member

I suspect I could do it by throwing errors on failing assertions in thepassing set, but I didn't see this approach around the code, so I haven't decided to go for it.

They're in the minority, but a number of tests do use the functions frompurescript-assert; you can grep forTest.Assert to see which ones.

@radrowradrow marked this pull request as draftDecember 17, 2020 20:00
More occasional TCOany/all fixSelf-reference in CONTRIBUTORS
@radrowradrowforce-pushed thefeature/occasional-tco branch fromfdd9558 to0a79a59CompareJanuary 14, 2021 12:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Proposal: Take more opportunities to trigger TCO
4 participants
@radrow@hdgarrood@JordanMartinez@rhendric

[8]ページ先頭

©2009-2025 Movatter.jp