Graham Klyne | 20 Oct 2003 11:08

Library function discovery (was: "listProduct" -- is this a standard function?)

At 16:38 17/10/03 -0700, Brandon Michael Moore wrote:
>The suggestion of a "types that specialize to/unify with this type" search
>would be really useful.

My main interest in Haskell is as a "scripting language" for semantic web 
applications (cf [1] et seq).  Your comment suggests a possible application 
that might be built from the tools I'm currently developing [4].

I would guess it would be feasible to modify Haddock to generate RDF [2] 
descriptions of library functions as an alternative to HTML (or, maybe 
better still, generate a form of XHTML with additional embedded markup that 
can be used to extract RDF from HTML using a simple XSLT stylesheet, cf. [3]).

It would be an interesting test of my inference toolkit to see if it can 
handle the unification required to match function signatures for this;  I 
think it would be moderately straightforward to do in bare Haskell (not 
having to worry too much about language corner cases for such an application).

#g
--

[1] http://www.haskell.org/pipermail/haskell/2003-February/011222.html
-- cites article about what makes a popular language:
    http://www.paulgraham.com/popular.html

[2] http://www.w3.org/TR/REC-rdf-syntax/
     and  http://www.w3.org/RDF/

[3] http://www.w3.org/2001/sw/Europe/200207/rsscal/xslt-rss-events.html
-- This is an example of using one of several techniques described in:
(Continue reading)

David Sabel | 20 Oct 2003 15:16
Picon
Picon

Re: tracing Haskell programs

Hi,

Maybe "Hat" - The Haskell Tracer can help:
http://haskell.org/hat/

----- Original Message -----
From: <wvasconc <at> csd.abdn.ac.uk>
To: <haskell-cafe <at> haskell.org>
Sent: Sunday, October 19, 2003 10:25 AM
Subject: tracing Haskell programs

> Hi folk
>
> Is there a way to follow the "execution" of a Haskell program? What I mean
here
> is a way to see which function definition is being used at any moment, and
how
> the execution control moves around a script file.
>
> If this is a preposterous question, just tell me nicely and I will go
away!
>
> Oh, and if this has been discussed before, please tell me where and I will
chase
> it up.
>
> Thanks!
>
> --
> Wamberto Vasconcelos, PhD          wvasconcelos <at> acm.org
(Continue reading)

Mikael Brockman | 20 Oct 2003 15:29

Re: tracing Haskell programs

wvasconc <at> csd.abdn.ac.uk writes:

> Hi folk
> 
> Is there a way to follow the "execution" of a Haskell program? What I mean here
> is a way to see which function definition is being used at any moment, and how
> the execution control moves around a script file.
> 
> If this is a preposterous question, just tell me nicely and I will go away!
> 
> Oh, and if this has been discussed before, please tell me where and I will chase
> it up.
> 
> Thanks!

It is slightly preposterous; since Haskell programs are referentially
transparent, simply looking at the order in which the program is run
is confusing -- there are no side effects, so the compiler might
generate code whose order of execution is far from the expected.

Nevertheless, there are excellent debugging tools for Haskell:

  * Hat   <http://www.cs.york.ac.uk/fp/hat/>
  * Hood  <http://www.haskell.org/hood>
  * GHood <http://www.cs.ukc.ac.uk/people/staff/cr3/toolbox/haskell/>

Although they don't work like, say GDB, I find them more intuitive,
since they in the spirit of functional programming focus on /what/ a
function calculates instead of /how/.

(Continue reading)

Graham Klyne | 20 Oct 2003 21:06

Re: replacing guile with haskell?

At 18:17 17/10/03 -0400, Isaac Jones wrote:
> > Hmmmm.  I may be able to get by without calling haskell functions from C.
> > Most of the work would be done in C, and haskell would just be the "glue"
> > language to let the user flexibly specify what he/she wants done.
>
>I've always wanted to see some way to do embed Haskell in an
>application the way you can for Guile.  This would be great for
>Embedded Domain-Specific languages :)
>
>Is that what you've got here?

Separately from this thread, it has recently occurred to me that Haskell is 
an ideal tool for implementing "little languages" [1], particularly when 
they are declarative in nature.

Specifically, Haskell's provision of higher order functions makes it 
relatively easy to translate some input language into a corresponding 
function which can then be directly evaluated, without the need for an 
explicit compilation or interpretation component.  (These are some thoughts 
that I hope to explore further in my own work.)

(Of course, this would apply to any language (ML springs to mind) that 
supports higher order functions.)

#g
--

[1] [1] Jon Bentley, Little languages, Communications of the ACM, 
29(8):711--21, August 1986.

(Continue reading)


Gmane