Skip to content

Comments

Simplify tryParseImpl & fail#36

Open
nikitabobko wants to merge 1 commit intoalllex:mainfrom
nikitabobko:bobko/simplify-suspend-usage
Open

Simplify tryParseImpl & fail#36
nikitabobko wants to merge 1 commit intoalllex:mainfrom
nikitabobko:bobko/simplify-suspend-usage

Conversation

@nikitabobko
Copy link

Effectively, the way coroutines are used here is to mimic checked exceptions.

This patch makes it more obvious and simplifies the implementation

debugMode is aparently no longer needed since we don't juggle Continuations as actively as before


Feel free to reject the PR for whatever reasons, I might be not following some of the steps to make the PR practical (for example, if you care about binary compatibility, I change some public APIs), my interest is purely theoretical.

I primarily submit the PR to let you know that the implementation can be simplified as I was reading trying to understand what the suspend machinery is for until I realized that it's just actually to mimic checked exceptions.

Effectively, the way coroutines are used here is to mimic checked
exceptions.

This patch makes it more obvious and simplifies the implementation

`debugMode` is aparently no longer needed since we don't juggle
Continuations as actively as before
@nikitabobko
Copy link
Author

nikitabobko commented Aug 20, 2025

I verified the validity of my patch by running ./gradlew --rerun-tasks jvmTest :demo:jvmTest :benchmarks:test which hopefully run all tests...

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.

1 participant