Re: Forward compatibility (was Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature)

2009-06-24 Thread Luke Palmer
On Tue, Jun 23, 2009 at 8:28 PM, Brandon S. Allbery KF8NH 
allb...@ece.cmu.edu wrote:

 On Jun 23, 2009, at 05:20 , Luke Palmer wrote:

 obsolete now, will your code still work when they are gone?  Will it still
 work when the typeclass resolution algorithm is obsoleted by a superior
 algorithm (I'm looking at you, Oleg! :-)?  When Haskell is obsolete, how
 hard will it be to port?


 This is the point at which 99% of programmers throw up their hands at the
 futility of trying to guess what lies 20 years in the future, and just
 writes the fscking code.  I mean, you've just ruled out both Haskell98 *and*
 Haskell-with-extensions.


What?  I didn't mean to.

In case I wasn't clear enough, by the typeclass algorithm, I mean the
algorithm for inference with typeclasses -- the semantics would be the
same.  Many of Oleg's famous hacks are sensitive to the specific way GHC
searches for instances, which I did intend to rule out.

And how hard will it be to port is about the essence of the code.  I'm
trying to rule out code which is not correct and meaningul at its heart, but
which may rely on syntactic tricks (eg. printf emulation, Monads which
don't satisfy the laws just for the notation, ...), or operational tricks
such as unsafeInterleaveIO.  Code that has an air of a  mathematical model
is much more likely to be portable.

I think typical Haskell code will end up having a much longer life than
typical C code, even if Haskell dies when C is still in use.  But a small
fraction Haskell code is *just* Haskell code, and I try not to write that
kind.  Really, such mindfulness is a lot easier than it sounds, because we
are using such a beautiful, essentially simple language.

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


Re: Forward compatibility (was Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature)

2009-06-23 Thread Matthijs Kooijman
Hi Luke,

   Simple: the definition of MonadState uses those extensions.
  [Snip question: Is this extension supported by all compilers]
 You should treat all compilers the same way as a universal quantifier in
 mathematics.  It's not just all the compilers you know about, but all
 possible compilers.  In which case the answer to your question is of course
 no.

I think the reasoninging here is the following: If MonadState is part of the
standard library and it needs this extension to work, then all compilers must
support this extension.

I'm not completely sure how standard the MonadState class is though. Also,
it might be that there could be implementations of MonadState that do not use
the extension?

If the latter is not the case, so MonadState will always require this
extension, than it seems that using the extension in your code gives you the
same portability as using the MonadState class. Not using the extension to
improve your portability only makes sense if you also stop using the
MonadState class, right?

Gr.

Matthijs


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


Re: Forward compatibility (was Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature)

2009-06-23 Thread Brandon S. Allbery KF8NH

On Jun 23, 2009, at 05:20 , Luke Palmer wrote:
obsolete now, will your code still work when they are gone?  Will it  
still work when the typeclass resolution algorithm is obsoleted by a  
superior algorithm (I'm looking at you, Oleg! :-)?  When Haskell is  
obsolete, how hard will it be to port?


This is the point at which 99% of programmers throw up their hands at  
the futility of trying to guess what lies 20 years in the future, and  
just writes the fscking code.  I mean, you've just ruled out both  
Haskell98 *and* Haskell-with-extensions.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe