-
Notifications
You must be signed in to change notification settings - Fork 30
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
Simplify random #314
base: master
Are you sure you want to change the base?
Simplify random #314
Conversation
800ed44
to
d95c9ae
Compare
(For the those of you that got the email, the first build failure was my fault. I had a compile error because some projects were unloaded.) The current build error is with the fable tests. However, the build logs are weird. It sort of looks like it didn't finish. Can someone with fable expertise look into that? |
Looks like a stack overflow, it's all in the
|
Since the tests pass when compiled to .NET/MSIL, this makes me think the problem is a missing feature or bug in the Fable compiler related to recursion. |
Perhaps @ThisFunctionalTom knows why the fable equivalent crashes? |
d95c9ae
to
997a25a
Compare
@ThisFunctionalTom, the
(You can drop --no-build . That just makes it easier to troubleshoot failed builds on the build server.)
When compiling with
I just did some searches. I think my understanding has improved. My impression is that tail call optimization depends on the JavaScript compiler, not the Fable compiler. |
@TysonMN Oh, sorry. Haven't thought about configuration. You are right with 'Release' config it works.
|
Thanks for those instructions. I ran the Fable tests locally. I don't have any additional failures. The full test results are
|
Yeah, you are right, with fable 3.1.1 there are only 3 failing tests.
I also tried running the tests in the browser environment ( Hmmm. I am not sure how we should proceed with this. I think we should ask for help of the fable experts. |
I contribute to |
Can't we call the failing test(s) with |
I do not have a problem if we remove support for fable if it stands in the way, but I will be sad a little 😢. I added the support for it because Hedgehog had no dependencies and I saw an opportunity to easily add support for property based testing to fable (javascript) projects. If it stands in the way let's talk to other contributors and see what they think. The other possibility is to exclude functionality not supported by fable with |
@ThisFunctionalTom, wouldn't this be an accepted solution? |
Yes, of course this will accepted, but if I understood it correctly this PR changes the core of Gen so I am not sure if it will still work with fable or not. If, for example, list generation does not work with fable I am not sure if Hedgehog will be usable with fable. Am I right here or did I misunderstand something? |
You are correct. I wouldn't use a dependency that handles failing tests by ignoring them. |
@TysonMN Do you think it would be possible to use trampoline for TCO in fable? I think fable uses it for async CE. We could still guard the implementation with trampoline just for Fable with What do you think? |
That is very interesting. Thanks for the link. I will look into this. |
I don't think we should stop supporting Fable. We may have to limit parts of the API from being available (and therefor tested) in Fable, if they are unstable in browsers. We also can't let Fable support hold us back, that's why I say we only expose parts of the API that work in Fable for Fable users. That way, Hedgehog can continue to evolve and we can continue to support Fable wherever possible. |
I created this issue in the Fable GitHub. Let's see if someone there can help us. |
This PR simplifies the code in
Random.fs
. This will make it easier to implement the fix for #289.The changes are clearly separated in three commits.
The last commit removes
Random.replicate
. The migration paths is to replacewith