Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Dynamic Loading of Haskell Code! (Gilberto Melfe)
   2. Re:  Dynamic Loading of Haskell Code! (Oliver Charles)
   3. Re:  Dynamic Loading of Haskell Code! (Brandon Allbery)
   4. Re:  Dynamic Loading of Haskell Code! (Jeremy Shaw)


----------------------------------------------------------------------

Message: 1
Date: Fri, 21 Feb 2014 16:25:13 +0000
From: Gilberto Melfe <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Dynamic Loading of Haskell Code!
Message-ID:
        <cah5k6k6szvofwnzjtczawhgessokcone3kg8wmk-fjrzjx2...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi there All!

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?

Thank You

Gilberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140221/b6e369a8/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 21 Feb 2014 16:54:46 +0000
From: Oliver Charles <[email protected]>
To: Gilberto Melfe <[email protected]>, [email protected]
Subject: Re: [Haskell-beginners] Dynamic Loading of Haskell Code!
Message-ID:
        <877g8ojtih.fsf@nixos.i-did-not-set--mail-host-address--so-tickle-me>
Content-Type: text/plain

Gilberto Melfe <[email protected]> writes:

> Hi there All!
>
> 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)

One possible solution is the Haskell `hint` library:

    http://hackage.haskell.org/package/hint

This uses the GHC API to allow you to compile strings into Haskell
functions at runtime. This is a lot like `eval` in other languages.

- ocharles


------------------------------

Message: 3
Date: Fri, 21 Feb 2014 11:59:49 -0500
From: Brandon Allbery <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Dynamic Loading of Haskell Code!
Message-ID:
        <CAKFCL4X7mLCJbNsFkaFHbBm1SB+mnO6CU=vuavrpeivfxoe...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Fri, Feb 21, 2014 at 11:25 AM, Gilberto Melfe <[email protected]>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
[email protected]                                  [email protected]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140221/43dd7ade/attachment-0001.html>

------------------------------

Message: 4
Date: Fri, 21 Feb 2014 14:12:17 -0600
From: Jeremy Shaw <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Dynamic Loading of Haskell Code!
Message-ID:
        <CAGE_JKa=w9jf_5m-w0hze6hqroe9nycra6pcugfs90ollda...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

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 <[email protected]> wrote:
> On Fri, Feb 21, 2014 at 11:25 AM, Gilberto Melfe <[email protected]>
> 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
> [email protected]                                  [email protected]
> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 68, Issue 20
*****************************************

Reply via email to