Skip to content
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

Bound-check and panic somehow? #48

Open
PallHaraldsson opened this issue May 19, 2023 · 3 comments
Open

Bound-check and panic somehow? #48

PallHaraldsson opened this issue May 19, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@PallHaraldsson
Copy link
Contributor

PallHaraldsson commented May 19, 2023

"Consequently, @inbounds is always on for" why is that? I'm guessing because of exception handling, and it not supported in general.

Since it's so common to NOT us @inbounds, would it be possible to have it but replace it in part, have the beck and just "panic", bomb somehow when you would have thrown?

@brenhinkeller
Copy link
Owner

brenhinkeller commented May 19, 2023

Yeah, that's because we don't have libjulia, so no error handling. If someone wants to make a PR to try turning it on and using the new error override mechanism from StaticCompiler, we could try it at some point.

@PallHaraldsson
Copy link
Contributor Author

The merged PR you link to is on error handling. I scanned the code, but does it mean it works already? Then bounds-checking too? And if not bounds-checking (but error handling works) then why not? I didn't have in mind fixing error handling (e.g. good stack trace) in general, just if out-of-bound panic(), rather than if .. throw ... Anyway, the logic likely belongs in the other repo, also for full error handling. But the docs here and there need to be synced, I'll fix some (other) inconsistencies.

@brenhinkeller
Copy link
Owner

brenhinkeller commented May 19, 2023

So that PR means that people can implement overrides to catch errors, potentially including out-of-bounds errors. For common errors additional rules could be implemented either here or there, but the override functionality is quite new and would probably require some trial and error.

Turning @inbounds off / enabling normal @inbounds functionality on this end would also be a bit nontrivial given the current implementation -- it might actually be a bit easier to just implement our own error message and exit code for out-of-bounds indexing of StaticTools types internally within StaticTools if that is something we generally want.

@brenhinkeller brenhinkeller added the enhancement New feature or request label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants