[Haskell-beginners] Dynamic Loading of Haskell Code!

Jeremy Shaw jeremy at n-heptane.com
Fri Feb 21 20:12:17 UTC 2014


The plugins package is a dying a slow death anyway. (I'm the current
maintainer). The GHC api, with a little bit of glue, seems to replace
everything that current plugins package does -- and better too.

You are correct that loading plugins and static typing are a bit at
odds. If you loading things at runtime, then you have to be willing to
accept that some errors will appear at runtime.

I have developed a generic 'web-plugins' package that supports the
loading of plugins into a running application. The dynamic loading
feature is only proof-of-concept at the moment. But it shows one
system for creating a plugin system,

http://hackage.haskell.org/package/web-plugins-0.2.5/docs/Web-Plugins-Core.html

I am working on a independent library which adds extra wrappers around
the ghc-api to us fsnotify to watch files and automatically
recompile+reload, or to use cabal to fetch, build, and load plugin
libraries from hackage into a running application. It's not a high
priority at the moment though. I'd be happy to put the current code on
github -- I just need a name. I'm not to fond of the name 'plugins'
because it is a bit more general purpose than that and also doesn't
directly provide plugins support -- just the tools need to create a
plugins framework.

- jeremy


On Fri, Feb 21, 2014 at 10:59 AM, Brandon Allbery <allbery.b at gmail.com> wrote:
> On Fri, Feb 21, 2014 at 11:25 AM, Gilberto Melfe <gilbertomelfe at gmail.com>
> wrote:
>>
>>
>> I would like to ask:
>>     Is it possible for a Haskell program to load code while it's running,
>> in order for it to facilitate the implementation of Plugins?
>>     (like it's possible in Perl or Python)
>>
>> Can someone enlighten me, please?
>
>
> There's a plugins package on Hackage for this, but it's something of a pain
> to use.
>  The whole notion of plugins is kinda at cross-purposes with static type
> checking.
>
> --
> brandon s allbery kf8nh                               sine nomine associates
> allbery.b at gmail.com                                  ballbery at sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>


More information about the Beginners mailing list