cashew-s-engine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [CASHeW-s-engine] Shinyness (Dynamic Haskell)


From: Andrew John Hughes
Subject: Re: [CASHeW-s-engine] Shinyness (Dynamic Haskell)
Date: Mon, 29 Nov 2004 16:05:28 +0000

On Mon, 2004-11-29 at 13:59, Simon Foster wrote:
> I think I may have found (well I say found, I knew about it already,
> just hadn't discovered this part of it yet) the answers to a number of
> problems. We were talking about the loading of and execution of Haskell
> code for our OWL-S extensions. Well quite simply, Don's hs-plugin
> library can _already_do_this_ and it's type-safe. How? Simple, he
> provides a function called eval;
> 
> eval :: Typeable a => String -> [Import] -> IO (Maybe a)
> 
> Where the String is Haskell code you want to evaluate and the list is
> any imports required. This lovely function apparently allows the
> evaluation of arbitrary Haskell code (providing it's valid of course)
> and will return either a value or Nothing depending on 
> 
> - Whether it's valid Haskell code
> - Whether it type-checks.
> 
> Any it also throws a number of exceptions to aid in error checking.
> 
> It also works (also a bonus);
> 
> Prelude Eval.Haskell> i <- eval "1 + 6 :: Int" [] :: IO (Maybe Int)
> Prelude Eval.Haskell> i
> Just 7
> Prelude Eval.Haskell>
> 
> Website at:
> 
> http://www.cse.unsw.edu.au/~dons/hs-plugins/hs-plugins.html
> 
> I've installed the appropriate packages, and it seems to work. If it
> does do what we want, it should allow us to do quite a number of things
> we couldn't do before, but completely safely (unlike Lisp).
> 
> -Si.
> 
> 
> 
> 
> _______________________________________________
> CASHeW-s-engine mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/cashew-s-engine

Great!  I'd hoped there'd be something like this, which allows you to
evaluate arbitrary code blocks.  Perl has something similar.

Personally, I think we should go for a combination of the options Barry
suggested.  Using this, we can allow for arbitrary Haskell functions to
be added, but we should also have a standard library of useful
functionality.  We want non-Haskellians to be able to use this
(including those who don't even know Java!)

BTW, you seem to have invented a new word - 'permissionized' -- George
Bush, I salute you! ;)

Cheers,
-- 
Andrew :-)

Please avoid sending me Microsoft Office (e.g. Word, PowerPoint) attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

No software patents in Europe -- http://nosoftwarepatents.com

"Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn."
-- Richard Stallman

"We've all been part of the biggest beta test the world has ever known --
Windows"
-- Victor Wheatman, Gartner

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]