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

Remove unsafe perform io #130

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

adrianmay
Copy link

@adrianmay adrianmay commented Mar 18, 2025

This is JP's #84 which removes most uses of unsafePerformIO and changes the Haskell interface to IO, plus:

  • Merges from current master
  • Adaptation of subsequently created benchmark code to the IOish interface
  • A mutex for fec_init that's also free of unsafePerformIO
  • A major version bump
  • Warnings fixed
  • Cabal version constraints reduced to hackage rules only

This PR (or some variation of it) is essential because unsafePerformIO is extremely unsafe. It may stand alone, but I recommend that it be immediately followed by #131 that completely removes fec_init and the Haskell wrapper's initialize, initialising the tables with verbatim values in C, and bumping the major version again.

Bumping the major version twice in quick succession strikes me as less bad than any other option. I wouldn't expect the intermediate version to get used but its existence mitigates any risk in the second PR.

@adrianmay adrianmay marked this pull request as ready for review March 18, 2025 10:41
@adrianmay adrianmay mentioned this pull request Mar 18, 2025
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.

2 participants