Simon Marlow | 1 Jun 2009 13:15
Picon

Re: ghc - force library search order

On 29/05/2009 15:19, John Lask wrote:
>
> ----- Original Message ----- From: "Duncan Coutts"
> <duncan.coutts <at> worc.ox.ac.uk>
> To: "John Lask" <jvlask <at> hotmail.com>
> Sent: Friday, May 29, 2009 8:09 PM
> Subject: Re: [Haskell-cafe] ghc - force library search order
>
>
>> On Fri, 2009-05-29 at 18:08 +1000, John Lask wrote:
>>> I need to force a library to be searched for unresolved symbols after
>>> all
>>> other libraries have been searched, and I would rather not resort to
>>> constructing the linker command line directly. Is there a way to do
>>> this?
>>>
>>> i.e. I want for example -lfoo to appear after all other haskell
>>> libraries
>>> and before system libraries (for example -lmsvcrt) once ghc has
>>> constructed
>>> the link command. i.e. how is it possible to coerce ghc into respecting
>>> dependencies between the libraries. GHC does a good job in general with
>>> native libraries, but there are allways corner cases.
>>>
>>> I have a feeling this is not possible, but it dosn't hurt to ask.

No, there's currently no way to inject flags that come *after* the 
linker flags for the packages on the linker command line.

It might help if you describe at a higher level what it is you're trying 
(Continue reading)

Jost Berthold | 1 Jun 2009 23:08
Picon
Favicon

IFL 2009 - 2nd Call for papers

Apologies for multiple copies.

Jost Berthold

Call for Papers 
IFL 2009
Seton Hall University
SOUTH ORANGE, NJ, USA
http://tltc.shu.edu/blogs/projects/IFL2009/

** NEW **

Accomodations information available: http://tltc.shu.edu/blogs/projects/IFL2009/accommodations.html

Jane Street Capital has joined IFL 2009 as a sponsor

*********

The 21st International Symposium on Implementation and Application of Functional Languages, IFL 2009,
will be held 
for the first time in the USA. The hosting institution is Seton Hall University in South Orange, NJ, USA and
the 
symposium dates are September 23-25, 2009. It is our goal to make IFL a regular event held in the USA and in 
Europe. The goal of the IFL symposia is to bring together researchers actively engaged in the
implementation and 
application of functional and function-based programming languages. IFL 2009 will be a venue for
researchers to 
present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the 
(Continue reading)

John Lask | 2 Jun 2009 01:30
Picon
Favicon

Re: ghc - force library search order

I hav a module that depends upon (binds to) the microsoft uuid.lib 
(libuuid.a) this is a static library which exports some labels such as 
IID_IPersistFile. I was playing around with trying to get it to work both 
with normal compiling via ghc and to dynamically load in ghci. As we know, 
ghci can't load static libraries and so was not able to resolve the linkage. 
I therefore decided to directly incorporate the objects of (libuuid.a) into 
the haskell .a and ghci .o file (ghci) . To do this I needed to 
ject   --whole-archive libuuid.a --no-whole-archive (or alternatively the 
list of objects) into the link command at an appropriate point to enable the 
resolution of the linkage.

I have achieved my goal but only by constructing the list of objects to link 
entirely manually, constructing both the .a and .o for the haskell library 
manually. I am not satisfied with this solution as it is fragile wrt changes 
in the module structure of the library I have constructed.

jvl

----- Original Message ----- 
From: "Simon Marlow" <marlowsd <at> gmail.com>
To: "John Lask" <jvlask <at> hotmail.com>
Cc: <glasgow-haskell-users <at> haskell.org>
Sent: Monday, June 01, 2009 9:15 PM
Subject: Re: ghc - force library search order

> On 29/05/2009 15:19, John Lask wrote:
>>
>> ----- Original Message ----- From: "Duncan Coutts"
>> <duncan.coutts <at> worc.ox.ac.uk>
>> To: "John Lask" <jvlask <at> hotmail.com>
(Continue reading)

Duncan Coutts | 2 Jun 2009 11:38
Picon
Picon
Favicon

[Fwd: OSX installer -- first draft]

OSX users,

please could you try out Gregory's Haskell Platform package below and
send commentary to the platform list, or file tickets in the platform
trac, that'd be great.
http://trac.haskell.org/haskell-platform/newticket?component=OSX%20installer

The plan is that for ghc-6.12 and onwards, that this will be the primary
way that end-users get their Haskell goodness on OSX, so it's important
that you provide feedback now so that we can get the thing working
nicely and try to make everyone happy.

I'm sure Gregory would also appreciate help in working out how to make
the OSX .pkg tools behave properly.

Duncan

-------- Forwarded Message --------
> From: Gregory Collins <greg <at> gregorycollins.net>
> To: haskell-platform <haskell-platform <at> projects.haskell.org>
> Subject: OSX installer -- first draft
> Date: Tue, 02 Jun 2009 00:20:18 -0400
> 
> Hi all,
> 
> After months of intense frustration I have something approaching a
> reasonable OSX installer for the Haskell Platform. I'd appreciate it if
> some OSX hackers could try it out.
> 
> The installer can be downloaded from:
(Continue reading)

Simon Marlow | 2 Jun 2009 12:43
Picon

Re: ghc - force library search order

On 02/06/2009 00:30, John Lask wrote:
> I hav a module that depends upon (binds to) the microsoft uuid.lib
> (libuuid.a) this is a static library which exports some labels such as
> IID_IPersistFile. I was playing around with trying to get it to work
> both with normal compiling via ghc and to dynamically load in ghci. As
> we know, ghci can't load static libraries and so was not able to resolve
> the linkage. I therefore decided to directly incorporate the objects of
> (libuuid.a) into the haskell .a and ghci .o file (ghci) . To do this I
> needed to ject --whole-archive libuuid.a --no-whole-archive (or
> alternatively the list of objects) into the link command at an
> appropriate point to enable the resolution of the linkage.
>
> I have achieved my goal but only by constructing the list of objects to
> link entirely manually, constructing both the .a and .o for the haskell
> library manually. I am not satisfied with this solution as it is fragile
> wrt changes in the module structure of the library I have constructed.

Right, GHCi doesn't work very well with static libraries.

You can extract the contents of libuuid.a into a single .o file, and 
link this in - it sounds like that's what you're doing.  In order to be 
able to use this without manual hackery, you will need to construct a 
Haskell package that only tries to link libuuid.a when in batch-linking 
mode (not GHCi).  I think you can do this by given an empty 
extra-ghci-libraries field.  And then you'll need to add uuid.o to the 
command line when starting GHCi.

Cheers,
	Simon

(Continue reading)

Simon Marlow | 2 Jun 2009 13:13
Picon

Re: Should exhaustiveness testing be on by default?

On 28/05/2009 15:09, Claus Reinke wrote:
>>> One thing that wasn't available when this discussion was last active
>>> is 'mapException' (btw, similar to 'catch'/'catches', a 'mapExceptions'
>>> would be useful). For instance, appended below is the example from that
>>> wiki page, with entirely local transformations to add source locations
>>> and to use that info to augment 'ErrorCall' exceptions (we should really
>>> augment 'PatternMatchFail' exception messages as well..).
>>>
>>> $ ghc -e main callstack.hs
>>> <interactive>: hd: empty list
>>> ("callstack.hs",25)
>>> ("callstack.hs",21)
>>> ("callstack.hs",16)
>>> ("callstack.hs",13)
>>
>> Your example is giving you the dynamic call stack. Is that really what
>> you want? The dynamic call stack will often be quite different from
>> the structure of your program, may well be surprising, and may even
>> differ depending on compiler flags.
>
> Given the source locations, the lexical _position_ is obvious,

You mean the call site?  Yes, most methods will point you to the call 
site, since the top element of the dynamic stack is often the same as 
the top element of the dynamic stack (but not always).  The call site on 
its own is often not enough, however - it's just one level of the stack.

> so for mere
> traces, dynamic seems to be the choice (with an option of pseudo-cbv
> or the real dynamic stack).
(Continue reading)

Simon Marlow | 2 Jun 2009 13:57
Picon

Job for someone: make a VM image for GHC development

I forget who mentioned this to me, but I think it's a great idea.

Things like VirtualBox and VMWare are pretty easy to install and set up 
these days.  It wouldn't be hard for someone to create a VM image of a 
Linux system with a complete GHC development environment set up and 
ready to go.

This would have a lot of benefits:

  * Easy to buy into: just install VirtualBox (or whatever), download
    the image, register it and away you go.

  * Would make the barrier to entry much lower for someone who wants
    to make a small change, e.g. to the docs, or a library.  validate
    and 'darcs send' would Just Work.

  * Would serve as an example of best-practice in setting up a GHC
    development environment.

The hard part might be optimising the install so that we don't end up 
with an enormous image file.  We'd probably need to find a suitably 
minimal Linux install, or start from an existing minimal Linux VM image.

Anyone feeling keen?

Cheers,
	Simon
Peter Hercek | 2 Jun 2009 21:34
Picon

Re: Should exhaustiveness testing be on by default?

Simon Marlow wrote:
> On 28/05/2009 15:09, Claus Reinke wrote:
>> so for mere
>> traces, dynamic seems to be the choice (with an option of pseudo-cbv
>> or the real dynamic stack).
>
> I don't know what pseudo-cbv is.  And I claim the dynamic stack is 
> almost never what you want.
>
> Ok, so there's one place you might want to see the dynamic stack: when 
> catching exceptions raised by pure code.

Would it not help also when finding out why some code is not as lazy as 
it is hoped for? Now, I do not know how often this problem happens, I 
did not have it yet, but it looks like it would help. I remember I also 
wanted it when I was trying to understand how uulib works. I would 
expect it to be useful anytime laziness is critical for efficient 
program execution.

If the stacks do not come with variables in the scope available then 
both are useful about the same from my rather unexperienced point of view.

Anyway, after I'd learned to use GhciExt (thank you both for helping me 
out with it), the next command became more important to me than the 
stack. That is for my code, if/when I get to uulib again I may change my 
mind quickly :-D

Peter.
Axel Simon | 2 Jun 2009 23:19
Picon
Picon
Favicon

Re: Problem with profiling


On May 31, 2009, at 21:20, Marco TĂșlio Gontijo e Silva wrote:

> Hello,
>
> recently there was a thread about a problem in profiling in
> gtk2hs-users, and it was menitoned that this could be a GHC6 bug.
>
> The problem is described in
> http://sourceforge.net/mailarchive/forum.php? 
> thread_name=1242762143.18742.277.camel%40zezinho&forum_name=gtk2hs- 
> users .
>
> Do you think this is a gtk2hs specific problem, or is it something  
> about
> GHC?
>

Are you sure that you compiled from scratch, i.e. did you do a 'make  
distclean'? You could try to give --disable-split-objs to configure  
and see if that helps.

Axel.
Milan Straka | 3 Jun 2009 11:58
Picon
Gravatar

Choosing implementation depending on class instances using rewriting rules

Hi,

I am interesting in writing a method nub in such a way, that it will
use O(N^2) trivial algorithm for types with equality only, and O(N log N)
algorithm for comparable types. I would like to say

  class Nub where nub :: [a] -> [a]
  instance Ord a => Nub a where nub = nubOrd
  instance Eq a => Nub a where nub = nubEq

which is of course not valid Haskell. I tried using GHC rewriting rules
to achieve this. My first try was

  {-# NOINLINE nub #-}
  nub :: Eq a => [a] -> [a]
  nub xs = ...

  nubOrd :: Ord a => [a] -> [a]
  nubOrd xs = ...

  {-# RULES "nub/nubOrd" nub = nubOrd #-}

which does not work either, because of missing an Ord a context. I was not
able to write the rule which would fire.

Is there a way to write such a rewriting rule or there is no way of acquiring
the Ord dictionary in rewrite rule? Or does anyone know any other way
of implementing such a nub without explicitly listing all Ord instances?

I wish you a nice day,
(Continue reading)


Gmane