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

Allow bits to be built for GHCJS #7

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

Conversation

rjmac
Copy link

@rjmac rjmac commented Dec 14, 2014

GHCJS doesn't support linking to C, naturally, so I made Data.Bits.Extras optionally use unsafeIndex into ByteStrings instead of linking to static C arrays.

Now that the tables exist in both C and Haskell, there is a generator script to produce them both so that the canonical list of magic numbers can be in only one place. Cabal doesn't really have great support (or indeed as far as I can tell, any support) for ad-hoc pre-build code generation like this, so it's a Python program with the outputs checked in.

Robert J. Macomber added 3 commits December 13, 2014 09:18
GHCJS of course cannot link to C files, so when compiling there load
those byte arrays into ByteStrings instead of using the FFI.
Make it a cabal flag and centralize the conditional on ghcjs.
From Python because it's likely to be everywhere and Cabal makes it
annoying to write a pre-build code generator.
@ekmett
Copy link
Owner

ekmett commented Nov 1, 2021

7 years later I suppose I should probably merge this. ;)

@rjmac
Copy link
Author

rjmac commented Nov 1, 2021

Heh, maybe. GHCJS isn't super important to me anymore, alas, but maybe it'd be useful for someone!

@RyanGlScott
Copy link
Collaborator

I worry that some of bits' dependencies have become unbuildable on GHCJS in the meantime. For example, bytes now depends on C code as of ekmett/bytes@ce5a26d. If anyone needs GHCJS support for bits, I'd encourage them to pick up this work, but I think we may need to fix some of the dependencies first.

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.

3 participants