Fork me on GitHub
#other-languages
<
2017-11-20
>
seancorfield16:11:22

@borkdude fascinating piece about Haskell! It reflects how I feel any time I try to build anything more than Hello World with it:grinning:

borkdude16:11:55

@seancorfield Can you explain what exactly you feel/think/experience?

borkdude16:11:08

Are you responding to the post Eric wrote?

seancorfield17:11:26

@borkdude I was one of the PhD researchers developing his own FP language back in the early 80's -- many British universities were doing that. When Haskell appeared, as a collection of "best of breed" features from all our languages, I was very excited and really thought Haskell would break out and take FP mainstream. It combined a lot of ideas that everyone had been working on and it was just so obviously the "right way" to build software. Of course, it stayed resolutely academic. So, over the 25 years it's been around, I've taken several runs at building something with it, something useful, non-academic, something real-world. Every time I've gotten incredibly frustrated with the state of tooling, libraries, the difficulty of doing certain basic thing (as the slide deck indicates, doing anything non-trivial with databases is still pretty painful in Haskell, as one example).

seancorfield17:11:27

The academics never cared much about a good ecosystem, of course, and the non-academic portion of the community has often gotten too frustrated to overcome that inertia -- and given that absolutely everything has to be built from scratch in Haskell it's a huge amount of work trying to replicate what's available in other communities.

seancorfield17:11:23

As Saurab said in that preso, they'd find half-baked / abandoned libraries -- or a complete lack of a solution -- and often build their own.

seancorfield17:11:01

And this is after a lot of commercial usage of Haskell has really improved the ecosystem and made it much more practical for writing real-world applications.

borkdude17:11:10

Kris Jenkins (yesql author) mostly moved to Haskell. I asked him if he missed something from the JVM ecosystem. He said no. I wonder what kind of apps he builds.

mpenet17:11:17

Depending on the goal you dont need a large ecosystem. Haskell excels at some tasks sucks at others, same is true for clojure or any other language

seancorfield18:11:32

@mpenet Yes, that's very true. And when I've talked to Haskell folks working in specific areas, they've usually settled on a set of libraries and tools that work for them but, when pushed, will admit to rough edges or omissions that they've just had to deal with and then that's their new "normal".

seancorfield18:11:27

Logging and instrumentation (e.g., New Relic) are things we take for granted on the JVM but they are hard in Haskell (because they are impure actions that apply across "all" aspects of your applications. Companies seem to either write their own or simply not do those things (sometimes with elaborate justifications of why Haskell "doesn't need" those things -- which feels like Stockholm Syndrome to me!).

borkdude18:11:17

Interesting critique of SBT (informally known as Scala’s Build Tool): http://www.lihaoyi.com/post/SowhatswrongwithSBT.html

seancorfield18:11:40

Does anyone actually love SBT?

borkdude18:11:18

Martin Odersky wrote an elaborate critique on SBT six years ago (see comments) but nothing got fixed

mpenet18:11:42

@seancorfield logging and instrumentation is useless in some domains

mpenet18:11:18

There's more than the vanillia app/service out there

mpenet18:11:02

For general purpose tasks the jvm makes it easy for sure

seancorfield18:11:17

@mpenet Right, but using Haskell for web apps -- which was the context of that slide deck -- means that logging and instrumentation are important and Haskell makes those very hard.

mpenet18:11:09

Sure that s my point, moving from rails to haskell for this is a mistake imho

mpenet18:11:22

There are better choices

mpenet18:11:48

Hell, even scala would fit better ;)

borkdude18:11:41

They could’ve also gone for JRuby if they needed something JVM specific

borkdude18:11:27

But their needs were “refactoring confidently”, which doesn’t solve that

mpenet18:11:27

Seems they were after code safety etc

mpenet18:11:58

So yeah, prolly scala or even java/kotlin would fit the bill

borkdude18:11:18

Their slide of Ruby code shows something that doesn’t necessarily have to do with static typing though. More with functional vs. RoR mutable magic

borkdude18:11:32

However, their JavaScript mentions: “what’s the shape of this JSON”, not much different from Clojure

mpenet18:11:34

Yup no need to go full monads for that either, even go lang has this covered. Clojure with some spec could prolly do the same too

borkdude18:11:05

How does go lang solve that?

mpenet18:11:52

You declare structs with tags for json mapping

mpenet18:11:30

It s somewhat composable via embedding too

borkdude18:11:51

similar to Java + annotations I guess?

mpenet18:11:31

Slightly more elegant imho, it s simpler

borkdude18:11:32

type Response2 struct {
    Page   int      `json:"page"`
    Fruits []string `json:"fruits"`
}