0

I'm working on an open source Haskell package and I want to use a proprietary package of mine as a dependency without leaking its source code.

One way would be to compile it to a binary and call it via System.Process.callCommand, but this would be unnecessarily inefficient.

Is there another way to distribute the package in a binary format or at least strongly obfuscated?

adius
  • 13,685
  • 7
  • 45
  • 46
  • 1
    You only need the source code to compile it to an object file, which the linker uses to build the final executable. The linker doesn't care if an object file was produced locally or somewhere else. – chepner Nov 29 '21 at 17:11
  • 1
    @chepner That's not quite the whole story, though. For example, GHC wants to type-check calls and know what names are exported by each module, and there's even some cases where actual code wants to float across module boundaries (e.g. inlining or specialization). – Daniel Wagner Nov 29 '21 at 18:34

0 Answers0