[Haskell-cafe] Linking and unsafePerformIO
jules at jellybean.co.uk
Tue Oct 14 09:05:02 EDT 2008
> 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 ;)
More information about the Haskell-Cafe