How to reduce binary footprint when using Haskell package 'plugins'? -


I have implemented a simple brain loader for my main HS module for Haschel plugins. Seeing my compiled app size, I show more than 53 MB executable on the x86 architecture, only the only job that I just use from load

I understand that the GHC is connected in large part (due to the Haschel-Source-to-Binary-plugin feature) but it is more for my purposes

Is the officially accepted method and only (dyn-) load ?

Depends on the meaning of 'officially accepted'. Code plugins (formerly known as hs-plugins ) code was designed to be an ultimate solution with generation and dynamic loading features. This is not the goal of minimizing.

A less complex package is available under the direct-plugin name, which focuses on the dynamic loading of the plugin. This package reads the Haskell interface ( .i ) to get the actual type of symbols, so that type-settings are possible, but an unsafe version is also provided. Unfortunately, direct-plugins is a bittrack and does not work with GHC v7.6.

The package is the unix at the very least end of the spectrum, to capture the symbols exported from shared libraries to a delusion / dlsym . A feature layer has also been provided to automatically close open libraries so that processing can be finished. However the symbols are obtained in the form of FFI Ptr s and are not hascal-callable.

By searching the Internet, I have been searching an unseen package, which is running on the middle ground:

  • Dependency and package / module hierarchy can be declared.
  • The dependency environment is managed in a thread-safe way.

    The original package is written by Hempas Ram, I have prepared it for the latest release GHC and has done some very shallow tests. Here is the repository:

    The only missing part is the type-protected symbol access (possibly through the configurable mechanism). Comments and patches are welcome.

  • Comments