News for hackers. Stuff that matters.
Re:Programming languages and their relationship styles by jmillikin on Thursday February 17, 2011 @06:21PM (#2233362)
> the many contrarian (for lack of a better word) choices made in the language design — purity, default laziness, utter rejection of OO.

Haskell isn't a pure language. Its only notable characteristic regarding purity is that it's possible to annotate whether some code is pure or not. Working with impure (and sometimes downright unsafe) is common, encouraged, and widespread. Especially in real-world code.

Haskell doesn't utterly reject OO; if anything, its combination of typeclasses and nearly-free threads brings it closer to Smalltalk or Erlang than many pretend-OO languages (C++, Java, C#).

Default laziness is one of the few truly weird parts of Haskell, and I sincerely doubt the author has done anything serious enough to worry about the evaluation model.

Re:Programming languages and their relationship styles by kenjackson on Thursday February 17, 2011 @06:29PM (#2233387)
Haskell isn't a pure language. Its only notable characteristic regarding purity is that it's possible to annotate whether some code is pure or not.

Isn't this a requirement (the use of the type system for annotating purity), not something that is just "possible". And isn't that what people generally mean by its purity?

Re:Programming languages and their relationship styles by jmillikin on Thursday February 17, 2011 @06:44PM (#2233433)
IMO, a pure language would be one which is incapable of representing impure code. Or at least, where it's very hard. I don't know where the line lies, but I strongly feel that any language that supports manual memory management, pointers, and mutable variables can't properly be called "pure".

Some people get confused between purity and expressiveness. Inexpressive languages like C require using impure constructs to represent fundamentally pure constructs. More expressive languages like Python don't need as many impure workarounds. Haskell, as a very expressive language, can do amazing things in pure code that other languages must resort to impurity for.

If you want a pure language, look into Agda or Coq.

Re:Programming languages and their relationship styles by Dunbar on Thursday February 17, 2011 @07:50PM (#2233656)
Any language that is only pure is about as useful as write-only memory.

Haskell was historically pure and had side effects added as a way to interact with the world. The language enforces (discounting unsafePerformIO) the separation of pure and impure code. That is sufficient to label any practical language pure.

Re:Programming languages and their relationship styles by jmillikin on Thursday February 17, 2011 @08:52PM (#2233835)
> Any language that is only pure is about as useful as write-only memory.

That's actually not true -- you can write the core of a system in a pure language, then use that pure core as a library in larger applications. Pure languages like Coq and Agda are often not Turing-complete, so various sorts of verification and proofs can be applied more easily.