Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8619645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:23:25+00:00 2026-06-12T06:23:25+00:00

I have implemented a simple-minded loader for haskell plugins to my Main.hs module. The

  • 0

I have implemented a simple-minded loader for haskell plugins to my Main.hs module. The only function I use right now is load from this site

Looking at my compiled application size shows me an over 53 MB executable on the x86 architecture. I understand that big parts of GHC are linked in (due to the haskell-source-to-binary-plugin feature) but this is overkill for my purposes.

Is there an officially sanctioned way to shave off the extra features and only keep (dyn-)load?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:23:26+00:00Added an answer on June 12, 2026 at 6:23 am

    Depends on the meaning of ‘officially sanctioned’. plugins (formerly known as hs-plugins) was designed to be an all-encompassing solution, with code generation and dynamic loading features. It does not aim at minimality.

    A less complex package is available under the name direct-plugins, which focuses on the dynamic loading of plugins. This package reads Haskell interface (.hi) files to obtain the actual types of symbols, so that type-safeness is possible, but an unsafe variant is also provided. Unfortunately direct-plugins is bitrotten and does not work (a.t.m.) with GHC v7.6.

    At the lowest end of the spectrum there is the unix package which provides a dlopen/dlsym-like mechanism to get hold of symbols that are exported from shared libraries. A convenience layer is also provided to automatically close open libraries after processing with them has terminated. However the symbols are obtained as FFI Ptrs and are not Haskell-callable.

    By searching the internet I discovered an abandoned package that seems to be operating at middle ground:

    • loading of symbols with Haskell calling convention is provided
    • dependencies and package/module hierarchy can be declared
    • dependency environment is managed in a thread-safe way.

    The original package is authored by Hampus Ram. I have only prepared it for the latest released GHC and did some very shallow testing. Here is the repository:

    https://github.com/ggreif/dynamic-loader

    The only missing part is type-safe symbol access (by a possibly configurable mechanism).
    Comments and patches welcome.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented a simple linux shell in c. Now, I am adding some
I've got a simple C class I have implemented, using function pointers in a
I have implemented a few Java applications now, only desktop applications so far. I
I have implemented a simple linked list class and I would now like to
I have implemented a simple Android application that I now would like to test
I have implemented a simple search function that highlights a row in a DataGrid
I have implemented a simple entity ejb with a @version annotation. I expect that
I have implemented a simple RSS reader in Java. I hit a URL and
I have implemented my own simple version of a navigation window, mainly because navigation
I am creating a simple messaging system in WCF and have implemented a minimal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.