News for hackers. Stuff that matters.
Re:Scaling to 1M active GraphQL subscriptions on Postgres by Thaxll on Friday May 31, 2019 @03:38PM (#20064222)
I was curious about the code so I went to check it, it's written in Haskell, never seen Haskell before, it's really hard to follow for someone not used to it: https://github.com/hasura/graphql-engine/blob/master/server/...

Not sure how people enjoy FP.

Re:Scaling to 1M active GraphQL subscriptions on Postgres by lpage on Friday May 31, 2019 @04:03PM (#20064438)
Haskell and ML languages look like symbol soup when you're used to mainstream/C style languages. Once you understand some of the basic syntax they become quite readable and easy to reason about as a series of transformations.

Step one, which applies to most functional languages, is knowing how to read a Hindley-Milner type signature [1].

Armed with that you can often gain a surface level understanding of what some function does - and what the program does in aggregate - just by reading type signatures and seeing what calls what.

Hoogle [2] is a good resource for figuring out Haskell syntax, like what's up with all of those $ signs.

Converting OCaml to ReasonML syntax with sketch or reason-tools [3] makes OCaml less foreign.

With basic knowledge of Haskell and ML syntax you'll find many FP languages readable.

[1] https://drboolean.gitbooks.io/mostly-adequate-guide-old/cont...

[2] https://hoogle.haskell.org/

[3] https://reasonml.github.io/docs/en/extra-goodies

Re:Scaling to 1M active GraphQL subscriptions on Postgres by jakear on Friday May 31, 2019 @08:55PM (#20066399)
“Quite readable” is a stretch... I know of no other language that needs a hoogle equivalent.

That being said, my experience with Haskell is limited to working on some meta-meta-programming research in college, where every file used at minimum 3 different GHC extensions. So I may be biased.

Re:Scaling to 1M active GraphQL subscriptions on Postgres by FridgeSeal on Saturday June 01, 2019 @09:03AM (#20068982)
I find Haskell less of a “needs” a hoogle, and more of a “nothing else has this, this is so useful”.

The number of times I have wished for something like Hoogle when writing Python...

Re:Scaling to 1M active GraphQL subscriptions on Postgres by SomeOldThrow on Saturday June 01, 2019 @04:37AM (#20068119)
Scala could definitely use hoogle, as can c++/boost. My lesson from all this is to never ever overload an operator except, maybe, the comparison operators.

Exception: apl.

Re:Scaling to 1M active GraphQL subscriptions on Postgres by whateveracct on Friday May 31, 2019 @09:34PM (#20066575)
You don't need hoogle -.- It is a very cool tool tho
Re:Scaling to 1M active GraphQL subscriptions on Postgres by mlevental on Friday May 31, 2019 @09:12PM (#20066470)
>at minimum 3 different GHC extensions. So I may be biased.

are you kidding? most files i see have all of these

http://dev.stephendiehl.com/hask/#the-benign

Re:Scaling to 1M active GraphQL subscriptions on Postgres by jakear on Friday May 31, 2019 @09:16PM (#20066485)
Again, I don’t have a clue what I’m talking about. But I seem to remember seeing a lot of those “dangerous” ones. If that’s just the state of Haskell, my bad.
Re:Scaling to 1M active GraphQL subscriptions on Postgres by seer on Saturday June 01, 2019 @01:46AM (#20067479)
Thank you so much for the reference to “mostly adequate guide to FP” book. It looks incredibly easy to read. As someone who is fluent in JS and dabbled in FP this is right down my alley, and the style of text itself is actually quite funny and conversational - I love that.

I’ve noticed that a _a lot of_ stuff written about FP tries to emulate this fun and easy going style - I wonder why that is. I still refer to clojure’s “re-frame” docs as the epitome of technical literature - a text so good you can read it in its own right just for the fun of it.

I don’t want to diminish other languages’ communities of course, as this is totally anecdotal. I’ve found awesome prose in other places as well (mostly ruby/python) but I just encounter those funny gems more often reading about FP.

Re:Scaling to 1M active GraphQL subscriptions on Postgres by robotmay on Friday May 31, 2019 @04:53PM (#20064867)
I've said it a few times on HN in the past but Haskell is by far and away the hardest language I've tried to learn. I have no formal grounding in maths/CS and I think a lot of the people who enjoy it really struggle to communicate with those of us who don't come from that sort of background.

In contrast I picked up Rust and Elixir in a couple of weeks apiece, so I don't feel like I'm particularly dense; I just suspect that it needs a certain way of thinking to get the best from Haskell :)

Re:Scaling to 1M active GraphQL subscriptions on Postgres by andy_ppp on Friday May 31, 2019 @08:16PM (#20066234)
I’m along the same opinions, if there was a language as complex as Haskell that gave more consideration to beginners above terseness [naming concepts better] I’d be able to accept more of it. The guy next to me is determined to hatchet in all of the functional paradigms into Typescript and he gets to decide this. I can’t help think you’re average JS dev is going to look at Maybe.may2 and be completely bemused...
Re:Scaling to 1M active GraphQL subscriptions on Postgres by coldtea on Friday May 31, 2019 @04:47PM (#20064822)
>it's really hard to follow for someone not used to it

So like anything else?

>Not sure how people enjoy FP.

By virtue of actually having tried it?

Re:Scaling to 1M active GraphQL subscriptions on Postgres by bishala on Sunday June 02, 2019 @12:31AM (#20073482)
Not really. Some other functional languages (eg. F#) don't seem as arcane as Haskell.
Re:Scaling to 1M active GraphQL subscriptions on Postgres by mrkurt on Friday May 31, 2019 @03:48PM (#20064312)
It's worth writing something in an ML or Haskell sometime. Functional programming is great, and it makes my code in things like JavaScript much more robust.
Re:Scaling to 1M active GraphQL subscriptions on Postgres by Cyph0n on Friday May 31, 2019 @05:51PM (#20065328)
Scala is probably as far as I’ll get when it comes to FP.
Re:Scaling to 1M active GraphQL subscriptions on Postgres by estsauver on Saturday June 01, 2019 @05:36AM (#20068341)
Even within scala, you can dabble in quite a bit of functional programming concepts. Have you used typelevel's cats or scalaz?

~Earl

Re:Scaling to 1M active GraphQL subscriptions on Postgres by tirumaraiselvan on Friday May 31, 2019 @10:43PM (#20066862)
> Not sure how people enjoy FP.

See The Blub Paradox [0]

0 : http://www.paulgraham.com/avg.html

Re:Scaling to 1M active GraphQL subscriptions on Postgres by jose_zap on Saturday June 01, 2019 @04:35AM (#20068114)
Anything you are unfamiliar with will obviously look alien and difficult.

I actually find their code quite readable, but that’s because I have experience writing Haskell.

Re:Scaling to 1M active GraphQL subscriptions on Postgres by hota_mazi on Friday May 31, 2019 @05:30PM (#20065166)
And FP developers in general tend to push conciseness to an extreme, especially with this kind of shenanigan (from the very source you linked):

    import qualified Data.ByteString.Lazy as BL
It's ironic that after all this obfuscation, the author of the source still finds it useful to do ASCII art and align everything neatly. Talk about misplaced effort.
Re:Scaling to 1M active GraphQL subscriptions on Postgres by stoksc on Friday May 31, 2019 @05:42PM (#20065260)
Pretty sure that’s done automatically like go-fmt or other similar tools. It’s zero effort and makes it easily to read. Also lots of languages have that import syntax (python import pandas as pd).