Live data from Hacker News

The Haskell Elephant in the Room

stephendiehl.com

251–260 of 341 posts

Re: The Haskell Elephant in the Room

#251
post #40

I've been concerned about this for Rust too, as a lot of the published jobs and high profile projects (including Libra) are in the cryptocurrency sector. For example, one of the most promising rival GUI toolkits, iced, is being sponsored by Cryptowatch. Fortunately, the growth of other sectors is robust enough that if all cryptocurrency were to fall into the ocean, Rust would be impacted but not massively so.

Rust's adoption in the cryptocurrency sector is massive indeed. Parity Technologies and OpenEthereum is the most well known, but both Stellar Development Foundation and Zcash Foundation (both are among top 30 cryptocurrencies) are rewriting their main node implementation in Rust. I'd say at this point Rust has more adoption than both Haskell (Cardano) and OCaml (Tezos).

Grin is perhaps the first cryptocurrency to be written in Rust, starting in October 2016. Its constant 1 Grin per second emission tries to keep speculators at bay.

Re: The Haskell Elephant in the Room

#252
post #241

Earlier quoted context omitted.

I think it is too much a reductionist thinking to think it’s the users, not the tools. Math and programming languages (and media like tv or videogames) can easily stand on the sidelines, outside of the range of criticism, by making the claim that it is not the medium, but the users. But I would argue that knowledge about something is not necessarily within that thing, but around that thing as well. A handle is a hand…

> Or are videogames evil? I'll answer that when you give me a definition of the term. Might want to start with defining "game" and then pare it down. My point is, you can't say something is evil until you have a coherent definition of what that thing is .

Wut

Re: The Haskell Elephant in the Room

#253

Earlier quoted context omitted.

I consider Stephen to be an extremist when it comes to stuff like this. I follow him on twitter, and he frequently tweets things like: "More programmers should have the moral fortitude to stand up to the Facebook employees in their communities. This is not a socially acceptable career. Facebook employees have chosen to turn their skills on poisoning the very communities that gave them opportunities to thrive." [0] "P…

> "What exactly is the point of all of your long codes of conduct and community guidelines if the primary use for your language is the creation of a nightmare surveillance state?" That is a weird point of view, but unfortunately not all that uncommon (when applied as a general worldview) right now. I think it's worth noting that it's generally anti-open source and free software, as it generally boils down to "you sho…

> include the people that made a better hammer because someone used it to build something objectionable.

This is exactly why I find his argument absurd. Programming languages are just tools, there is no moral judgement attached to them. You don't get mad at people who manufacture other tools that are used for nefarious purposes.

Re: The Haskell Elephant in the Room

#254

Earlier quoted context omitted.

This is one of those articles that attempts to talk about some situation to make it more common knowledge, but is written in such an incredibly abstract way that all you can really take away from it is 'some unknown people are upset about some unknown issue'. I feel like this 'elephant in the room' article doesn't tell me what the elephant is, why it's in the room, or why people don't want it to be in the room.

Just look at the final section, quoted: > Painfully, some of the very founding contributors to Haskell itself are the ones deepest involved in this ring. > In this new era the Haskell community itself has simply become a tool to buy legitimacy and pump token values. The reputation of our community is now used to defraud the public and convince non-technical users of the soundness of an utterly unsound investment. > I…

Maybe it's just me, but these sentences are so vague and indirect as to mean nothing to me.

I think it's a shame because if you're going to accuse someone of something, at least make your accusation clear and direct so they can respond to it specifically.

Re: The Haskell Elephant in the Room

#255
post #222
post #146

I find it rather telling that almost none of the crypto advocates in this thread make any argument that cryptocurrencies are not shady. Instead, the counterarguments brought forward are essentially: - "it's not the tool's fault that it's used for shady stuff" - "so what, other people are scammers, too!" - "there are so many warnings against cryptocurrencies, it's getting boring" - "yes, crypto has scams, but maybe so…

"Crypto community" is not a unified group of people, holding hands and singing "kumbaya", you know? Quite the opposite - fights and accusing almost all competing projects of technical and/or moral failures are a bread and butter of crypto. It's safe to say that most people in crypto space admits that the space is somewhat shady. How else could it be? Money are involved so it attracts people trying to exploit it and b…

[deleted]

Re: The Haskell Elephant in the Room

#256

Earlier quoted context omitted.

Fortran is used all over for high performance computing, not just in government contracting. Scheme is not only used for language research. A large part of Julia, a pragmatic language for technical computing, is written in Scheme.

> A large part of Julia, a pragmatic language for technical computing, is written in Scheme. No, not really. The parser is written in FemtoLisp (a Scheme dialect), but that's it. It's not actually doing anything other than the parsing, and there's actually work being done to replace that with a pure julia parser.

In the first paper¹ describing the language design, by its creators, they state that:

“Our implementation of Julia consists of 11000 lines of C, 4000 lines of C++, and 3500 lines of Scheme”.

[1] https://julialang.org/blog/2012/08/design-and-implementation...

Re: The Haskell Elephant in the Room

#257

Earlier quoted context omitted.

I think they are trying to imply that, because some crypto projects are targeting similar markets, there might be some conflict of interest that motivated Diehl to create his post. To me this reads less like a smear and more just "this could be why he dislikes crypto that much".

They aren't really targeting similar markets (at least from my perspective): pretty much any multinational firm can benefit from better corporate treasury management; cryptocurrencies are just one application of this technology, and Stephen is calling out specifically those which are attempting to defraud (or at least benefit from the the gross ignorance of) retail investors. Those seem like entirely different market…

In my opinion, a non-insignificant amount of cryptocurrencies tout a global low-friction exchange system with good APIs as their main feature. I am not qualified to say how related the markets are, but it seems like there is at least some overlap. (E.g. one of the first results I get when googling Adjoint is an interview conducted by a crypto company)

I think our disagreement stems from how vague Stephens post is. By not naming any names he could be accusing any crypto company, including those that might indirectly compete with him, of being fraudulent.

My stance would probably change if someone were to point out one of the "right-wing conspiracy theory cult" Haskell companies that Stephen is alluding to, but as it stands this mainly seems like fearmongering to me.

Re: The Haskell Elephant in the Room

#258

Earlier quoted context omitted.

Haskell's type system is unsound. Here's an example, where we can prove that 1 + 1 = 1: {-# LANGUAGE GADTs, TypeFamilies #-} -- Peano arithmetic: these types represent '0' and '1+n' data Zero data Succ n -- We can define 1 as '1+0', 2 as '1+1', and so on type One = Succ Zero type Two = Succ One -- A closed type family is a function at the type level. -- This function implements addition of the above Peano numbers. ty…

Is this what people mean when they say, Haskell's type system is sound? We know Haskell's type system includes bottom as an inhabitant of every type which enables us to shrug and hand-wave away proofs of termination. As long as one understands that consequence doesn't it pass Milner's definition? I'm happy writing proofs in Lean or Agda but having to avoid or prove termination would be a pain in the rear end for most…

> Is this what people mean when they say, Haskell's type system is sound?

It depends on the context, but it's certainly in common use (e.g. see https://stackoverflow.com/questions/21437015/soundness-and-c... although I switched 'positive' and 'negative' in my example: e.g. I treat 'true positive' as 'correct program was accepted', that link treats 'true positive' as 'error message was justified')

> As long as one understands that consequence doesn't it pass Milner's definition?

Milner's definition is usually summarised as "well-typed programs have well-defined behaviour". Haskell does fit this description, although certain optimisations may be unsound (e.g. library-supplied rewrite rules).

To me, the key deficiency is that Haskell can't ignore 'absurd' branches. For example, let's say we have a function like this:

    foo :: a -> b -> LessThan a b -> Foo
    foo  Zero          (Succ y)  _ = bar y
    foo (Succ x) (Succ (Succ y)) _ = baz x y
If 'a' and 'b' represent numbers (with singleton values), and 'LessThan a b' describes proofs that a http://chriswarbo.net/blog/2014-12-04-Nat_like_types.html for how to encode such proofs), then these two branches form a complete definition of 'foo': the combinations 'foo _ Zero _' and 'foo (Succ x) (Succ Zero) _' can't occur, if we trust the 'LessThan a b' proof. In Agda, Coq, etc. we can either leave out those absurd branches (if the compiler can spot their absurdity), or in more complicated cases we can satisfy the type checker by proving they lead to a contradiction.

In Haskell we can't do this: the type of one argument can't rule-out values of another. Hence we must define those branches (or else leave the implicit "unmatched pattern" error, which is a "bottom"), and we need them to return values of type 'Foo' (which may be impossible to construct, unless we return "bottom"). This satisfies Milner's definition, but also goes too far: we're specifying well-defined behaviour for programs which aren't well-typed! In practice, this leads to redundant branches like 'Nothing -> error "Shouldn't happen"', which (a) introduce potential crashes and (b) are so close to being statically avoided!

> having to avoid or prove termination would be a pain in the rear end for most large programs

It can be. If we're being lazy, we can just wrap things in a 'Delay'/'Partial' type (described a little in the above "nat-like types" link, and also at https://news.ycombinator.com/item?id=17472926) or run proofs in Coq's Mtac language ( https://plv.mpi-sws.org/mtac )

> And in practice I still think of Haskell's type system as sound.

Me too. This tends to be called "fast and loose reasoning" https://www.cs.ox.ac.uk/jeremy.gibbons/publications/fast+loo...

Re: The Haskell Elephant in the Room

#259
post #246

Cryptocurrency enables people to make anonymous monetary transactions. Also, so does cash. Drug dealers and criminals still very much prefer cash. Is it wrong to work with certain traditional finance companies because of their association with cash? Should we be worried about users associating your favorite language with the seedy world of cash transactions which subvert the traditional role and spying capacity of la…

Money laundering costs a ton of money crypto is increasing the profit margins of human traffickers by like 80%. Not that the rest of your argument isn't insane. You can't hand someone a million dollars in cash anonymously.

Re: The Haskell Elephant in the Room

#260
post #220

Earlier quoted context omitted.

Hm, what's the issue with state and branching?

If you build a language that is based around doing everything with stateless data transformations but doesn't address state and branching, it will eventually be a problem, because the reality is that the vast majority of non trivial software needs to deal with plenty of state and branching, not to mention the state and branching that will go in to managing resources. There are a lot of domain specific tools that are…

> If you build a language that is based around doing everything with stateless data transformations but doesn't address state and branching, it will eventually be a problem

I'm assuming you are referring to Haskell? It's a general purpose programming language so of course it handles state, branching, etc...

  data Tree a = Empty | Leaf a | Node a [Tree a]
    deriving stock (Show, Functor, Foldable, Traversable)

  label :: Tree a -> Tree (a, Int)
  label t = evalState (traverse f t) 0 where
    f t' = state (\c -> ((t', c), c + 1))
The above code labels nodes of a multiway tree using a counter. State and branching.
Post reply on HN