1. 10

    This was a great read all the way through, thank you to the author! Yes, some of the claims are a bit exaggerated, but it seems pretty clear from the style of writing that it’s not to be taken too seriously.

    The things that stood out to me:

    • The fuzzy way of adding strictness annotations to get things to work well seems scarily familiar. It works, no question about that, but it would feel better to understand precisely when and where you should add them. I’m not sure if what’s missing is just another level of Haskell expertise, or whether compiler optimizations etc. are unpredictable enough that that’s what everyone is up against.
    • Great monoid use-case. I think the word-counting monoid itself would have been better explained without reference to the Flux abstraction; it feels easier to understand as a stand-alone thing. (Also, the Unknown constructor and its monoid action feels a little off: If it’s called “unknown”, I’d prefer Unknown <> x = Unknown; with the current implementation perhaps call it Empty?)
    • There were a lot of exclamation marks!
    1. 1

      I like your comment about the random banging. There is talk in the Haskell community that maybe laziness isn’t the correct default, thus -XStrict and -XStrictData: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#extension-Strict

      I personally hate random bang patterns and prefer strictness by default.

      1. 2

        Idris went strict by default. It’s a really interesting language if you’re a haskeller.

    1. 1

      Haskell’s indentation aware yet extremely fragile syntax, also laziness.

      1. 2

        Thanks so much for putting this - I had read it before years ago, but totally failed to find a link to it when I wanted to reference it.

        1. 3

          Tim Rogers used to have some of the most beautiful internet writing back then. I always remember this one too:


        1. 2
          1. 17

            I’m one of the maintainers of Conjure, happy to answer questions about this project!

            1. 12
              1. How does this compare to gRPC and friends (e.g. Thrift), especially now that gRPC-Web is in GA? When would I pick Conjure over them?
              2. Are there plans for additional language support? I’m interested in Go in particular.
              1. 9
                1. We’re big fans of gRPC! One downside is that it does require HTTP/2 trailers, which means if you want to make requests from browsers or curl, you’d need to deploy a proxy like envoy to rewrite the traffic. I think Conjure makes sense if you’re already relying on HTTP/JSON in production or care about browsers. It’s very much designed with simplicity in mind, and doesn’t actually prescribe any particular client or server, so allows you to get the upside of strong types for your JSON, without requiring big changes to your existing stack or API.

                2. Definitely! Internally, we use go extensively so I think conjure-go is next in the open-sourcing pipeline. One interesting feature of Conjure is that since the IR is a stable format, you can develop new language-generators independently without needing any involvement from the core maintainers!

                1. 4

                  I have the same question as 1. but with OpenAPI.

                  1. 6

                    They’re conceptually pretty similar, but we found the Java code that Swagger generates pretty hard to read. While Swagger has to add many annotations (https://github.com/swagger-api/swagger-samples/blob/master/java/java-jersey-jaxrs/src/main/java/io/swagger/sample/resource/PetResource.java#L43) to deal with any conceivable API you might define, Conjure is intentionally more restrictive in terms of what you can define and tries to focus on doing a small number of things very well.

                    This results in code that is as readable as a human would write (https://github.com/palantir/conjure-java/blob/1.3.0/conjure-java-core/src/integrationInput/java/com/palantir/product/EteService.java), with all the benefits of modern best practices like immutability, NonNull everywhere etc.

                2. 60

                  How do you feel about your work being used to enable human rights violations?

                  1. 14

                    This is actually an interesting question.

                    1. 6

                      Probably terrible but also aware of the unlikelihood of escaping it. Sometimes you have an action and it has good and bad consequences and the good consequences are avoidable, but the bad aren’t. In that specific scenario it’s not wise to give up the good consequences just so you aren’t “getting your hands dirty”. Sure if you can find some way to escape the evils then you should try all available options but sometimes things are bad.

                      Oh I’m realizing this is specifically Palantir’s stack lmao. Nevermind yeah don’t work on that on your free time y’all, no hard feelings intended towards @iamdanfox .

                      1. 2

                        As it seems I’m living under a rock, could you paste some link to provide the context for your question?

                        Edit: never mind, found it; “Palantir provides the engine for Donald Trump’s deportation machine”

                        1. 1

                          Which is the same machine as previously used, right?

                      2. 3

                        How does it compare to Twirp? (https://github.com/twitchtv/twirp)

                        Update after a quick search: Conjure uses JSON whereas Twirp uses ProtocolBuffer.

                        1. 2

                          I think Twirp has a lot of similar motivations to Conjure - the blog post even mentions an emphasis on simplicity and it works over HTTP1.1 (unlike gRPC).

                          One key difference I see is that many API definition tools are essentially monoliths, pretty much completely controlled by the originating company. We’ve gone for a different approach with Conjure and tried to decouple things so that significant additions (e.g. adding a new language) happen without blocking on the core maintainers at all.

                          For example, if you wanted to add Swift support, you’d make a brand new conjure-swift repo and write a CLI that turns the stable IR format into Swift source code. We have a standardised test harness (written in Rust) that you can use to prove that your new conjure-swift code will be compatible with other Conjure clients/servers. Once your CLI works, you can package it up in a standard way and it should slot nicely into existing build tools.

                        2. 3

                          How is unionization in Palantir? Is there a reason why you’re still working there? Do you need support? I’m not from USA but I can point you to people willing to support workers like yourself.

                          1. 2

                            Hey I am really interested in the project, but I’m getting errors when going through the tutorial on the GitHub repo, specfically ./gradlew tasks was giving me an error fetching the com.palantir repos. I copy pasted the exact instructions and I’m unsure where to ask for help on this. I figured I’d at least let you know to see if you experience the same issues.

                            1. 2

                              Hey! Glad to hear you’re interested in the project and sorry about the issue with the getting started guide. i’ve gone ahead and updated the guide to fix the problem you encountered. Thanks for pointing out the issue. Hope you enjoy using the project and feel free to reach out with any questions, comments or concerns

                          1. 12

                            The two role models I think of immediately are Julia Evans and Simon Peyton Jones. They are both clearly extremely knowledgable, really good at explaining things and – perhaps most importantly – readily admit ignorance. I aspire to do that myself, too, and I suspect part of the reason that Julia and Simon seems to know so much is that they’ll say “I don’t know!”.

                            I saw a talk by Simon Peyton Jones last month about linear types in Haskell, and someone from the audience asked “why is it called linear types?” to which Simon – without hesitation – replied something to the effect of “I don’t know!”. For some reason it was very nice seeing such a knowledgable person unabashedly admit ignorance on a topic close to his area of expertise.

                            Some examples from Julia’s writing:

                            I’m not going to go into how you read that info right now because frankly I don’t know.

                            It’s not completely clear to me under what circumstances having swap on a computer at all even makes sense. It seems like swap has some role on desktop computers.

                            I was going to say that this isn’t how it works on Linux. But! I went and looked at the docs and apparently there is a posix_spawn system call that does basically this. Shows what I know. Anyway, we’re not going to talk about that.

                            1. 3

                              I also look up to Simon, and exactly for those reasons. In that same talk he starts saying “I usually don’t understand types, I’m very bad with them”. That straightforward ignorance is something I strive to achieve.

                            1. 6

                              Here is a shot I submitted to r/unixporn. It’s i3 with a Solaris CDE inspired theme I created. My computer is a Dell XPS 9360, a Vortex Vibe keyboard and a new Microsoft Intellimouse. Time is spent mostly in Emacs coding. Since I dont’t use an external monitor, I use i3 with one app per workspace usually.

                              1. 1

                                What’s the file manager there, if I may ask?

                                1. 1

                                  It’s SpaceFM with MacOS classic icons.

                                2. 1

                                  Damn man, what a beautiful theme. Wouldn’t mind if you shared it :)

                                  1. 1

                                    Sure, everything should be here https://github.com/julienXX/i3config