-
Notifications
You must be signed in to change notification settings - Fork 53
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
What exactly guarantees that all of the produced codes have exactly the same behavior? #157
Comments
There is no guarantee of exactly same behavior for all target languages in all possible scenarios. For instance, negative-indexing an array:
It's best to have automated tests for your code. |
What about if we assume that the programmer does not do anything stupid, is the code on targets then the equivalent program? |
Also, since tests (to me) are not always trivial, then is some input and output test sufficient to verify that the programs are correct? |
Yes, that's the essence of Fusion.
There is no such thing as "universal tests". Tests are always specific to the code you write. For example, a Fusion project called RECOIL contains a test suite of 1000+ input files and one can check if a code change doesn't break any of them by comparing the outputs with reference PNG files. In a fully automated way, of course.
|
Okay now I understand what you mean by testing. |
Yes, but I think checking Fusion code manually is certainly more complex than if one just wrote the program in one language by hand. Therefore I think that a Fusion user just needs to trust Fusion as a black box to do what's expected. However, from a compiler perspective I was a bit skeptical as to whether all targets can actually work and not have some corner cases etc. |
That might sound scary at first, but:
|
What exactly guarantees that all of the produced codes have exactly the same behavior?
I want to trust that the resulting codes are functionally the same, but since there can be a lot of it, verifying it manually sounds unideal.
The text was updated successfully, but these errors were encountered: