Live data from Hacker News

Haskell for a New Decade [pdf]

dev.stephendiehl.com

101–110 of 190 posts

Re: Haskell for a New Decade [pdf]

#101

Why Haskell, and why not just write it in Lisp? It appears Lisp has proven itself consistently, at solving difficult problems.

I've been paid to write Lisp most of my career. Most new languages I check out seem like some variant of C or a dumbed-down version of Lisp. Haskell is the only one that seems like an actual upgrade from Lisp, in that there are things you can do in Haskell that would be quite difficult to shoehorn into Lisp without changing Lisp in fundamental ways. (A statement I never thought I would make before I found Haskell.) T…

Out of curiosity, how and how often do you make use of Haskell's laziness, and how often does it get in your way?

And yes, the syntax of Haskell (besides unary minus) really does feel like it's close to some kind of optimum.

Re: Haskell for a New Decade [pdf]

#102

I tried twice to get started with Haskell. I understand the language well enough, but the standard prelude gave me problems. I forget the details, but the first attempt involved reading ASCII strings from file. I had some issue with the standard string type and after a bunch of searching and trying other things, nothing worked. The second time I tried to use sockets. After a few days, I discovered sockets were both b…

There does seem to be a issue with discoverability in Haskell. I'm cooking up a plan to try to improve the situation: https://github.com/tomjaguarpaw/tilapia/issues/13

> I discovered sockets were both broken and deprecated.

Just in case anyone gets the wrong end of the stick, "Haskell sockets" are both working and supported (quotation marks because there is no single blessed implementation: sockets are just a (few) library(ies)). When people want help choosing a library, I point them to https://haskelliseasy.readthedocs.io/en/latest/, which is an opinionated, curated list.

Re: Haskell for a New Decade [pdf]

#103
post #37

Earlier quoted context omitted.

Counter point on "investment": I was in a Haskell team at Google, and have trained groups at various companies professionally. From that experience, for a normal developer with working experience in Java, Python, or C++: * It takes 2-3 weeks of full-time onboarding (half with a coach, half self-study) to work on a typical industrial Haskell project. * It takes around 3 months of full-time participation in such a proj…

Thanks for that. Everything you said is from the perspective on being not only in a Haskell job but in a Haskell team. Your 3 months is 5 years for someone trying to learn on their own in their spare time. And then they need this to get a Haskell job due to the competition for such job and the queue of super smart people lining up for a Haskell job. And the pay cuts are brutal. Now you are an outlier, working on a Ha…

I've used lens for years and years, but don't fully grok it. Who cares? Lens is also like category theory, you don't need to understand the details in order to use it.

Re: Haskell for a New Decade [pdf]

#104
post #100

Earlier quoted context omitted.

Is Standard Chartered the bank that actually uses its own eager subset of Haskell and built everything in it from scratch?

I'm not sure if you're being facetious or asking a genuine question. The answer is "yes", with the exception of the word "actually". The "eager subset" was written to target a pre-existing runtime, which before then only supported an in-house, fairly poorly-designed, functional language called Lambda. Some of the team there wanted to be able to use Haskell instead (understandably). For stuff that doesn't require that…

> I'm not sure if you're being facetious or asking a genuine question.

A genuine one. I remember a presentation by a bank about their use of Haskell, and wasn't sure if it was Standard Chartered. I remember they had the subset, and mentioned they basically had to a lot from scratch to interface with various systems.

And now that I have the name, I found a link to someone's copy: https://dshevchenko.biz/hs-research/Haskell-in-the-Large.pdf (used to be available at code.haskell.org). My recollection of the paper isn't perfect :)

> My understanding is that they are progressively moving more and more to GHC, although my knowledge is five years out of date.

Ah, thank you!

Re: Haskell for a New Decade [pdf]

#105

I think the focus on Haskell is missing the mark a bit. Haskell is about programming language researchers and enthusiasts having a excellent example language to try out ideas. Over the years it has turned into a production ready platform. As the PDF shows there are many languages spun off Haskell and it doesn't even mention them all. Then there are language features in C# and Java, Typescript etc. that are coming acr…

I love haskell, but personally don't want haskell ideas to be popular until they're possible for a given language. Yes, lazy evaluation and tail-call recursion are awesome... At least they are in haskell. Outside of haskell, it's just a fun trivia fact that some other language does it.

Re: Haskell for a New Decade [pdf]

#106
post #62

Earlier quoted context omitted.

> “secret weapon” and do not advertise it Both Standard Chartered and Barclays loudly advertise that they use Haskell. A quick web search turns up their job offers on Reddit, and both also send people to conferences such as Haskell eXchange, to talk about their team tasks, structure, and size. Example: [1] Their code bases were discussed on HN before, e.g. [2]. Standard Chartered also funded the development of GHCs l…

Is Standard Chartered the bank that actually uses its own eager subset of Haskell and built everything in it from scratch?

Yes Standard Chartered does have its own strict Haskell scripting language (Mu). But it mostly wraps C/C++ quant libraries, it's used as a alternative to Python (because Python is a bad idea at scale). GHC is used too and is what Mu was built in.

Re: Haskell for a New Decade [pdf]

#107
post #77

I think the focus on Haskell is missing the mark a bit. Haskell is about programming language researchers and enthusiasts having a excellent example language to try out ideas. Over the years it has turned into a production ready platform. As the PDF shows there are many languages spun off Haskell and it doesn't even mention them all. Then there are language features in C# and Java, Typescript etc. that are coming acr…

None of the languages that let you achieve certain top qualities (top performance, proven correctness, concurrency, compactness, etc) are trivial or "feel natural". Haskell, Rust, APL / K / Q, Erlang, hell, even C++ and Scala (though these two are unnecessarily bloated). You got to study and internalize concepts that underlie them, change your way of thinking. This is because reality is not intuitive, too. Take natur…

I'd definitely argue that no language ever will "feel natural" unless it fundamentally changes the metaphors of computation. Humans just don't think in sufficiently "hard-boundary" terms for programming as currently phrased to come naturally. Granted, culture has made up for a lot of that - in the UK, children are expected to be able to perform arithmetic, which presumably helps a lot in instilling the appropriate style of yes-no exact thinking - but I don't think the programming mindset aligns well at all to what was in the ancestral environment. Our minds are classifying machines built to do Just Well Enough in a world where everything is shades of grey; programming is the art of making the world concretely align to a well-specified model.

Re: Haskell for a New Decade [pdf]

#108

I think the focus on Haskell is missing the mark a bit. Haskell is about programming language researchers and enthusiasts having a excellent example language to try out ideas. Over the years it has turned into a production ready platform. As the PDF shows there are many languages spun off Haskell and it doesn't even mention them all. Then there are language features in C# and Java, Typescript etc. that are coming acr…

I love haskell, but personally don't want haskell ideas to be popular until they're possible for a given language. Yes, lazy evaluation and tail-call recursion are awesome... At least they are in haskell. Outside of haskell, it's just a fun trivia fact that some other language does it.

I've got a blog post in the oven about tail-call recursion and how to use it in F# to write your loops more safely. By using recursive (possibly side-effectful) functions instead of iteration, you make the decision about "whether or not to loop" explicit in code, making it much harder to make e.g. certain classes of off-by-one errors. When it's an explicit decision to loop, by calling yourself with an amended immutable state parameter, it often sticks out like a sore thumb when you loop wrongly (e.g. by forgetting to update your state, or by looping one too many times).

Re: Haskell for a New Decade [pdf]

#109
post #77

I think the focus on Haskell is missing the mark a bit. Haskell is about programming language researchers and enthusiasts having a excellent example language to try out ideas. Over the years it has turned into a production ready platform. As the PDF shows there are many languages spun off Haskell and it doesn't even mention them all. Then there are language features in C# and Java, Typescript etc. that are coming acr…

None of the languages that let you achieve certain top qualities (top performance, proven correctness, concurrency, compactness, etc) are trivial or "feel natural". Haskell, Rust, APL / K / Q, Erlang, hell, even C++ and Scala (though these two are unnecessarily bloated). You got to study and internalize concepts that underlie them, change your way of thinking. This is because reality is not intuitive, too. Take natur…

Ah, I wonder if “intuitive” is really as much of a feature as it’s trumpeted to be (under the assumption that intuition could be a crutch used to “get to places we’ve already been”)

Re: Haskell for a New Decade [pdf]

#110
post #37

Earlier quoted context omitted.

Counter point on "investment": I was in a Haskell team at Google, and have trained groups at various companies professionally. From that experience, for a normal developer with working experience in Java, Python, or C++: * It takes 2-3 weeks of full-time onboarding (half with a coach, half self-study) to work on a typical industrial Haskell project. * It takes around 3 months of full-time participation in such a proj…

Thanks for that. Everything you said is from the perspective on being not only in a Haskell job but in a Haskell team. Your 3 months is 5 years for someone trying to learn on their own in their spare time. And then they need this to get a Haskell job due to the competition for such job and the queue of super smart people lining up for a Haskell job. And the pay cuts are brutal. Now you are an outlier, working on a Ha…

Anecdata point: I'm comfortable with lens at a very basic level, and if you have a good grasp of "normal" Haskell you can just compose lens operators and use combinators by playing the usual "type tetris" game of "what fits here?" and eventually you pick up a few idioms that are enough for most normal lens usage.
Post reply on HN