News for hackers. Stuff that matters.
Re:Programming languages and their relationship styles by kenjackson on Thursday February 17, 2011 @04:57PM (#2233047)
I thought she did a good job with Lisp, Logo, and Haskell too. The Ada one left me completely perplexed -- as someone who wrote a fair bit on Ada in the 90s. What does this mean, "However, your tendency to wear the bondage and discipline gear all the time, as opposed to when your lover asks you to bring it out, frightens people off. You need to learn to stop calling people "worm" and "slave" in front of their mothers."?
Re:Programming languages and their relationship styles by chc on Thursday February 17, 2011 @05:20PM (#2233141)
I think it's a reference to Ada's reputation for being a "bondage and discipline language": http://c2.com/cgi/wiki?BondageAndDisciplineLanguage
Re:Programming languages and their relationship styles by archangel_one on Thursday February 17, 2011 @05:49PM (#2233254)
I don't find it works well in this metaphor though, because the stereotype of Ada is that it's straight-laced and proper and thus popular with the Department of Defence. To me that doesn't mesh at all well with this picture of it bringing out the bondage gear to play "Mistress of Pain" of an evening.
Re:Programming languages and their relationship styles by chc on Thursday February 17, 2011 @06:00PM (#2233296)
I agree. I would have gone with a Catholic school headmistress or something like that. I was just explaining where the (overly literal) description came from.
Re:Programming languages and their relationship styles by jmillikin on Thursday February 17, 2011 @05:33PM (#2233197)
I can't speak for LISP or Logo, but her Haskell entry was completely divorced from reality. It would have been a better fit (and somewhat appropriate) if she'd just copy-pasted the OCaml entry.
Re:Programming languages and their relationship styles by chc on Thursday February 17, 2011 @05:42PM (#2233229)
It's a reference to Haskell's extremely elaborate Turing-complete type system and the many contrarian (for lack of a better word) choices made in the language design — purity, default laziness, utter rejection of OO. Most people are unlikely to have used a language like that before. Even OCaml lacks those qualities.

And I don't think anyone would disagree that Haskell is extremely serious about safety ("prophylactic techniques") and carefully marking impure portions of the program by tainting them with IO.

The only part of the Haskell description I didn't get is the "person you're with no longer resembles Haskell."

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.

Re:Programming languages and their relationship styles by eru on Thursday February 17, 2011 @07:11PM (#2233524)
> It's a reference to Haskell's extremely elaborate Turing-complete type system [...]

Haskell's type system is decidable. Thus it can't be Turing complete.

Re:Programming languages and their relationship styles by jmillikin on Thursday February 17, 2011 @07:20PM (#2233561)
With the right combination of language extensions, you can force Haskell's type system to turing-completness; see http://www.haskell.org/haskellwiki/Type_SK
Re:Programming languages and their relationship styles by eru on Friday February 18, 2011 @07:17AM (#2235146)
Yes. But if nothing else is said, I expect people to talk about the standard Haskell 98.

C++'s type system is isomorph to lambda calculus even without extensions, and nobody made this joke there.

Re:Programming languages and their relationship styles by wozer on Thursday February 17, 2011 @06:22PM (#2233368)
I agree in general, but which of "purity, default laziness, utter rejection of OO" does OCaml have?
Re:Programming languages and their relationship styles by chc on Thursday February 17, 2011 @06:31PM (#2233392)
D'oh, none. I originally wrote "…has none of them," looked back and saw "OO," and cleverly "corrected" myself. Thanks for catching that.
Re:Programming languages and their relationship styles by stcredzero on Thursday February 17, 2011 @06:48PM (#2233453)
She got it right with Smalltalk as well.