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

RFC: a backend-only version #82

Open
ocramz opened this issue Jun 22, 2023 · 2 comments
Open

RFC: a backend-only version #82

ocramz opened this issue Jun 22, 2023 · 2 comments

Comments

@ocramz
Copy link

ocramz commented Jun 22, 2023

Hi, while I appreciate the need for a truly platform-independent source of cryptographic entropy, the JS dependencies are very heavy.

Would you be open to a smaller, upstream package called say entropy-backend that provides the Unix and Windows stuff, imported by this one which then will provide the JS interface and reexport the other ones too?

@ocramz
Copy link
Author

ocramz commented Jul 3, 2023

Do I understand correctly that the impl(ghcjs) || os(ghcjs) in the library stanza of the .cabal file makes it so that the JS dependencies are not active when the compiler is not GHCJS?

library
  ghc-options:  -O2
  exposed-modules: System.Entropy
  if impl(ghcjs) || os(ghcjs)
    other-modules: System.EntropyGhcjs
  else {
    if os(windows)
      other-modules: System.EntropyWindows
    else {
      other-modules: System.EntropyNix
    }
  }
  other-extensions:    CPP, ForeignFunctionInterface, BangPatterns,
                       ScopedTypeVariables
  build-depends:       base >= 4.8 && < 5, bytestring

  default-language:    Haskell2010

  if impl(ghcjs) || os(ghcjs) {
    build-depends:     ghcjs-dom >= 0.9.5.0 && < 1
                     , jsaddle
  }

@TomMD
Copy link
Collaborator

TomMD commented Jul 16, 2023

Yes, that's right.

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

No branches or pull requests

2 participants