News for hackers. Stuff that matters.
Re:How and why GraphQL will influence the Sourcehut alpha by searchableguy on Thursday June 11, 2020 @02:02AM (#23485627)
I didn't read the post that way. I feel scaling is a small issue more so organization. Graphql does make sense for something like source hunt.

Why not use type hints in python? Isn't that a good enough substitute?

I wonder why go instead of rust if he wanted static typing, long term ease of maintanence and performance. Go's type system is not great especially for something like graphql. Gqlgen relies heavily on code generation. Last time I used it, I ran into so many issues. I ditched go together after several painful clashes with it that community always responded with: oh you don't need this.

(yeah except they implemented all those parts in arguably worse ways and ditched community solutions in the next few years)

One major benefit the GP fails to mention is that with graphql, it is easy to generate types for frontend. This makes your frontend far more sane. It's also way easier to test graphql since there are tools to automatically generate queries for performance testing unlike rest.

There is no need to add something for docs or interactivity like swagger.

Re:How and why GraphQL will influence the Sourcehut alpha by erk__ on Thursday June 11, 2020 @02:14AM (#23485686)
As for the reason to use Go instead of Rust it is probably just down to the creator of Sourcehut he has multiple times expressed that he dislikes rust quite a bit.

He has written a blog post about how he chooses programming languages as well https://drewdevault.com/2019/09/08/Enough-to-decide.html

Re:How and why GraphQL will influence the Sourcehut alpha by Kuinox on Thursday June 11, 2020 @05:20AM (#23486796)
It's the first time I hear that haskell has awful package management...
Re:How and why GraphQL will influence the Sourcehut alpha by tome on Thursday June 11, 2020 @07:05AM (#23487508)
It used to a few years ago, before Cabal v2-style. Nowadays package management is rather good, but its reputation hasn't caught up yet.
Re:How and why GraphQL will influence the Sourcehut alpha by Scarbutt on Thursday June 11, 2020 @12:35PM (#23490584)
I hear the opposite, it's so awful they have to use Nix to keep it sane.
Re:How and why GraphQL will influence the Sourcehut alpha by tome on Friday June 12, 2020 @03:48AM (#23497028)
Interesting. Where did you hear that?
Re:How and why GraphQL will influence the Sourcehut alpha by CameronNemo on Thursday June 11, 2020 @02:05AM (#23485642)
>One major benefit the GP fails to mention is that with graphql, it is easy to generate types for frontend. This makes your frontend far more sane.

By GP (grandparent?) do you mean the article / blog post?

Because if so I see no indication that Drew plans to adopt a SPA architecture -- he seems intent on continuing to use server side rendering with little javascript, which would make "frontend types" sort of irrelevant.

Re:How and why GraphQL will influence the Sourcehut alpha by searchableguy on Thursday June 11, 2020 @02:10AM (#23485669)
You don't need spa to take benefits of the generated types from graphql. If you use something like typescript on the backend (SSR app), the types will be stripped out in the end so it doesn't affect your bundle size.
Re:How and why GraphQL will influence the Sourcehut alpha by CameronNemo on Thursday June 11, 2020 @02:12AM (#23485680)
You must understand my confusion when your original comment explicitly states that frontend types can be generated, but your reply here seems to be talking about a javascript/typescript backend service.
Re:How and why GraphQL will influence the Sourcehut alpha by searchableguy on Thursday June 11, 2020 @02:16AM (#23485706)
Sorry by backend, I mean your SSR app.
Re:How and why GraphQL will influence the Sourcehut alpha by vertex-four on Thursday June 11, 2020 @07:12AM (#23487539)
What bundle size? There's no javascript being shipped to the client.
Re:How and why GraphQL will influence the Sourcehut alpha by gbear605 on Thursday June 11, 2020 @07:42AM (#23487759)
Technically there is some used for a few things, like a text editor (for writing build manifests) and for payments. But those are very limited and aren’t relevant to the use of GraphQL.
Re:How and why GraphQL will influence the Sourcehut alpha by TeeWEE on Thursday June 11, 2020 @02:07AM (#23485652)
Code generation (of types and clinet/server stubs) can be done with any IDL (interface definition language). OpenAPI, GRPC, Thrift etc etc all support it. No reason to choose GraphQL only because of this.

The power in GraphQL comes from the graph and flexibility in fetching what you need. Usefull in general purpose APIs (like GitHub has).

Re:How and why GraphQL will influence the Sourcehut alpha by searchableguy on Thursday June 11, 2020 @02:08AM (#23485659)
I never said it was the only reason. I said it is one of the benefits that GP failed to mention in the post. Other benefits that GP mentioned still applies.

You can of course do this with other standards but ime, it's easier to do this with graphql since you only have to build the api. There is less overhead overall since type information is part of the standard, not necessarily something people add afterwards or choose to. Introspection, graphiql and all the tooling is easier to use and doesn't need integrating something like swagger.

It comes setup by default on most solid graphql frameworks.