Re: [Haskell-cafe] Re: Linking and unsafePerformIO

2008-10-15 Thread wren ng thornton

Mauricio wrote:


What I actually want to use that way are build
time configs. For instance, 'isThisLibraryThreadSafe'
or 'maximumNumberOfBigObjects'. Actually, I don't
know why people allow build time options at all.
We always use the "best set of options", and the
alternatives are there just to compel us to check
for them :)

MaurĂ­cio


Why not just have a Haskell module (that defines a number of CAFs) be 
your build-time config? Unless there's an important reason to be using 
the FFI, this seems like a much simpler approach. Xmonad and Yi use a 
similar technique even for load-time constant configurations.


--
Live well,
~wren
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Linking and unsafePerformIO

2008-10-14 Thread Mauricio

Hi,

If I have a Haskell wrapper (with unsafe...)
over a function that's never going to return
different values and is always side-effect
free, but can change depending on compile time
options of its library; my program is running,
and then the version of my library is updated
by my distribution smart instalation system,
which does update versions of libraries in
use; is it possible that I get a wrong behavior
of my program?

I do not understand enough about package
management to understand how running programs
or libraries are updated, and less about how
linking works between Haskelll and libraries
on other languages, so I don't know if my
program is guaranteed to stay with a single
version of a library for each run.

(Sure this is a weird situation, but I do
like to think about worst cases.)


In practice that is fine, with current RTSes and so on.

In principle it's not fine. A 'constant' should be constant over all 
time, not just constant over a particular library version or sub-version 
or a particular program invocation or OS or


Who knows, maybe some future haskell runtime will be able to perform the 
trickery you describe and will cause this to break ;)




What I actually want to use that way are build
time configs. For instance, 'isThisLibraryThreadSafe'
or 'maximumNumberOfBigObjects'. Actually, I don't
know why people allow build time options at all.
We always use the "best set of options", and the
alternatives are there just to compel us to check
for them :)

MaurĂ­cio

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe