entropy icon indicating copy to clipboard operation
entropy copied to clipboard

RFC: a backend-only version

Open ocramz opened this issue 1 year ago • 2 comments

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 avatar Jun 22 '23 16:06 ocramz

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
  }

ocramz avatar Jul 03 '23 18:07 ocramz

Yes, that's right.

TomMD avatar Jul 16 '23 11:07 TomMD