Defer Haskell type errors to runtime: new GHC 7.6 developers' flag
hackage.haskell.org
hackage.haskell.org
Maybe this means that there are a lot of undetected bugs lurking in the typical gemset but at least you can get something off the ground.
Scala is a dll hell b/c of binary incompatibility and a community that wants all frameworks on bleeding edge Scala (RC even) versions.
Compared to Java, where many frameworks still work with Java 1.5 and dependency management is a joy.
Maybe it's not fair to generalize from just those few examples though.
I thought so for a long time too, but then I discovered `undefined`. You can replace any expression with undefined and if there's a type, it will compile, and explode at runtime when it tries to evaluate it.
This is a very good, and rather unique feature. I have wished for an equivalent when figuring out some stuff in C programs for long time; I cannot imagine a person who has to maintain and change a large program and cannot understand the huge utility of this device.
EDIT: Okay, I can see the point. The linked ticket http://hackage.haskell.org/trac/ghc/ticket/5624 gives a better motivation: being able to load a module that doesn't type check in GHCI and view inferred types, and, maybe, invoke some isolated functions. But why not just limit it to GHCI, though?
And, FFS, would SPJ and Co. please stop breaking core libraries and tools with minor releases? We had to wait for cabal-install to be ported for 7.2 and 7.4 for a couple of months, at least. Why have the bloody Haskell-Platform if you can't keep up with the compiler releases.
If a change in a datatype forces you to update 1000s of LoCs, you are doing something wrong.
1) https://github.com/ghc/ghc/blob/master/compiler/stgSyn/StgSy...
Consider, for example, fixing the Monad class to subclass Applicative. Or to remove the "fail" or (>>) methods.
This would incur a change to many thousands of lines of code.
Similarly, a core/base type of a whole project can be used across an entire codebase. It is possible to discover desirable changes to such a base type, and it will incur a huge change.
I think any notion of blame is really irrelevant here. The discussion was whether this kind of feature is useful. I think you implied it wasn't, because the cases it were useful in are those in which you did something wrong. But that does not follow at all. It is very possible one is to blame for a horrible mistake in the codebase, and that it still needs and can be fixed. This feature makes that fix cheaper and more practical.
That's a strawman. The claim is that it is useful to be able to compile a partially-valid program so that you can:
* Test actually running stuff
* Get the inferred types of expressions
The idea is to temporarily turn it off just to run some tests or infer some types, and then turn it on again for the rest of the work.
I think that you're arguing against a point that no one is making. Everyone agrees you should not use this feature for any other purpose except to temporarily allow some tests and exploration.
The HP doesn't chase the compiler. It is supposed to mean stable 6 monthly dev cycles, independent of what GHC HQ is up to. It is explicitly not about chasing the bleeding edge GHC.
Really? You're going to troll dons on Hacker News?
Massive downvote.
"In this mythical, not yet-existing, but clearly on-the-horizon "Haskell", you'll be able to choose how much safety you want. You'll have "knobs" for increasing or decreasing compile-time checks for any property and invariant you desire."
It might not be "Haskellish" or safe in the way that I or some others are used to, but it does seem to be a clear increase in the expressiveness of the language.
[1] http://axisofeval.blogspot.com/2011/01/why-lisp-is-big-hack-...
Programs that were right before continue to be right. Programs that were wrong before continue to be wrong. What's changed is that programs which were wrong before can now be wrong at runtime rather than at compile time. The parts of the program that don't explode now wouldn't have exploded before. So I don't think that really changes the expressiveness, whatever that means.
I think this change will do wonders for Haskell marketing but I don't think it will have much effect on the day-to-day lives of Haskell programmers.
Summary: useful for developing, capital offense for production code.
People will write bad code regardless of language features. Ignore those people and worry about how people writing good code will use your new feature. If it saves them time, makes their life happier, or lets them write safer code, then it's a win. Similarly, if a feature helps bad programmers avoid today's bad-pattern-du-jour but prevents good programmers from writing good code, you should think twice before adding it. In summary: ignore bad programmers, they can't be saved by language features.
http://www.fatvat.co.uk/2009/09/generating-text-in-haskell.h...
Also: 2 longish threads about this
http://www.reddit.com/r/programming/duplicates/tjeg3/haskell...
I could see leaving out or modifying features that lead to a lot of mistakes, like manual memory management, but this is just a flag useful for debugging--you never have to use it and it does not affect your code at all if you don't use it.
Also, this feature is more like replacing unsafe functions with undefined rather than making everything dynamically typed. For example, it will always error if you run a poorly typed function, regardless of what argument you pass in. And, of course, if you're worried about your co-workers using this flag, you can just recompile without it and fix all the errors.
Also, Perl's philosophy is actually not that far from Haskell's in some ways: Haskell embraces TMTOWTDI and tends to favor more concise code.
This is not about making Haskell dynamically typed. It's about not type-checking code that never runs.
This is real life.