-
Notifications
You must be signed in to change notification settings - Fork 1
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
Any advantage of using this with Kotlin? #3
Comments
I haven't used Kotlin, but here's what I presume based on the docs for There's no verification. If you apply the optimization provided by this library, you won't get a negative feedback if a method cannot be optimized. Accidental breakage may happen if you're not careful. Kotlin performs weaker analysis. The following is not optimized: val eps = 1E-10 // "good enough", could be 10^-15
tailrec fun findFixPoint(x: Double = 1.0): Double
{
if (Math.abs(x - Math.cos(x)) < eps)
return x
else {
val r = findFixPoint(Math.cos(x));
return r
}
} You can see that the variable This library supports this. For Kotlin:
This is the same for this library. You can use the optimization before and after try-catch blocks, but not inside them. This what I've found based on my understanding of Kotlins |
Kotlin performs weaker analysis. VERY interesting, I wonder if Kotlin compiler developpers could take inspiration / reuse your work or even do a collab with you! |
I wonder how does this compare to kotlin tailrec keyword implementation.
The text was updated successfully, but these errors were encountered: