1. 1

    One thing I find useful is to make sure that the hash map that I use is not deterministic - each time program is executed the order of iteration should be different, like for example the default rust hashmap.

    1. 2

      As somebody who is implementing a dynamically typed programming language, I don’t agree with the author. Generating high quality error messages is a lot of work regardless of what kind of language you are implementing. You don’t automatically get high quality errors in a statically typed language. High quality errors are not categorically impossible in a dynamically typed language (as claimed), it’s just an engineering problem. It looks to me that the GHC team has invested more effort in producing good errors than the Nix team, that is all.

      1. 1

        High quality errors are not categorically impossible in a dynamically typed language (as claimed), it’s just an engineering problem.

        Engineering effort can certainly improve error messages in dynamically typed languages, resulting in high quality errors in certain cases. But I have trouble believing that dynamically typed languages can always produce an error as good as one from a statically typed language.

        Consider how a dynamically typed language could possibly produce an error as useful as this hypothetical Nix static type error from the article:

            { option = [
                "max-jobs=5"
                "cores=4"
                enable "fallback"
        #       ~~~~~~
        #       This element of the list is not a string
              ];
        

        One of the article’s key points is the convenience of seeing where the error is in your actual code. How could dynamically-typed Nix provide that?

        If it tracked function names better, its error message could have “enable” in place of “<λ>”, resulting in ‘generators.mkValueStringDefault: functions not supported: enable’. But that’s still not as useful as the above error. Knowing the unexpected function’s name is enable wouldn’t be much help if you had many instances of enable in the list, but you forgot to parenthesize only one of them.

        An additional problem with that dynamic error message is that it says the error is within the function generators.mkValueStringDefault. The user’s code never explicitly called that function, so they might have to read their whole program to locate the problem. This could be mitigated by displaying the stack trace along with the error:

        generators.mkValueStringDefault: functions not supported: enable
        something.blah
        something.foo
        pkgs.lib.cli.toGNUCommandLine
        something.processOptions
        

        But that still forces the user to scan the list until they find a function in their actual code, then read all parameters they pass to that function (and that’s assuming global state didn’t cause the error). The example static type error above skips those steps by highlighting the exact line the error was on.

        Now, I could imagine some hybrid type system that doesn’t raise errors until a runtime problem is encountered, and then parses the source code to find all the values that contributed to the problematic value existing. That could be neat… but at that point the work has already been done to implement a static type system. At that point, it would be better make the language also do static type checking, allowing users to sometimes be notified of problems before they happen.

        It looks to me that the GHC team has invested more effort in producing good errors than the Nix team, that is all.

        Above I was describing how creators of a dynamically typed language could invest extra effort to replicate something the hypothetical statically typed language got almost for free. To get the type error “This element of the list is not a string”, the hypothetical static-typed-Nix team only had to annotate function return types. If that team tried to invest as much effort as the hypothetical dynamic-typed-Nix team, they might improve the type error further to this:

                enable "fallback"
        #       ~~~~~~
        #       This element of the list should be a string, but is a function.
        #       
        #       The formatting of your source code makes me think you might
        #       have wanted this line to be a function call, like this:
        #           (enable "fallback")
        #       That would produce a string.
        

        Could you produce an error message like this with a dynamic type system?

        1. 1

          Racket is dynamically typed and this is how you can get similar error messages in it:

          #lang racket
           
          (module+ server
            (provide (contract-out [foo (-> (listof (and/c string? lower?)) number?)]))
            (define (lower? s) (sequence-andmap char-lower-case? s))
            (define (foo l) (length l)))
           
          (module+ main
            (require (submod ".." server))
            (foo (list 'enabled "baz")))
          

          will produce:

          foo: contract violation
            expected: string?
            given: 'enabled
            in: an and/c case of
                an element of
                the 1st argument of
                (-> (listof (and/c string? lower?)) number?)
            contract from: (/tmp/c.rkt server)
            blaming: (/tmp/c.rkt main)
             (assuming the contract is correct)
            at: /tmp/c.rkt:4.26
          

          In fact as you can see, Racket is able to enforce not only simple type level properties (is it a string?) but also much more interesting properties about values - does the list contain only lower case strings? (foo (list "baZ")) will produce:

          foo: contract violation
            expected: lower?
            given: "baZ"
            in: an and/c case of
                an element of
                the 1st argument of
                (-> (listof (and/c string? lower?)) number?)
            contract from: (/tmp/c.rkt server)
            blaming: (/tmp/c.rkt main)
             (assuming the contract is correct)
            at: /tmp/c.rkt:4.26
          
          1. 1

            The error message in your first example is certainly more useful than error-checking in most dynamically typed languages. However, I think you missed the point of my comment, because that example doesn’t really address any of these problems that I noted Nix’s dynamically-typed message has and the statically-typed error message wouldn’t have:

            • Your example’s error message does show the incorrect value, “given: 'enabled”. But would this still work if the incorrect value were an anonymous function rather than a symbol? Or would Racket just say “given: <λ>” like the Nix example unhelpfully does?
            • Your example’s error message doesn’t include the stack trace at the point the incorrect value 'enabled was found. So if your example program used 'enabled correctly many times within the list but uses it wrongly once, you would have to manually scan all your program’s usages of it.
            • Even if Racket outputted the stack trace when 'enabled was found, that’s still not as helpful as knowing exactly where in your code 'enabled is written. By “exactly where”, I mean outputting a range of characters in the user’s source code, which is often rendered as an underline in an IDE. Your Racket example does include similar output with /tmp/c.rkt:4.26 in its last line, but this points to the contract that failed (library code), not to the code that broke the contract (the user’s code).

            In my previous comment, I showed why I thought the article was correct by explaining the above three ways that static type errors can give more relevant information than dynamic type errors.

            Regarding your second example, being able to assert things about run-time types can indeed catch errors that can’t be caught with static typing. I agree that this can be a useful feature. However, there’s no technical barrier to a statically-typed language supporting runtime-checked contracts as well. Assertions can usually be implemented as a library that throws an exception or returns an error type.

            I would guess that statically typed languages are less likely to have support for contracts in their standard libraries, due to static types covering some of their use cases. I acknowledge that this could be seen as a bad thing about statically typed languages if you want an ecosystem of programs that often make use of run-time contracts.

        1. 4

          I don’t think this is a good idea, nor actually needed.

          First, the obvious failure mode. A “bad actor” can con their way onto the site via invite, post a comment that would violate most hosting providers AUP, and could then point to it being visible in the modlog as this site breaking that AUP, and getting the site in trouble. So even if most moderated comments could be visible, there’d still be “extra-banned” comments which would excite even more interest.

          For those with a prurient interest in moderated or even deleted comments, it’s not hard to set up something that scans each submissions comments and keeps deleted ones (or tracks edits). Each submission page has a .json extension which gives a machine-readable view of that page. A couple of hours of hacking and a cronjob and it’s off to the races.

          1. 3

            I would expect that 99,99% (if not more) of deleted comments is completely legal and can be displayed. The few that needs to be deleted can probably be removed via rails auto generated management api.

            Even if it is a real issue I still agree with op that showing removed comments would be a good improvement on transparency. So maybe during deletion mods should have an option to mark as removed or actually delete offending comment. This would solve illegal content issue but still improve transparency.

          1. 8

            While I get the idea, I think all that would happen is that conversation would continue while referencing the dead/removed content. Lobste.rs does a really good job of keeping the conversations consistent, by for example preventing the editing of comments after a certain amount of time.

            IMHO if the content was removed unjustly, discussion in IRC or private communication with mods would probably be preferable. Lobste.rs isn’t the Orange Site, and I think a Backbone Cabal suits it well.

            1. 2

              I think all that would happen is that conversation would continue while referencing the dead/removed content

              I think that making it visible only in moderator log would be inconvenient enough to prevent that from happening.

              1. 3

                It could cause inconvenience for the operators in the current (cancel)cultural environment, eventually maybe even risking the site’s existence. It would pretty much undermine the purpose of moderation.

                1. 2

                  What would you do with content which is illegal and could cause legal consequences?

                  1. 1

                    As far as I can tell this is not a real issue on this site.

                    1. 3

                      There was a link to the leaked WindowsXP, which was removed because of that reason.

                      1. 2

                        But it is a failure mode that can be exploited by a bad actor. I’ll expand on that in a top-level comment.

                  2. 2

                    We could possibly lock conversations on the removed content. It would only be visible.

                  1. 7

                    Interesting concept but I simply cannot relate with someone who seems to stop using things that quickly.

                    I have 1 active belt and that lasts me years.

                    If a T-shirt starts breaking, I fix it until it is not usable in public then it becomes a work shirt (gardening, moving, etc.), a training shirt or part of pajama attire.

                    I believe that’s how you get the most out of clothes, not buying expensive branded stuff and calculating the “per wear cost” when you could repurpose them until they become unfixable.

                    1. 1

                      At least it seems that he is donating instead of throwing out “old” clothes.

                    1. 28

                      Any of y’all want me to throw my hat in the ring?

                      Another time. :)

                      Okay fisch. I’ll try. If enough folks are interested I’ll shoot an app in.

                      1. 41

                        friendlysock is pretty much the only user who I have mentally flagged as consistently antagonistic and obnoxious, generally to the detriment of friendly and civil discussion. Other users may have particular topics which they feel sufficiently strongly about that they occasionally get a little antagonistic responding to criticism. With friendlysock, I see unnecessarily inflammatory comments often enough that I now mentally think, “ugh, I won’t bother reading this comment chain, it looks like another friendlysock spat”. If you can’t moderate your own comments, I don’t think you’d be good at moderating other peoples.

                        So if you really want our opinions, no, I do not want you to throw your hat into the ring.

                        1. 24

                          Strong disagree. friendlysock consistently engages in civil and friendly discussion, even when finding himself on the other side of an argument with someone whose political convictions make them feel they shouldn’t even attempt to be civil and friendly. I’ve never seen him make a comment I think could fairly be called unnecessarily inflammatory (and I say this as someone who has disagreed with him in the past). I generally enjoy seeing his posts and think he’s a good contributor to the site.

                          1. 32

                            You’re painting a picture where angersock is the civil one who just so happens to be constantly surrounded by people mad at him.

                            That’s wrong: angersock frequently accuses others or entire communities of bad faith and assumes a position of authority he doesn’t have when saying content doesn’t belong here (do I even need to link that one?).

                            I’ve rarely seen anybody argue with angersock twice. That alone should be pretty damning: The only constant in arguments involving angersock is he himself.

                            One can be inflammatory, incite flamewars and toxic communication while saving face by “remaining civil”. I’m not sure how much of it was intended in /u/Thra11’s post, but to me the point is that angersock remains civil, but brings incivility.

                            That is not to say that he doesn’t try his best, and I don’t think he does any of this on purpose (though I am really not sure). But I really don’t think he is cut out for this job, and given the comment ratio on his top-post vs the rest of the thread, I think he would be quite a controversial mod to say the least.

                            1. 14

                              It’s also missing the point: One can be inflammatory, incite flamewars and toxic communication while saving face by “remaining civil”.

                              That form of trolling is called Sea-lioning. http://wondermark.com/1k62/

                              1. 13

                                I strongly disagree that how friendlysock has been showing up here can be seen as a form of sealioning.

                                1. 8

                                  It still blows my mind that not only do some people think the woman rather than the sea-lion was the sympathetic character in that comic, but that there are enough such people for “sea-lioning” to have become a meme.

                                  1. 8

                                    I suspect it’s because many people use public social media for private conversations with their friends (as they would speak while walking about town). A stranger injecting themselves into the conversation to demand your time and attention (regardless of how righteous they are) is unwanted and weird.

                                    1. 5

                                      I was puzzled by that as well. There were enough of us that the author wrote a three paragraph clarification on the errata page. It’s possibly worth reading the explanation there. I’d summarize it as “the sea lion is a stand-in for people who behave a certain way and the woman’s objection is based on that behavior”.

                                      1. 5

                                        It’s pretty fitting, I think. Most people who cry “sea lioning” are just upset that someone responded to their public statements.

                                      2. 6

                                        I only have this comic as reference for as to what sealioning means, but the situation I see with angersock is not one where he actively seeks out people to engage in stupid arguments with. Maybe the term has evolved beyond that specific example, but then, without a new real definition, it has lost its meaning.

                                        1. 3

                                          The term has not lost its meaning, it has always been used to refer to people who make unwelcomed responses to publicly made statements.

                                      3. 9

                                        My own interactions with ‘sock have actually been pretty good, even in cases where we disagreed (as in this thread), and I don’t off-hand recall seeing and recent(ish) comments where I was “sjeez ’sock, relax mate”.

                                        But I also skip most Rust stories, as I don’t have a lot of interest in Rust (not at the moment anyway), and that link is indeed very much a “sjeez ’sock, relax mate” type of conversation.

                                        Point being: I guess people have a limited/biased view of ’sock (or any other members, for that matter) based on which stories they read and comment on. I certainly do, because I never would have seen that comment if you had not linked it here.

                                        1. 2

                                          do I even need to link that one?

                                          Would be helpful for people like me who aren’t as deep in the day-to-day of lobste.rs.

                                          1. 4

                                            It appears lobste.rs has some sort of retention on the index of comments per user, but here’s the most recent examples (not the best ones):

                                            All of those assume a place of authority and tell others how to use the site.

                                        2. 5

                                          In all fairness, this was not always the case (see also why I’m friendlysock instead of angersock), and even as recently as that Rust thread a few days ago I can still be more inflammatory than is helpful (less charitably: I can be a shithead). I’m no saint.

                                          1. 4

                                            and yet, gestures frantically below

                                          2. 6

                                            I would have to concur with this

                                          3. 34

                                            I personally would prefer not to have a moderator who thinks having Nazis participating is a fine idea (https://lobste.rs/s/nulfct/problem_with_code_conduct#c_dwa6s5). “You could exclude neither [Nazis nor the target of Nazis], and let them sort it out themselves elsewhere. Indeed, seeing each other in a context that doesn’t constantly reinforce their ideology might serve to build bridges and mellow both sides.”

                                            Seeing as my grandmother was almost murdered by Nazis the “mellowing both sides” bit did not go over well with me.

                                            1. 24

                                              It’s taken me quite some time to form a response.

                                              Here in Bloomington, IN, last year and the year prior, we had to deal with a real Nazi problem in our city. It was BAD. https://www.nytimes.com/2019/08/18/us/indiana-farmers-market-white-supremacy.html

                                              We have had a city govt run farmers market near the city square. It was on the largest walking/biking/running trail the city has.. It really was an amazing market.

                                              Then, the Unicorn Riot discord hack happened. Normally, this would oust Nazies and similar ideology. Except this time, it ousted a lady by the name of Sarah Dye, a farmowner and a stall vendor at the farmers market. It only outed the first name in the general vicinity and owned a farm - I was the one who found her account on Youtube by the name of Volkmom, and got her banned from the other 2 farmers market boards she was on. I forwarded the videos to their boards. They compared her voice to her damning videos.

                                              However, Bloomington IN doubled down, claiming 1st amendment concerns. Peaceful protests to Dye and the city were done… And the cops arrested the peaceful protesters, up to and including the president of low barrier homeless shelters - dressed as a purple unicorn ( https://www.thedailybeast.com/unicorns-arrested-at-protest-of-white-supremacy-at-bloomington-indianas-farmers-market ).

                                              And since Dye was being defended by the city, we had other undesirables show up. Other neonazies did. So did the 3 percent’ers. But when the 3%ers showed up, they were armed to the teeth, with AR15’s strapped to them, handguns (plural), zipties, and more. There was no question - they were not peaceful. They wanted to make a show of force that they were present to support their kind. Having them all show up shat on the very idea of the farmer’s market of inclusivity and coming together over shared food.

                                              We (public) finally solved this by deprecating the city run market, and a new market was made by a non-profit org. All the vendors showed up here, with exception of Sarah Dye and her stall. And unlike the city market, visible weaponry wasn’t allowed. And being in Indiana, people will pack heat; but it can at least be diminished.

                                              When nobody knew she was a Nazi and she didn’t do anything suspicious publicly, it was uneventful and peaceful. People just bought their groceries and all was good. The moment it was known, all the dregs, white nationalists, neonazies, kkk, and similar moved in to support “their kind”. We all literally had to abandon and regroup to get them to stop.

                                              If you don’t strongly deal with white nationalist groups, they’ll eat you out of house and home, run everyone off, and leave you with a shell of a community. I’ve seen it happen locally how it progresses in real life… and damned if I’ll let it happen to communities I’m currently a moderator of.

                                              1. 21

                                                Forgive me for being dense, but my reading of this is that everything was quiet and peaceful until you went out of your way to dox a Nazi and get her kicked out, and then people decided to protest a lawful application of the 1st Amendment, and then counter-protests happened, and a bunch of ugliness occurred, and then after all this you got the original market back less one Nazi.

                                                If this is an accurate reading (and it may not be!), how could one not conclude that everything was fine until you got a bee in your bonnet about somebody being a Nazi in their free time? How is everything that followed not your fault? That being the case…how is all of the following ugliness not the result of the efforts to purge a secret Nazi?

                                                My desire to follow rules of topicality and civility is very much due to a desire to avoid that sort of protest-counterprotest stuff that harms communities more than it helps.

                                                1. 23

                                                  how could one not conclude that everything was fine until you got a bee in your bonnet about somebody being a Nazi in their free time? How is everything that followed not your fault?

                                                  Who escalated to violence? The white nationalists did. Arguing that the exposers of secret Nazis are at fault is the argument employed by domestic abusers. “Woman, why do you make me beat you? Why do you do this to me?”

                                                  I know you’re arguing in good faith. But please do not try to justify violence from this crowd. They proved that they weren’t standing on moral high ground when they showed up with firearms and zipties.

                                                  The violent response from white nationalists to nonviolent protests should prove just how much of a charade their pearl-clutching about “muh free speech” really is.

                                                  1. 13

                                                    Forgive me for being dense, but my reading of this is that everything was quiet and peaceful until you went out of your way to dox a Nazi and get her kicked out, and then people decided to protest a lawful application of the 1st Amendment, and then counter-protests happened, and a bunch of ugliness occurred, and then after all this you got the original market back less on Nazi.

                                                    More specifically, there was already an anti-nazi campaign locally going against her with what I considered shaky proof. Many of us were very hesitant to engage in protests in person or online, without solid proof. I used my OSINT skills and was able to positively identify that it was her. Had it not been, I would have also said so. I’m not going to engage in a protest against an individual unless I’m damned sure I can prove it… And I proved it beyond a reasonable doubt.

                                                    Speaking to “and then people decided to protest a lawful application of the 1st Amendment, and then counter-protests happened”…

                                                    The problem was that the city was supporting the nazi speech AND show of force, while arresting peaceful (non-weapon-possessing) protestors. If the city had applied equal force to both sides, there would have been less of an issue with respect to 1FA.

                                                    If this is an accurate reading (and it may not be!), how could one not conclude that everything was fine until you got a bee in your bonnet about somebody being a Nazi in their free time? How is everything that followed not your fault? That being the case…how is all of the following ugliness not the result of the efforts to purge a secret Nazi?

                                                    You’re extrapolating and assuming when you don’t have the information.

                                                    My desire to follow rules of topicality and civility is very much due to a desire to avoid that sort of protest-counterprotest stuff that harms communities more than it helps.

                                                    This sort of civility is similar to Sea-lioning ( http://wondermark.com/1k62/ ).

                                                    Simply put, there is no civility when discussing people who want to murder people (and have done so) who differ only in race, skin color, or sexuality.

                                                    1. 21

                                                      Over and over and over again the same “both sides are at fault” message, Nazis and their victims. You simply cannot get yourself to say “let’s leave Nazis out”, huh.

                                                      1. 12

                                                        A few questions to make sure I understand your arguments:

                                                        • Assuming Lobste.rs vows to leave the Nazi out, who is going to decide which user is a Nazi? What is the definition of a Nazi?
                                                        • Since we’re bound to leave the Nazi out, how can we ensure that there won’t be a “leave the Y out”, where “Y” can be muslim from Saudi Arabia, Palantir developers (are they morally superior to Nazis?), Steven Pinker, Noam Chomsky and everyone else group X doesn’t like ?

                                                        ps. This discussion is not new by any means. It is a hard discussion, Karl Popper wrote extensively about this exact issue.

                                                        1. 8

                                                          Thank you for your observation.

                                                          For me, I can’t help but notice that even if we say “Okay let’s get rid of the Nazis”, we still have the question of who is a Nazi?

                                                          Form a practical standpoint: half of my country (US) voted for Trump, for whatever reason. That makes them some flavor of Republican–or worse. It is not a stretch (and is pretty common in various circles) to see any affiliation with Republicans as basically being a Nazi.

                                                          If half of Lobsters is from the US, this means that like a quarter of the users–based on back-of-the-envelope calculations–are Nazis and should be banned, for being Nazis.

                                                          If we just ban based on civility and topicality, we get to sidestep this issue.

                                                            1. 7

                                                              Any of the comments that article references are clearly outside decorum and, if posted here, would warrant administrative action.

                                                              1. 8

                                                                Weev is a public figure. Weev was banned from gab. Weev could participate anonymously on lobsters. If weev wants to post here as weev, is that OK?

                                                                1. 8

                                                                  Why wouldn’t it be, if he follows the rules and isn’t an asshole and contributes to on-topic discussion?

                                                                  It being weev, I imagine it would be less than an hour before he gets banned for saying stupid Nazi shit, but might as well give the fellow a chance.

                                                                  Our purpose here isn’t to punish people for actions in other communities; our purpose is to discuss technology.

                                                                  1. 5

                                                                    Weev is a public figure known for being a Nazi. For weev to be named as weev, it’s the same as https://lobste.rs/u/neonazi .

                                                                    Weev could go by a different name to participate in lobsters.

                                                                    1. 0

                                                                      Pretty sure there are many internet users with that nickname - most probably are unaware of some rando from US. To be honest I never heard about that guy until today. If he would have an account here I would judge him by what he writes here without crosschecking him across other sites. Who does that?!

                                                        2. 7

                                                          I won’t say it because I don’t believe it.

                                                          I would rather have a polite Nazi talking to me about technology than either a rude not-Nazi talking about technology or a polite not-Nazi talking about not-technology. As somebody mentioned above re: the Nazi variant of the Turing test…a sufficiently polite and topical Nazi is indistinguishable from a normal user, because they’re presumably not talking about Nazi shit and picking on Nazi victims.

                                                          If they are, the rules of civility and topicality give a handy way–and a more uniform way–of dealing with them. Even better, it gives a way of dealing with them that doesn’t give them the recourse of saying “Well you’re just doing this because you hate Nazis”, or “You’re just doing this because you support SJWs”, etc. I can point at the rules and say “You were off-topic and being uncivil. I don’t need to believe anything about Nazis or your relationship with that ideology to get rid of you.”

                                                          1. 22

                                                            Apparently you definition of civility includes telling me and other Jews to “mellow out” about people wanting to murder us. No thanks.

                                                            1. -9

                                                              Do you want to murder them, given that you (by my reading here) believe they are a clear and present danger to you and yours?

                                                              1. 17

                                                                This is too far. There are diminishing returns now on this conversation and also both of you seem to have lost perspective that this post is about finding new moderators because pushcx might be under huge moderator load - you’re not helping. At the least, take this to a different venue or to personal chat to hash it out and bring back here any positive results.

                                                                @itamarst You are talking about a subject which is understandably extremely sensitive and important to you. I think everyone can and would acknowledge the pain that you and your family must have gone through, and it is a failing of people in this conversation that that is not the first and most obvious point to be reiterated and repeated without fail. We all must acknowledge that terrible things have happened and that we want to take positive actions to prevent them happening again. That being said you are grossly not applying good faith in a situation where one person’s actions seem to have been offensive to you, and you are bringing a subject that is most definitely off topic for lobste.rs into this space. In relation to the former, you could have chosen a much more amicable way of bringing your point forward such as: Quoting friendlysock, explaining how you reacted to and felt when you read his comment and asking friendlysock to confirm if that was his intention and to clarify his meaning if it was. You definitely could have done that constructively inside the context which was friendlysock applying to be a moderator, so you could have phrased your question in a way relevant to this topic. No one would ever question your pain or your discomfort at seeing discussions of a group of people that brought great harm to your family and by extension pain to you; you do not have to not be angry, or not be in pain; but having the expectation that you can bring this up in this way in this space and the outcome be constructive is poor judgement: whether or not this was a motivation, you are not going to get personal resolution to political issues that cause you pain on lobste.rs.

                                                                @friendlysock Whatever your position you are grossly failing to take a step back and acknowledge itamarst’s point where he is now, not where you think he should be or how you think his point relates to lobste.rs. If you keep doubling down on your position, itamarst has to double down on his. This does not seem like rocket science. Whether this is on topic or not, when someone has gone to the effort and made themselves vulnerable by presenting something they are angry or in pain about, particualrly if it’s such a HUGE subject as this with so much emotion attached, step 1 is acknowledge that and consider your position in relation to what they said. You have no idea how they feel and you can not begin to understand their position so if they are offering you this level of confrontation the most you can do is acknowledge and listen. You don’t have to take responsibility for having caused their pain - no one is calling you a nazi or accusing you of murdering people, but you do have to acknowledge that they felt a particular way after reading what you wrote, and if you want to, you can explore that, but with about 1000 times more sensitivity. Acknowledgement and reiteration of your fundamental positions as they relate to lobste.rs, or moderation on lobste.rs would perhaps be a way to frame your position, if you’re interested in doing that.

                                                                1. 16

                                                                  “Good faith” only goes far when some spends so much effort explaining how important it is we include Nazis in our discussions. Especially when they want to be a mod.

                                                                  And really the whole point of the exercise is mod policy. As I’ve said before, in other discussions, you gotta pick a side. And the clearer friendlysock’s opinions, the clearer the choice pushcx has to make.

                                                                2. 13

                                                                  Enough is enough. You are bullying itamarst with repeated emotional manipulation by way of a topic that has violently effected them, apparently so that you can get them to call for killings on a thread in which you nominated yourself to moderate the community in pursuit of civility. Are you done trolling yet?

                                                                  1. 6

                                                                    Do you want to murder them

                                                                    Come on, this is too much.

                                                                    1. 6

                                                                      No, of course not.

                                                          2. 32

                                                            no offence, but I find that “mellowing both sides” is a very legit goal. seeing as I’ve spent most of my life in a warzone, this goes very well with me. I’m not jewish, but I’ve had multiple run-ins with Neo-Nazis due to the way I look and where I escaped the war to. I used to hang out in this bar that was split in half, one of it was extreme leftists, and the other were staunch Nazis, some not even Neo. we were all fucked, so we just drank together in a weird peace of sorts. one of the Neo-Nazis never liked the fact that I started hanging out there, and was constantly hostile, and due to past experiences I had to often stay alert and make sure to be ready for whatever may come, but the beer was cheap mind you and the weed was good.

                                                            one of the Neo-Nazis in particular was this big guy who had it so clear in his eyes that he’d like to beat the shit out of me to prove his worth or whatever. I didn’t care as this was the least of my worries (at that time). one of the old men I used to hang out with was a programmer as well, so we’d get high and discuss all sorts of computer things. one day the convo came to Blender and 3D modelling, and all of a sudden this big guy who never wanted to exchange a word with me and rather punches came and started talking about Blender with love in his eyes instead of hate, after a couple of hours of that he threw the shittiest but unfortunately the most fitting line of all:

                                                            “your people aren’t too bad after all.”

                                                            we actually continued conversing after that and went through a couple of his traumas and why he ended up on the path he ended up on. I by no means expect everyone suffering from oppression to engage in such antics with their oppressors, but I’d rather the ones who can’t, let the one who can, do what they gotta do.

                                                            at the very least, you can try to not monopolize suffering under your own school of thought, and within only your own context.

                                                            this is probably my last comment here for a while, so feel free to PM if you wanna discuss this further. I am also very sad to hear about your grandma, it sucks to be almost murdered, it sucks to see people you love get murdered, and it sucks to see people you love commit murder, but that shit happens on all sides of aisle.

                                                            dehumanize one, and you dehumanize all, I find.

                                                            fucking hell, I need a beer.

                                                            1. 27

                                                              Thank you for sharing! I think that’s slightly missing the point, though:

                                                              1. The issue was with “both sides”. Why do I need to “mellow” if someone wants to murder me?
                                                              2. You are describing a truce backed by violence. And that might work for some, but the more common case is people not going into the bar at all, because they don’t feel safe.

                                                              I’m sure many Nazis have reasons for how they ended up where they are (though in the US a lot of them aren’t suffering at all, they’re upper middle class or rich). Maybe hanging out with Nazis will make them change their mind. I doubt it, but it’s possible.

                                                              But given the choice between making a safe environment for everyone, and letting some Nazis in in the vague hope they will learn something and lots of other people choosing not to participate, I’d rather choose the latter former.

                                                            2. 10

                                                              You know, I can sympathise with your viewpoint here, especially as a Muslim in the current global climate, but the problem I see is that this seems to be leading to such extreme echo chambers, that it makes people say things like what one user in the thread you linked said:

                                                              Feminists believe that women are as human and as entitled to agency and dignity as men are; MRAs believe that women are inferior to men and should be enslaved.

                                                              This is such an absurd statement to make without backing up and so patently false; the only way someone can believe this is by being fed a constant diet of lies people who really hate MRAs instead of just speaking to MRAs directly.

                                                              Suddenly, we’re not just banning Nazis who want to kill you and me and our entire family trees, we’re banning practicing religious people who aren’t willing to rewrite their holy scripture or reinterpret it to suit people’s desires, we’re banning critics of said religious folks who believe baby penises should remain intact — hey, they’re MRAs, right?; whatever, they must be islamophobes or antisemites either way — we’re banning critics of affirmative action, we’re banning all manner of people with valid and not so valid positions or arguments.

                                                              We don’t discriminate on truth, we discriminate on whether it’s comfortable or not to a select group of people. People who can’t discriminate between a belief like, “men and women have roughly equal average IQ, but the distribution is wider for men, so the ratio of men to women at Google is roughly what we’d expect if Google were selecting for such and such IQ” — responding with such inanity as “do the women at Google not belong there, then?” — and a belief like, “women are inferior to men and so should be enslaved to them”.

                                                              1. 20

                                                                I think that if I were on a rocketry forum I’d be interested in hearing what Wernher von Braun had to say (not merely a Nazi, but an officer in the SS). If I were on a forum about filesystems, I’d be happy to talk to Hans Reiser. If I were given the opportunity, I think that Konrad Zuse (not a Nazi, but certainly a collaborator) would have interesting things to say about electromechanical computer design.

                                                                I’d be more than happy to throw any of them out if they start going into politics or murder, but if they have useful expertise and follow the rules of decorum, they should have a place.

                                                                1. 15

                                                                  Let me put it like this: if Hans Reiser would join a forum where Nina Reiser’s brother (or sister, close friend, etc.) would also participate, would you think it’s reasonable if they would object to this?

                                                                  It’s not hard to see how this would also extend to neo-Nazis (as in, literal neo-Nazis, who looked at the Holocaust and thought that all of that was just a spiffing good idea); would you enjoy interacting with someone who literally wants to kill you and everyone like you and worships an attempt to do exactly that? Are many people not a victim of these people’s actions just as much as Nina’s Reiser’s brother is? Would you happily discus webdesign best practices with the person running StormFront or some other neo-Nazi website?

                                                                  I’m not so sure if “it’s limited to just technical conversation” is really all that important, never mind that this is too limited of a view of Lobsters IMHO, as it’s a community centred around technical topics.

                                                                  For all we know Reiser or the StormFront maintainer are already participating on Lobsters anonymously. We can’t really prevent that because the only alternative would be to actively vet members. But if you know you’re talking to the StormFront webmaster then … yeah, I’d rather not.

                                                                  I’m not suggesting that we implement some sort of wrongthink policy or anything of the sort; you put forth the extreme scenarios so I’m replying to those, and in more realistic scenarios things tend to be some shade of grey. If someone on Twitter said “I don’t like people of religion/ethnicity/identity X” then that would probably be okay; as in, I won’t like them more for it, but I see no reason to ban them here for just that. But I do think all of this is a bit more complicated than you put forth.

                                                                  1. 18

                                                                    Would you happily discus webdesign best practices with the person running StormFront or some other neo-Nazi website?

                                                                    Let’s apply a variant of the Turing Test to this: if people from the interactions alone cannot tell whether they are made by a regular person or a Nazi, then the poster/commenter can be regarded as worthwhile talking to as any other normal person.

                                                                    1. 5

                                                                      Yes. Nobodies forced to use real names on lobsters. If someone posts anonymously, respect it. Don’t dox.

                                                                      It’s not the same if he/she uses their neo-Nazi name. Lobsters has no moral obligation to be known as the place where neo-Nazis hang out.

                                                                      1. 10

                                                                        Yeah I think there’s a bit of a straw man being thrown around in some of these discussions about being randomly chosen as the target of doxxing. It’s pretty easy to be anonymous on this website.

                                                                        To even be perceived as a member of a hate group on a site like this would require affirmative signaling to one’s peers that they hold hateful views towards other members of the community for their birth-given human characteristics, which seems like a good enough reason to remove such a user in the first place.

                                                                        1. 3

                                                                          Yes. Nobodies forced to use real names on lobsters. If someone posts anonymously, respect it. Don’t dox.

                                                                          Yes, I pretty much said as much later on: “We can’t really prevent that because the only alternative would be to actively vet members” (that this isn’t feasible isn’t stated explicitly, but it’s pretty clear to everyone that it’s not).

                                                                          I think both you and @ewintr have missed the point of my reply; this entire discussion is fairly hypothetical because of course no neo-Nazi is going to link to their StormFront account on their Lobsters profile (or Gab, or wherever these people hang out these days). I just wanted to point out why having known neo-Nazis on Lobsters is something that people would object to, and why some people would choose not to visit Lobsters if this were the case.

                                                                          1. 3

                                                                            No. You’re wrong. It won’t remain hypothetical. Look at how many people got caught from the 6th based on social media.

                                                                      2. 6

                                                                        would you think it’s reasonable if they would object to this

                                                                        I totally would understand why they might object to this. Then again, dude was put into prison and served his time. According to the law, he has received his punishment. Anything further is just extrajudicial retribution–understandable but not lawful.

                                                                        would you enjoy interacting with someone who literally wants to kill you and everyone like you and worships an attempt to do exactly that?

                                                                        If they were polite and solved my problem, sure. It’d be weird, but I’d rather have the help than not. The second they started going on about that other stuff, I’d report them cheerfully.

                                                                        For all we know Reiser or the StormFront maintainer are already participating on Lobsters anonymously.

                                                                        Exactly. For the dedicated opposition, this kneejerk intolerance serves no real obstacle–and can even be really useful as a leveraging point to disrupt a community. It’s like people have never played Among Us.

                                                                        but I see no reason to ban them here for just that.

                                                                        The problem is, several Lobsters I believe would be more than happy to do that, and would want it in a CoC. Further, where do you draw the line? How much Nazi is too Nazi? How little pedophilia is acceptable? I don’t want to make those calls–I’d rather focus on the (much simpler) tests of a) has this user treated other users respectfully in this space and b) has this user stayed on-topic. If followed, I believe those two rules are sufficient to guarantee a good time for everybody.

                                                                        But if you know you’re talking to the StormFront webmaster then … yeah, I’d rather not.

                                                                        As an aside, the world-wide experts in decentralization are about to all be, or keep company with, some really distasteful people. Ignoring their experience because they’re icky strikes me as a waste.

                                                                        1. 4

                                                                          The Reiser case is a bit more complicated, as I agree criminals should be given a second chance. However, it’s not unreasonable for victims of the crime to still harbour (strong) feelings of animosity; I don’t think that’s “extrajudicial retribution”. I don’t think that many people would happily chat with their sister’s murderer about filesystems after they served their time.

                                                                          At any rate, I only mentioned Reiser to illustrate the perpetrator/victim relationship, as it’s so clear in this case. I was tempted to leave that out entirely as it’s quite a different case from neo-Nazis.

                                                                          would you enjoy interacting with someone who literally wants to kill you and everyone like you and worships an attempt to do exactly that?

                                                                          If they were polite and solved my problem, sure. It’d be weird, but I’d rather have the help than not. The second they started going on about that other stuff, I’d report them cheerfully.

                                                                          Alright, fair enough. But it’s not hard to see how other people would make a different choice here.

                                                                          where do you draw the line? How much Nazi is too Nazi? How little pedophilia is acceptable?

                                                                          I don’t have clear answers to that; but this is a kind of reasoning I don’t really like. Maybe there’s a better name for this, but I like to call the “it’s hard fallacy”, which goes like: “it is hard to draw a line, therefore, we should not draw a line at all”.

                                                                          I’ve seen the same type of reasoning in conversations about civility. It can be really hard to draw a clear line about what is or isn’t acceptable, but that doesn’t mean we shouldn’t try at all. Clearly there should a line somewhere otherwise people replying with just “you’re a cunt” would be “acceptable”, and I think we can agree that it’s not. You can also see this fallacy in some other (political) topics.

                                                                          I’m not actually in favour of banning people for off-site behaviour unless it’s particularly egregious, such as active neo-Nazis, and even then I’d have to carefully look at the specific case at hand. In general I think the bar should be pretty high for this, but I do think there is a bar … somewhere.

                                                                          I mean, do you really expect black people or Jewish members to happily interact with people we happen to know are neo-Nazis or KKK members? If someone in your local soccer club is a great bloke and fun to hang out with, and then you discover he’s a Grand Hobbit Ghoul in the KKK (or whatever ridiculous ranks they have) then you would continue that relationship as-if nothing happened (and before you answer “yes I would”, would you expect everyone to do so, including your black teammates?)

                                                                      3. 16

                                                                        The problem, of course, is that then you lose all the people who don’t want to hang out with Nazis, or with people (like Hans Reiser) who murdered their wife.

                                                                        1. 25

                                                                          In an online forum for talking about X, I’d much rather have a room full of people who may be assholes elsewhere talking politely about X than I would a room full of people who might be lovely elsewhere being assholes in my forum because of something completely unrelated to X.

                                                                          1. 7

                                                                            Thank you for this succinct explanation.

                                                                          2. 12

                                                                            On the internet, no one knows you’re a dog.

                                                                            Who’s to say what someone’s intentions are? If people start causing problems, by all means remove them. The alternative is doxxing everyone who joins lobsters or digging up dirt, is that somehow a better alternative?

                                                                            I get it, no one wants to share a board with Nazis or murderers. I don’t either. But this social equivalent of a preemptive strike has the potential to be way worse.

                                                                            1. 11

                                                                              A good rule of thumb, in programming and elsewhere, is to always consider at least three solutions to any problem. There are in fact other solutions beyond the false dichotomy “doxxing everyone” and “accepting everyone”, one common one being a Code of Conduct. Personally I would go with “you must pass this very bar to participate”.

                                                                              1. 7

                                                                                Just because a comparison of two solutions are presented doesn’t mean you have to jump to “this is a false dichotomy.” Also, I thought we already had that with the lobsters rules? How does a code of conduct actually differ?

                                                                                1. 15

                                                                                  Well, friendlysock apparently can compare Nazis as somehow equivalent to their victims (both sides apparently need to “mellow”). Most CoC would involve kicking him out for that.

                                                                                  1. 6

                                                                                    I don’t agree with the comparison and I don’t think friendlysock would be a good mod based on the fact that he could draw it. I just want to put this out there though - if there was a felon, Nazi or other unsavory person who could provide some insight into problems I’m trying to solve then I would still have an open ear so long as they stay on topic and don’t bring up their unrelated interests. Not doing so seems short sighted.

                                                                                    Most Codes of Conduct are pretty crappy btw. Ruby has a good one, nearly all of the others are too suffocating.

                                                                                    1. 3

                                                                                      I think both you and @itamarst may be missing something in how I wrote that–and that’s on me for articulating incorrectly.

                                                                                      My point was not to draw equivalence between those groups. My point was that everybody has some outgroup that they would prefer to see kicked out.

                                                                                    2. 4

                                                                                      Maybe you should resolve that with friendlysock, then. Not going to fan these flames anymore.

                                                                                2. 9

                                                                                  How is it “pre-emptive strike” to just not want to hang out with people you don’t like?

                                                                                  This isn’t like…. the seat of government. This is a place to talk with people. Absolutely nobody is under any obligation to listen to people (short of mods basically “kicking people out”). There is zero moral requirement to listen to “varied viewpoints” or have an open mind.

                                                                                  EDIT: And pointing to a previous declaration of moderation wishes as “digging up dirt” in a conversation about mod applications is rich. Are we supposed to just treat every conversation in some weird vacuum even when it comes to something so obviously relevant? I know you’re saying this in good faith but how is that not fair game?

                                                                                  And like… you know what? These people that get doxxed or whatever? They are the ones that are vocal about their opinions. That’s how you even know that they are these kinds of people. If they kept their mouth shut we wouldn’t even be able to know!

                                                                                  I’m tired of being lectured about how I’m the bad person for not wanting to deal with people who not only are (IMO) morally bad people, but also don’t have the social IQ to keep it to themselves.

                                                                                  1. 10

                                                                                    These people that get doxxed or whatever? They are the ones that are vocal about their opinions.

                                                                                    Alright, where does the dirt digging stop, then? Everyone that’s somehow associated as commenting in this thread, supportive or otherwise? Because they may somehow have an agenda too?

                                                                                    Dude, you’re not the bad person. No one’s saying you are. I’m just done with communities that engage in shit slinging, doxxing, and public shaming rather than actual discussion in good faith.

                                                                                    Anyway, peace out, lobsters. N-gate was right about you.

                                                                                    1. 4

                                                                                      I had someone PM me with personal details about myself while using a randomized username on reddit a few years back because I said that I didn’t think Ohio State was very good that year. People dox and dig up dirt for varied reasons. The nazi thing is an extreme example of that, but it happens for all sorts of other strange reasons as well.

                                                                                      I no longer use Reddit because of that event, and now I try to stick to a minimal set of social sites (like this one) where it’s obvious who I am if you search my username or look at my profile.

                                                                                      I don’t think you should feel obligated to listen to someone’s viewpoint if it’s non-technical (or even if it is technical really), but in this forum, the less I know about people, the better. I like hearing opinions or thoughts on tech without knowing who they are. I can’t control how they think or feel otherwise.

                                                                                  2. 5

                                                                                    Are you asking for Lobsters (and its mods, etc.) to:

                                                                                    • Explicitly condemn Nazism, white supremacy, and murder
                                                                                    • Ban anyone who publicly espouses these ideas, on or off our site
                                                                                    1. 24

                                                                                      You write as if that would be some kind of absurd idea, when it seems quite sensible to me..?

                                                                                      1. 10

                                                                                        thank you for objecting to that.

                                                                                        reductio ad absurdem requires absurdity, and I’m not used to seeing “explicitly condemn Nazism” held forth as obviously absurd.

                                                                                        1. 5

                                                                                          It seems absurd to me because it’s kind of a given. Not every site needs to say “hey don’t murder people” for me to feel good about using it. It’s a general human sentiment that murder is bad. Explicitly stating it and only targeting those viewpoints makes me wonder why we aren’t explicitly denouncing every type of supremacy, nativism, genocide, rape, etc.

                                                                                          But I do think banning people who espouse any of those views (spoken or unspoken) on the site is not only warranted, but should also lead to a probationary period for the person who invited them.

                                                                                          1. 7

                                                                                            I don’t think we need to make a list of things we don’t agree with. But I do think that we should be clear that people who are known for their malicious activities (e.g. support for murder or racism) are not welcome here.

                                                                                          2. -1

                                                                                            Putting this bluntly, the second one is stupid and anyone who argues for it is stupid. On or off our site? What the hell. Maybe in person I could logic my way into thinking that it’s ok but online? Thousands of miles away with no immediate threat to my wellbeing?

                                                                                            Online there’s always going to be that one jerk who doxes someone else for wrong-think and it’ll start with this.

                                                                                            1. 12

                                                                                              Thank you for proving your commitment to the cause of rational discussion by calling me stupid.

                                                                                              The thing is, we want Lobsters to be a place where all people are welcome. If we allow known neo-nazis to hang out with us, then people that feel threatened by those neo-nazis won’t come here. Sure, it’s not a threat to them per se, but why would you want to spend your free time talking to people that literally want you dead?

                                                                                              Being a neo-nazi is a choice. Belonging to a minority group isn’t. We should give the neo-nazis the boot and welcome the members of minority groups.

                                                                                              1. 5

                                                                                                why would you want to spend your free time talking to people that literally want you dead?

                                                                                                Because they have information I want and are capable of staying on topic for the site I’m on. I do not care what they do anywhere else. It is incredibly vexing that people are making me defend the scum of humanity.

                                                                                                I believe all people are welcome on lobste.rs if they’re not talking about tons of off-topic stuff and spewing out hate while they’re here.

                                                                                                1. 13

                                                                                                  Do you also want information from people who, for example, would feel uncomfortable sharing a discussion forum with neo-nazis?

                                                                                                  This isn’t value-neutral, we have a choice to make: either we welcome the neo-nazis, or we welcome the people-who-don’t-want-to-talk-to-neo-nazis. I know who’s getting my vote.

                                                                                                  1. 5

                                                                                                    This isn’t value-neutral

                                                                                                    I reject that premise.

                                                                                                    The nazi stuff should not enter the flow of conversation for nearly any thread on lobste.rs. The only reason we’re discussing it now because this is a meta thread and it was brought up by itamarst. If he hadn’t then we’d not know and not care.

                                                                                                    So I think that if we actually talk about the things that we thought we were going to talk about when we were invited in the first place there won’t be any issues with your first sentence.

                                                                                              2. 7

                                                                                                Please don’t call other users or standpoints stupid. It’s okay to disagree, it’s even better to providing reasoning, but name-calling never helps.

                                                                                          3. 7

                                                                                            You only lose the people who care more about Nazi status more than technology–and they’d doubtless be happier elsewhere, in a community that puts ideology and identity above knowledge and civility. I’ve made my peace with that.

                                                                                            I don’t think that you can fundamentally ensure that people always feel welcome, and there is no surer road to ruin than to cater to everybody’s exclusionary preferences. Everybody has a reason to hate Nazis, or furries, or Republicans, or women, or whatever–the only way a community grows and flourishes is by providing people the space and protocols to interact without requiring alignment on those things.

                                                                                            Don’t want to take up more space here on it, but am happy to continue discussing in DMs with whoever would like to.

                                                                                            1. 34

                                                                                              The fact that you seem to define “civility” as - roughly speaking - some sort of shallow politeness enabling us all to chum it up with nazis so long as we’re speaking about computers, rather than as good citizenship and strong community built on respect for one’s peers suggests to me that you’d be a terrible moderator.

                                                                                              1. 20

                                                                                                Agreed, that kind of response seems like it comes from a place of privilege. As in, “this doesn’t concern me too much, what’s the big idea?”

                                                                                                It’s been interesting to see convos here and elsewhere around accepting views that are rooted in hate but somehow we should all just suck it up because that’s “fair.” I’m often the only Black person in cis-White male dominated spaces so this is nothing new to me. Just…interesting to see this play out in the open for the first time.

                                                                                                Confronted with the knowledge of one’s privilege blinding oneself to what the disenfranchised has known to be true for eons is fascinating to watch/read.

                                                                                                1. 5

                                                                                                  I’ll politely point out that my view would extend, were the conversations civil and on-topic, to folks like Malcolm X or Newton or Seale–not just stuffy old white dudes.

                                                                                                  I think that, as John Perry Barlow observed, we here in cyberspace have the opportunity to transcend the strife we were all born into. Part of that means evaluating people based on their behaviour and not on what we think about their beliefs.

                                                                                                  Edit: fixed rather embarrassing misattribution.

                                                                                                  1. 13

                                                                                                    (Davos is a place in Switzerland. That piece was authored by John Perry Barlow. I recommend the movie Hypernormalisation, there’s a very interesting part featuring Barlow and the other technolibertarians, discussing the connections to the counter-culture movement in the 60s)

                                                                                                    I cannot help but find this sort of cyber-utopianism incredibly naïve. Things that happen on the internet can and do have effects on people in the real world. It’s been a long, long time since “just walk away from the screen, just close your eyes” was a genuine take to have.

                                                                                                    1. 4

                                                                                                      Thanks for catching that, still waking up.

                                                                                                      It’s a naive approach, but that’s kinda the point right? Like, should we not strive to live in that more ideal, simpler, better world?

                                                                                                2. 2

                                                                                                  good citizenship

                                                                                                  What do you mean by this?

                                                                                                  I agree btw.

                                                                                                3. 18

                                                                                                  Everybody has a reason to hate Nazis, or furries, or Republicans, or women, or whatever

                                                                                                  I think you may be lumping together several dissimilar attitudes here.

                                                                                                  I do not think lobste.rs is suffering from including “the wrong people” or anything like that. We probably do have some people with terrible opinions, but it doesn’t leak into our usual discussions.

                                                                                                  However, I do think it would be bad to have a mod to express the attitude that “some people hate Nazis, some people hate women. A pox on both their houses!”

                                                                                                  I say “express” because I am not saying what you really think is “hating women is equivalent to hating Nazis”. But a mod has to be careful.

                                                                                            2. 6

                                                                                              Why stop with Nazis? If anyone shows any Nazi propaganda, they should be out. But let’s extend it to all other groups that cause harm to others. Any member of US army should be gone, heck, they didn’t try to kill my grandma, they killed my relatives, which were civilians (and they are still killing others in my country due to depleted uranium that was used in bombings). Also all the members of tech companies that help these strikes (looking at you, Microsoft et al).

                                                                                              Obviously, I’m exaggerating here to show a point that if we only look at membership of a group to exclude someone, we might also start extending the groups, as various people can/are affected. Personally, I don’t care which group people belong to, as long as they are not a threat to my family and are trying to help (or are just plain neutral) — which I think plenty of people here are, and that’s the main reason I come to this site.

                                                                                              1. 9

                                                                                                We did exactly this when a Palantir showed up to show a neat thing. It was one of the most shameful things I’ve seen in my time here.

                                                                                                1. 5

                                                                                                  You are not exaggerating at all.

                                                                                                  1. 2

                                                                                                    This reads like the opposite-day version of “First they came…” by Martin Niemöller.

                                                                                                    1. 1

                                                                                                      That is a great poem that I have only heard so far paraphrased. Thanks for sharing! However, it has been a rough week for me, so I don’t get the “opposite-day version” part, could you elaborate?

                                                                                                  2. 4

                                                                                                    Circumstances under which I would be OK with an Actual Nazi participating (both conditions must hold):

                                                                                                    1. User does not reveal themselves to be a Nazi on the site, either by explicit statement or in the way they act, and
                                                                                                    2. User is not notoriously a Nazi externally to the site, either for having done something terrible or by making themselves a “public figure” wrt their viewpoints.

                                                                                                    If someone behaves themselves on the site, and their behavior on the site does not create distress for others, I don’t see why people should be encourage in shitstirring. (If it is inevitable that someone’s presence will create distress, regardless of the behavior of anyone on the site, I would strongly suggest they use a pseudonym.)

                                                                                                    “Nazi” is an unlikely and hyperbolic example, but I’ve seen people go and seek out damning information of one sort or another about a member of a community (including doxxing them), and then make it a thing. It wouldn’t have been a thing, and wouldn’t have caused stress to members of oppressed populations, if they didn’t do that! By digging, they’ve actually caused harm. So my rule would be that the notoriety has to originate externally or via direct actions on the site, or you just incentivize this ugly community antipattern.

                                                                                                    (Some of my ancestors were murdered by Actual Nazis or had to emigrate to avoid them, in case you need that for my opinion to be valid.)

                                                                                                    ((EDIT: I don’t want to be a mod, though.))

                                                                                                  3. 8

                                                                                                    Maybe don’t apply if you’re seeking to do if because you think it’s what people want you to do… Someone with that personality might be inclined to lose interest before their term is up if they think popular opinion is drifting away from them…

                                                                                                    1. 22

                                                                                                      My reasoning–and I’ve always held this position–is that anybody seeking such a position is either a lunatic, a tyrant, or both, and not to be trusted. Myself included.

                                                                                                      That said…

                                                                                                      Look, if we’re down to just one moderator, that’s a rough gig. That, plus the current state of the world, makes me worry for the site focus and discussion culture of Lobsters, and if I can help I’m happy to do so–and pushcx is welcome to shitcan and ban me (and will likely do so with great relish) at will should I fail in my duties.

                                                                                                      Asking for sufficient votes before appliying is me, in effect, getting a gauge of if the community would agree to abide. As we’ve seen in my country this year, the legitimacy of government ultimately stems from the consent of the governed.

                                                                                                      1. 11

                                                                                                        And as I’ve seen in my country (US) this year, it’s wise not to give power to folks who are in it for the attention :P

                                                                                                        1. 5

                                                                                                          I personally (and I have a decidedly average number of internet points) like the way your postings changed when your nick changed to friendly. That change shows an appreciation of your past and new styles that I would like to see in moderators.

                                                                                                        2. 2

                                                                                                          TBH asking to be upvoted seems like a bit of a conflict of interest with wanting to be a mod… as friendlysock said

                                                                                                        3. 7

                                                                                                          :(

                                                                                                        1. 5

                                                                                                          For example this great study shows that using Typescript would have prevented approximately 15% of all bugs that you find in typical Javascript code. It’s hard to argue against static types with evidence like that.

                                                                                                          And yet, there is no shortage of contrarian people who will pop up to do just that :-)

                                                                                                          1. 8

                                                                                                            *waves*

                                                                                                              1. 4

                                                                                                                The OP is talking about a paper not in that set: https://web.archive.org/web/20191014123107/http://ttendency.cs.ucl.ac.uk/projects/type_study/documents/type_study.pdf

                                                                                                                @yawaramin has been teasing me for a while because I keep meaning to do a serious analysis of the Typescript paper but never get around to it

                                                                                                                1. 3

                                                                                                                  But that post does illustrate a meta point: mere existence of a paper is not a strong evidence, sadly.

                                                                                                                  1. 3

                                                                                                                    Of course, the existence of the paper doesn’t prove anything, you need to actually read the paper and judge whether it’s doing a good job.

                                                                                                              2. 5

                                                                                                                On the Impact of Programming Languages on Code Quality

                                                                                                                “This paper is a reproduction of work by Ray et al. which claimed to have uncovered a statistically significant association between eleven programming languages and software defects in projects hosted on GitHub. … We uncover a number of flaws that undermine the conclusions of the original study as only four languages are found to have a statistically significant association with defects, and even for those the effect size is exceedingly small.”

                                                                                                                1. 2

                                                                                                                  What matters for a business is to create a product, as fast as possible, that people use.

                                                                                                                  Certainly shipping bugs is counter-productive but is not the only metric. What you have to demonstrate is that it would have taken less time to get to a stable point using TypeScript than JavaScript. If it takes 2x longer to write code because of the extra type annotations and slower tooling, it might not offset the extra time that a JavaScript developer would have taken fixing those 15% extra bugs.

                                                                                                                  The 2x number is pulled out of thin air and I’m not saying that JavaScript is superior. In my experience, the number of bugs is not linear to the size of the codebase and dynamically-typed language tends to hit a plateau where it becomes an unmanageable mess more quickly than statically-typed languages. Another metric is that teams that are familiar with a given language are more productive in it, even if it has a lot of quirks.

                                                                                                                  Just saying that language choices is a complicated topic :)

                                                                                                                  1. 1

                                                                                                                    Language choices are indeed complicated topics, especially that even the “rule of thumb” you provided as the first sentence is not true in every circumstance. I agree that most startups and many larger businesses value releasing an MVP as fast as possible, but I worked for at least a couple of projects where correctness and code quality was highly valued, even more so than release speed. A simple example I might give is the hard medical sector where life is at stake.

                                                                                                                    Does it mean that Rust is a perfect choice for those kinds of projects? No. There are certain standards that must be met. Some of the standards actually specify which languages are allowed or force you to use certain coding guidelines, avoid problematic parts of languages etc.

                                                                                                                1. 3

                                                                                                                  Odd the .cat TLD wasn’t used here.

                                                                                                                  1. 3

                                                                                                                    It’s hard to get unless you live in or operate your business out of Catalonia.

                                                                                                                    Edit: not entirely true, but still tricky https://en.m.wikipedia.org/wiki/.cat

                                                                                                                    1. 3

                                                                                                                      This is very on-brand for Catalonia…

                                                                                                                      1. 0

                                                                                                                        I kind of want to say meow and look at pictures of cats for ten minutes now.

                                                                                                                        1. 1
                                                                                                                      2. 3

                                                                                                                        I had zero problems getting tilde.cat which has nothing to do with Catalonia.

                                                                                                                        1. 3

                                                                                                                          I thought providing a Catalan translation was enough?

                                                                                                                    1. -7

                                                                                                                      Static typing… So cute.

                                                                                                                      1. 6

                                                                                                                        At least try to explain why something is a poor design instead of dismissing it.

                                                                                                                        1. 4

                                                                                                                          Seems quite close to Python’s type hints. Not mandatory to use at all, but if used correctly, it massively helps you find bugs.

                                                                                                                          1. 1

                                                                                                                            Yes, they can’t fix the wrong design, only put some patches on it here ant there.

                                                                                                                            1. 3

                                                                                                                              What wrong design do you have in mind?

                                                                                                                              1. 0

                                                                                                                                Dynamic typing.

                                                                                                                                It’s proponents claimed it superiority for years… And now all the mainstream dynamic languages try to add at least some static types. But you can’t just put it there easily, it needs to be baked into the heart of the language.

                                                                                                                                1. 1

                                                                                                                                  Languages like C++, Java and C# have been getting welcome additions like var, auto and polymorphic lambdas. There is virtually no modern language that requires you to specify the type of your iterator and good riddance, too. Let’s say that there is a convergence.

                                                                                                                                  1. 1

                                                                                                                                    Var, diamond etc. means that your code is still statically typed. You just don’t need to write the type by hand because it’s obvious for the compiler.

                                                                                                                                    It can look similar to dynamic languages… But type inference is static typing to it’s core (it isn’t by chance this comes from ML family).

                                                                                                                                    1. 1

                                                                                                                                      Moving static typing to tooling and giving hints to help that tooling is part of the convergence just like statically typed languages losing boilerplate is. There is no pedestal you can climb to say “they were wrong we were right all along”.

                                                                                                                                      1. 2

                                                                                                                                        No. They were wrong. And that’s why they now need to add boilerplate.

                                                                                                                                        You need to be statically typed to be safe and you need a good type system to be safe and remove boilerplate.

                                                                                                                        1. 5

                                                                                                                          On the same topic - handmade hero live reloading of c++ game engine:

                                                                                                                          1. 19

                                                                                                                            I’m probably not the only one with the opinion that rewrites in Rust may generally a good idea, but Rust’s compile times are unacceptable. I know there are efforts to improve that, but Rust’s compile times are so abysmally slow that it really affects me as a Gentoo user. Another point is that Rust is not standardized and a one-implementation-language, which also discourages me from looking deeper into Haskell and others. I’m not saying that I generally reject single-implementation languages, as this would disregard any new languages, but a language implementation should be possible without too much work (say within two man-months). Neither Haskell nor Rust satisfy this condition and contraptions like Cargo make it even worse, because implementing Rust would also mean to more or less implement the entire Cargo-ecosystem.

                                                                                                                            Contrary to that, C compiles really fast, is an industry standard and has dozens of implementations. Another thing we should note is that the original C-codebase is a mature one. While Rust’s great ownership and type system may save you from general memory-handling- and type-errors, it won’t save you from intrinsic logic errors. However, I don’t weigh that point that much because this is an argument that could be given against any new codebase.

                                                                                                                            What really matters to me is the increase in the diversity of git-implementations, which is a really good thing.

                                                                                                                            1. 22

                                                                                                                              but a language implementation should be possible without too much work (say within two man-months)

                                                                                                                              Why is that a requirement? I don’t understand your position, we shouldn’t have complex, interesting or experimental languages only because a person couldn’t write an implementation by himself in 2 months? We should discard all the advances rust and haskell provide because they require a complex compiler?

                                                                                                                              1. 5

                                                                                                                                I’m not saying that we should discard those advances, because there is no mutual exclusion. I’m pretty certain one could work up a pure functional programming language based on linear type theory that provides the same benefits and is possible to implement in a reasonable amount of time.

                                                                                                                                A good comparison is the web: 10-15 years ago, it was possible for a person to implement a basic web browser in a reasonable amount of time. Nowadays, it is impossible to follow all new web standards and you need an army of developers to keep up, which is why more and more groups give up on this endeavour (look at Opera and Microsoft as the most recent examples). We are now in a state where almost 90% of browsers are based on Webkit, which turns the web into a one-implementation-domain. I’m glad Mozilla is holding up there, but who knows for how long?

                                                                                                                                The thing is the following: If you make the choice of a language as a developer, you “invest” into the ecosystem and if the ecosystem for some reason breaks apart/dies/changes into a direction you don’t agree with, you are forced to put additional work into it.

                                                                                                                                This additional work can be a lot if you’re talking about proprietary ecosystems, meaning more or less you are forced to rewrite your programs. Rust satisfies the necessary condition of a qualified ecosystem, because it’s open source, but open source systems can also shut you out when the ABI/API isn’t stable, and the danger is especially given with the “loose” crate system that may provide high flexibility, but also means a lot of technical debt when you have to continually push your code to the newest specs to be able to use your dependencies. However, this is again a question of the ecosystem, and I’d prefer to only refer to the Rust compiler here.

                                                                                                                                Anyway, I think the Rust community needs to address this and work up a standard for the Rust language. On my behalf, I won’t be investing my time into this ecosystem until this is addressed in some way. Anything else is just building a castle on sand.

                                                                                                                                1. 5

                                                                                                                                  A good comparison is the web: 10-15 years ago, it was possible for a person to implement a basic web browser in a reasonable amount of time. Nowadays, it is impossible to follow all new web standards and you need an army of developers to keep up, which is why more and more groups give up on this endeavour (look at Opera and Microsoft as the most recent examples). We are now in a state where almost 90% of browsers are based on Webkit, which turns the web into a one-implementation-domain. I’m glad Mozilla is holding up there, but who knows for how long?

                                                                                                                                  There is a good argument by Drew DeVault that it is impossible to reimplement a web browser for the modern web

                                                                                                                                  1. 4

                                                                                                                                    I know Blink was forked from webkit but all these years later don’t you think it’s a little reductive to treat them as the same? If I’m not mistaken Blink sends nothing upstream to webkit and by now the codebases are fairly divergent.

                                                                                                                                2. 8

                                                                                                                                  I feel ya - on OpenBSD compile times are orders of magnitude slower than on Linux! For example ncspot takes ~2 minutes to build on Linux and 37 minutes on OpenBSD (with most features disabled)!!

                                                                                                                                  1. 5

                                                                                                                                    37 minutes on OpenBSD

                                                                                                                                    For reals? This is terrifying.

                                                                                                                                    1. 1

                                                                                                                                      Excuse my ignorance – mind pointing me to some kind of article/document explaining why this is the case?

                                                                                                                                      1. 7

                                                                                                                                        There isn’t one. People (semarie@ - who maintains the rust port on OpenBSD being one) have looked into it with things like the RUSTC_BOOTSTRAP=1 and RUSTFLAGS='-Ztime-passes -Ztime-llvm-passes' env vars. These point to most of the time being spent in LLVM. But no one has tracked down the issue fully AFAIK.

                                                                                                                                    2. 6

                                                                                                                                      Another point is that Rust is not standardized and a one-implementation-language

                                                                                                                                      This is something that gives me pause when considering Rust. If the core Rust team does something that makes it impossible for me to continue using Rust (e.g. changes licenses to something incompatible with what I’m using it for), I don’t have anywhere to go and at best am stuck on an older version.

                                                                                                                                      One of the solutions to the above problem is a fork, but without a standard, the fork and the original can vary and no one is “right” and I lose the ability to write code portable between the two versions.

                                                                                                                                      Obviously, this isn’t a problem unique to Rust - most languages aren’t standardized and having a plethora of implementations can cause its own problems too - but the fact that there are large parts of Rust that are undefined and unstandardized (the ABI, the aliasing rules, etc) gives me pause from using it in mission-critical stuff.

                                                                                                                                      (I’m still learning Rust and I’m planning on using it for my next big thing if I get good enough at it in time, though given the time constraints it’s looking like I’ll be using C because my Rust won’t be good enough yet.)

                                                                                                                                      1. 2

                                                                                                                                        The fact that the trademark is still owned by the Mozilla foundation and not the to-be-created Rust Foundation is also likely chilling any attempts at independent reimplementation.

                                                                                                                                      2. 1

                                                                                                                                        As much as I understand your point about the slowness of compile time in Rust, I think it is a matter of time to see them shrink.

                                                                                                                                        On the standard point, Haskell have a standard : Haskell 2010 . GHC is the only implementation now but it have a lot of plugins to the compiler that are not in the standard. The new standard Haskell 2020 is on his way. Implementing the standard Haskell (not with all the GHC add-ons) is do-able but the language will way more simple and with flaws.

                                                                                                                                        1. 2

                                                                                                                                          The thing is, as you said: You can’t compile a lot of code by implementing Haskell 2010 (or 2020 for that matter) when you also don’t ship the “proprietary” extensions.

                                                                                                                                          1. 1

                                                                                                                                            It is the same when you abuse GCC or Clang extensions in your codebase. The main difference with Haskell is that you, almost, only have GHC available and the community put their efforts in it and create a ecosystem of extensions.

                                                                                                                                            As for C, your could write standard-compliant code that an hypothetical other compiler may compile. I am pretty sure if we only had one main compiler for C for so long that Haskell have had GHC, the situation would have been similar : lots of language extension outside the standard existing solely in the compiler.

                                                                                                                                            1. 3

                                                                                                                                              But this is exactly the case: There’s lots and lots of code out there that uses GNU extensions (from gcc). For a very long time, gcc was the only real compiler around and it lead to this problem. Some extensions are so persistent that clang had no other choice but to implement them.

                                                                                                                                              1. 1

                                                                                                                                                But does those extensions ever reached the standard? It as asked candidly as I do not know a lot of the evolution of C, compilers and standard that much.

                                                                                                                                                1. 4

                                                                                                                                                  There’s a list by GNU that lists the extensions. I really hate it that you can’t enable a warning flag (like -Wextensions) that warns you about using GNU extensions.

                                                                                                                                                  Still, it is not as bad as bashism (i.e. extensions in GNU bash over Posix sh), because many scripts declare a /bin/sh-shebang at the top but are full of bashism because they incidentally have bash as the default shell. Most bashisms are just stupid, many people don’t know they are using them and there’s no warning to enable warnings. Another bad offender are GNU extensions of the Posix core utilities, especially GNU make, where 99% of all makefiles are actually GNU only and don’t work with Posix make.

                                                                                                                                                  In general, this is one major reason I dislike GNU: They see themselves as the one and only choice for software (demanding people to call Linux “GNU/Linux”) while introducing tons of extensions to chain their users to their ecosystem.

                                                                                                                                                  1. 2

                                                                                                                                                    Here are some of the GNU C extensions that ended up in the C standard.

                                                                                                                                                    • // comments
                                                                                                                                                    • inline functions
                                                                                                                                                    • Variable length arrays
                                                                                                                                                    • Hex floats
                                                                                                                                                    • Variadic macros
                                                                                                                                                    • alignof
                                                                                                                                                2. 1

                                                                                                                                                  If I remember correctly 10 years ago hugs was still working and maybe even nhc :)

                                                                                                                                                  1. 1

                                                                                                                                                    Yep :) and yhc never landed after forking nhc. UHC and JHC seem dead. My main point is mainly that the existence of a standard does not assure the the multiplication of implementations and the cross-cIompilation between compilers/interpreters/jit/etc. It is a simplification around it and really depends on the community around those languages. If you look at Common Lisp with a set in the stone standard and a lot of compilers that can pin-point easily what is gonna work or not. Or Scheme with a fairly easy standard but you will quickly run out of the possibility to swap between interpreters if you focus on some specific stuffs.

                                                                                                                                                    After that, everyone have their checklist about what a programming language must or must not provide for them to learn and use.

                                                                                                                                          1. 15

                                                                                                                                            I think Git is an excellent candidate for a rust rewrite. There’s nothing about it that really needs to be in C or benfits from being in C, it’s just one of the many userspace command-line tools that were written in C out of tradition. Rust is a better language that C that results in more maintainable and less bug prone code. There’s no reason not to use Rust for this kind of program (or at least avoid C).

                                                                                                                                            1. 17

                                                                                                                                              There’s no reason not to use Rust for this kind of program (or at least avoid C).

                                                                                                                                              Portability? Also bootstraping rust is kind of hard :| . Both issues are important for this kind of foundational software.

                                                                                                                                              But I agree that there are many reasons to use rust for this kind of program.

                                                                                                                                              1. 1

                                                                                                                                                How portable is Git? How many C compilers can compile it and for how many systems?

                                                                                                                                                1. 1

                                                                                                                                                  A quick search shows Git is available on AIX and Sparc systems, you can probably find more with better searches

                                                                                                                                              2. 15

                                                                                                                                                Git was created in 2005, Rust in 2010…

                                                                                                                                                That said, it’s a good idea to have multiple implementations of the same functionality. It wouldn’t surprise if GitHub was exploring alternatives.

                                                                                                                                                I’d like to expand on my point in the first sentence - what would have been a viable language for Linus to use to implement Git in 2005 (other than C/C++?). Git was designed as a replacement for BitKeeper to handle the Linux source tree. Using C in that case was an easy choice.

                                                                                                                                                1. 4

                                                                                                                                                  what would have been a viable language for Linus to use to implement Git in 2005

                                                                                                                                                  Python was used to created Mercurial in 2005.

                                                                                                                                                  1. 1

                                                                                                                                                    And haskell was used to create darcs in 2003.

                                                                                                                                                2. 14

                                                                                                                                                  Rust is a better language that C

                                                                                                                                                  That’s a subjective opinion. Rust has some mechanisms that protect against certain classes of programming errors, but it has many many other problems.

                                                                                                                                                  1. 1

                                                                                                                                                    Even without those mechanisms, it would still be a better language.

                                                                                                                                                    1. 1

                                                                                                                                                      By what metric?

                                                                                                                                                      1. 1

                                                                                                                                                        By everyone of them. Being better than C is hardly rocket science.

                                                                                                                                                  2. 4

                                                                                                                                                    Rust is a better language that C

                                                                                                                                                    Isn’t git written in Perl? </joke> … sorta

                                                                                                                                                    1. 3

                                                                                                                                                      I would suggest it was written in C as per the opinions of its author rather than out of tradition.

                                                                                                                                                      1. 6

                                                                                                                                                        Rust did not exist at the time.

                                                                                                                                                        1. 1

                                                                                                                                                          Sure, but C++ did.

                                                                                                                                                          1. 1

                                                                                                                                                            And we already know how Linus feels about C++:

                                                                                                                                                            YOU are full of bullshit.

                                                                                                                                                            C++ is a horrible language. It’s made more horrible by the fact that a lot of substandard programmers use it, to the point where it’s much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C.

                                                                                                                                                            In other words: the choice of C is the only sane choice. I know Miles Bader jokingly said “to piss you off”, but it’s actually true. I’ve come to the conclusion that any programmer that would prefer the project to be in C++ over C is likely a programmer that I really would prefer to piss off, so that he doesn’t come and screw up any project I’m involved with.

                                                                                                                                                            C++ leads to really really bad design choices. You invariably start using the “nice” library features of the language like STL and Boost and other total and utter crap, that may “help” you program, but causes:

                                                                                                                                                            • infinite amounts of pain when they don’t work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it’s not even funny)

                                                                                                                                                            • inefficient abstracted programming models where two years down the road you notice that some abstraction wasn’t very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app.

                                                                                                                                                            In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don’t screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don’t screw things up with any idiotic “object model” crap.

                                                                                                                                                            So I’m sorry, but for something like git, where efficiency was a primary objective, the “advantages” of C++ is just a huge mistake. The fact that we also piss off people who cannot see that is just a big additional advantage.

                                                                                                                                                            If you want a VCS that is written in C++, go play with Monotone. Really. They use a “real database”. They use “nice object-oriented libraries”. They use “nice C++ abstractions”. And quite frankly, as a result of all these design decisions that sound so appealing to some CS people, the end result is a horrible and unmaintainable mess.

                                                                                                                                                            But I’m sure you’d like it more than git.

                                                                                                                                                            and

                                                                                                                                                            It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

                                                                                                                                                            The fact is, C++ compilers are not trustworthy. They were even worse in 1992, but some fundamental facts haven’t changed:

                                                                                                                                                            • the whole C++ exception handling thing is fundamentally broken. It’s especially broken for kernels.
                                                                                                                                                            • any compiler or language that likes to hide things like memory allocations behind your back just isn’t a good choice for a kernel.
                                                                                                                                                            • you can write object-oriented code (useful for filesystems etc) in C, without the crap that is C++.

                                                                                                                                                            In general, I’d say that anybody who designs his kernel modules for C++ is either (a) looking for problems (b) a C++ bigot that can’t see what he is writing is really just C anyway (c) was given an assignment in CS class to do so.

                                                                                                                                                            Feel free to make up (d).

                                                                                                                                                                Linus
                                                                                                                                                            
                                                                                                                                                    1. -1

                                                                                                                                                      Can anyone recommend some material describing concrete motivations for adding generics to Go? I’m aware of the abstract idea that you need generics in order to build data structures that work with different types, but is there a real-world setting where this is actually better than just copying code and doing s/type1/type2/g? My sense is that projects that use complex data structures almost always customize the data structures in a way that depends on the data type being stored.

                                                                                                                                                      1. 19

                                                                                                                                                        I hope it’s not that hard to imagine wanting different data structures than hash maps; maybe your problem fits better into a binary search tree for example.

                                                                                                                                                        Well, I for one usually don’t feel like implementing my own red-black tree, so I would like to just grab a library. That library will be much nicer to use if I can just make an RBTree<string, MyFoo>. I certainly wouldn’t want to copy/paste an int->string red-black tree into some file(s) and judiciously search/replace until I have a string->MyFoo tree (and then do the same when I need an int->float tree).

                                                                                                                                                        1. 0

                                                                                                                                                          That makes sense, but I am still looking for some grounding in actual programming practice. Is there a use of a red-black tree that would not warrant customizing it for the storage type? Or one where it would make sense to add a library dependency rather than copying the RB tree code?

                                                                                                                                                          1. 8

                                                                                                                                                            How do you write a library that provides a Red-Black tree that can in principle work with many different client types without generics? This isn’t a rhetorical question, I don’t know Go and I genuinely don’t know how you would implement this kind of library in Go without generics.

                                                                                                                                                            1. 6

                                                                                                                                                              Go’s sync.Map (concurrent hashmap) is an actual real world example of this, and it uses interface{}, akin to Java’s Object.

                                                                                                                                                              1. 25

                                                                                                                                                                Right, that’s a great example. Because it uses interface{}, it:

                                                                                                                                                                • Requires all keys and values to be heap allocated, leading to worse performance, worse memory usage, and worse memory fragmentation. Requiring two heap-allocated ints to store one value in an int->int concurrent hash map is unacceptable for many uses.
                                                                                                                                                                • Is less ergonomic, requiring a cast every time you want to use a value.
                                                                                                                                                                • Provides no type safety. (I imagine this one will be the least convincing to Go programmers, since Go generally expects the programmer to just not make mistakes)
                                                                                                                                                                1. 4

                                                                                                                                                                  This brings me back to C++Builder 3 back in the 90s. To use a list, you had to create a class derived from a kind of TItem class to be able to store things. Why anyone would want to go back to that in productive code boggles my mind.

                                                                                                                                                                  1. 1

                                                                                                                                                                    I’m using a sync.Map (for its concurrency support - I have many goroutines writing map entries, and another goroutine periodically ranging over the entire map to dump it to a json file).

                                                                                                                                                                    However I know the types I write to the map, I have no need for interface{}.

                                                                                                                                                                    Am I better off with a real typed map + using sync.RWLock/mutex/etc. directly (in a custom struct)? Performance-wise.

                                                                                                                                                                    1. 1

                                                                                                                                                                      I don’t know, you would have to benchmark or measure CPU or memory usage. The sync.Map documentation suggests that using a regular map + mutexes could be better though: https://golang.org/pkg/sync/#Map

                                                                                                                                                                      The Map type is specialized. Most code should use a plain Go map instead, with separate locking or coordination, for better type safety and to make it easier to maintain other invariants along with the map content.

                                                                                                                                                                      The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex.

                                                                                                                                                                      If your usage falls outside of the two use cases which sync.Map is optimized for, it would absolutely be worth looking into replacing your sync.Map with a regular map and a mutex.

                                                                                                                                                                      I suppose it becomes a question of which has the biggest performance penalty for you, heap allocation + indirection with sync.Map or lock contention with regular map + mutex?

                                                                                                                                                                      (Also, in most cases, this probably doesn’t matter; make sure you’re not spending a long time improving performance in a part of your code which isn’t actually a performance issue :p)

                                                                                                                                                                      1. 1

                                                                                                                                                                        Right - the code “just works(TM)” and it takes around 0.5 seconds to render the JSON file every minute (which I track with metrics just to be safe) so it should be fine to keep as is. This is just a for-fun conversation.

                                                                                                                                                                        or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex.

                                                                                                                                                                        I definitely remember reading this sentence and it made me choose sync.Map because it sounds like my usecase. But like you say if I don’t measure it’ll be hard to tell.

                                                                                                                                                                2. -1

                                                                                                                                                                  I don’t know and I didn’t think you could. I’m asking for an example use of an RB tree where using a library would make sense.

                                                                                                                                                                  1. 6

                                                                                                                                                                    Here is a popular Go RB tree implementation https://github.com/emirpasic/gods/ that uses Interface{} for the key and value types. Just search github for uses of it… With generics, users of this library would get greater typesafety.

                                                                                                                                                                    https://github.com/search?q=%22github.com%2Femirpasic%2Fgods%2Ftrees%2Fredblacktree%22&type=Code

                                                                                                                                                                    1. -2

                                                                                                                                                                      okay. except i don’t know how to search github for uses of it and your search link brings me to a login page :(

                                                                                                                                                                      1. 5

                                                                                                                                                                        To short-circuit this:

                                                                                                                                                                        At a previous job, I worked on a tool that started various services. The services had different dependencies, each of which needed to be started before the service. We wanted to be able to bring them up with as much parallelism as possible, or have a flag to launch them serially.

                                                                                                                                                                        A simple approach to doing this correctly is modeling the dependencies as an acyclic graph (if it’s a cyclic graph, you’ve got a problem — you can never bring the services up, because they all depend on each other). To launch them in parallel, launch each one that has its dependencies met. To launch them serially, topologically sort the graph into an array/list/whatever and launch them one by one.

                                                                                                                                                                        A generic graph implementation would be very useful, as would a topological sort that worked on generic graphs. With Go, you can’t have one that’s type-safe.

                                                                                                                                                                        Another great use case for graphs: visualizing dependency graphs! You can have an open source graph visualization library, build a graph of whatever it is you’re trying to visualize, and pass it to the library and get a nice visualization of the data.

                                                                                                                                                                        Graph data structures can be quite useful. Supporting generics makes them type-safe, so you catch errors at compile time instead of runtime. Some other examples of the usefulness of graphs:

                                                                                                                                                                        • Graphs of friends at a social network (I currently work at one, and we use generic graph data structures all over the place — graphs of people to people, graphs connecting people and photos they’re tagged in, etc)
                                                                                                                                                                        • Network topology graphs
                                                                                                                                                                        • Graphs of links between documents

                                                                                                                                                                        etc.

                                                                                                                                                                        And it’s not just graphs. How do you write a type-safe function that takes in a list of possibly-null items, and returns a new list with the nulls stripped out? How about a function that takes a map and returns the list of its keys? In Golang, the answer is always copy-paste or give up type safety. In languages with generics, you can trivially write these functions yourself if they’re not in the standard library.

                                                                                                                                                                        1. 1

                                                                                                                                                                          thanks, this is a good motivating example.

                                                                                                                                                                        2. 1

                                                                                                                                                                          Huh. It had not occurred to me that github search would require a login.

                                                                                                                                                                3. 11

                                                                                                                                                                  To turn the question around, why would you want to manually copy/paste code all over the place when the compiler can do it for you? And while I personally think “DRY” can be over done, not having the same (or very similar) code copy/pasted all over the place seems like a big practical win.

                                                                                                                                                                  As far as customizing specific data structure and type combinations, most languages with generics have a way to do that, and I’d bet the Go designers thought of it.

                                                                                                                                                                  1. 2

                                                                                                                                                                    Copy / paste has got it’s own problems, but it lets you avoid a ton of complexity in the toolchain.

                                                                                                                                                                    Toolchain development is all about tradeoffs. For instance, I use Typescript; the reference implementation is featureful, but slow to boot, so it keeps a background process alive to cache the heavy lifting, which accumulates state and introduces subtle confusions (eg type errors that don’t exist) until it’s restarted.

                                                                                                                                                                    For some problem spaces, the problems introduced by copy/paste pale in comparison to the problems introduced by slow, stateful compilers.

                                                                                                                                                                    1. 7

                                                                                                                                                                      Copy/paste vs generics is unrelated to compiler bugginess.

                                                                                                                                                                      If you carefully pick TypeScript as the comparison point, you can make the case that a buggy toolchain is bad (not that most users care, they just restart the compile process when it starts to go bad).

                                                                                                                                                                      But if you were to pick say ReasonML for comparison, you could say that it’s possible to have a solid generics implementation (much less copy-pasting) and a super-fast, accurate compiler.

                                                                                                                                                                      I.e. you can have both buggy and non-buggy compilers supporting generics. Hence, unrelated.

                                                                                                                                                                      1. 2

                                                                                                                                                                        ReasonML is great!

                                                                                                                                                                        That said, while the relationship is indirect, it’s there. Adding complexity is never free. It didn’t cost ReasonML speed or reliability, but it costs maintainers time and makes every other feature more difficult to add in an orthogonal way.

                                                                                                                                                                        1. 2

                                                                                                                                                                          I think these comparisons are a bit unfair: isn’t Typescript self hosted, whereas ReasonML is written in OCaml? It seems like Typescript would have a very hard time competing.

                                                                                                                                                                          1. 3

                                                                                                                                                                            Being able to use lots of existing OCaml bits is a huge advantage.

                                                                                                                                                                            Typescript has been able to compete due to the sheer number of contributors - MS pays quite a large team to work on it (and related stuff like the excellent Language Server Protocol, VScode integration).

                                                                                                                                                                            However, large teams tend to produce more complex software (IMO due to the added communications overhead - it becomes easier to add a new thing than find out what existing thing solves the same problem).

                                                                                                                                                                            1. 1

                                                                                                                                                                              I should clarify my comment was more about comparing performance of the two languages.

                                                                                                                                                                              OCaml is a well optimized language that targets native machine code so tooling built in OCaml should be more performant than tooling built in Typescript. As a result, it’s hard to compare the complexity of either tool by the performance of the tool. It’s apples and oranges.

                                                                                                                                                                            2. 2

                                                                                                                                                                              isn’t Typescript self hosted, whereas ReasonML is written in OCaml? It seems like Typescript would have a very hard time competing.

                                                                                                                                                                              That’s a strange argument. If it were very hard for them to compete why would they not use OCaml as well, especially since its contemporary alternative, Flow, was written in OCaml too? Or why would they not make TypeScript as good as a language for writing TypeScript in as OCaml is?

                                                                                                                                                                              1. 1

                                                                                                                                                                                My comment was more about performance, but it wasn’t very clear. It’s hard for Typescript, which is compiled to Javascript and then interpreted/JITed, to create tooling that’s as fast as a language that builds optimized native code.

                                                                                                                                                                                Given that Typescript is self hosted it has the advantage that community involvement is more seamless and I don’t want to downplay the power that brings.

                                                                                                                                                                            3. 2

                                                                                                                                                                              In the scheme of things, is it more important to have a super-simple compiler codebase, or is it more important to put more power and expressiveness in the hands of users? Note that every mainstream language that started without generics, has now added it.

                                                                                                                                                                              1. 1

                                                                                                                                                                                IMO, there’s such a thing as a right time to do it.

                                                                                                                                                                                In the early years it’s more important to keep the simplicity - there aren’t that many users and you’re still figuring out what you want the language to be (not every feature is compatible with every approach to generics).

                                                                                                                                                                                Once you’re ready to start generics you need to answer questions like - do you want monomorphisation or lookup tables? Is boxing an acceptable overhead for the improved debugging ergonomics?

                                                                                                                                                                                1. 1

                                                                                                                                                                                  It seems like Go has been going through exactly the process you’re describing.

                                                                                                                                                                            4. 0

                                                                                                                                                                              But compilers that support generics are more likely to be buggy. That’s a relation.

                                                                                                                                                                              1. 2

                                                                                                                                                                                Any source for this rather surprising assertion?

                                                                                                                                                                                1. 0

                                                                                                                                                                                  generics are feature that requires code to implement; code can contain bugs.

                                                                                                                                                                                  1. 1

                                                                                                                                                                                    But a self-hosting compiler with generics is likely to be less verbose (because generics) than one without, so it should be less buggy.

                                                                                                                                                                                    1. 1

                                                                                                                                                                                      i guess you can’t prove it either way but IME the complexity of algorithms is more likely to cause bugs than verbosity.

                                                                                                                                                                            5. 5

                                                                                                                                                                              I think Typescript is a straw man. Does this Go implementation of generics slow down the compiler a noticeable amount? There’s nothing inherent to generics that would make compiling them slow.

                                                                                                                                                                              On the other hand, copy/pasted code is an ever increasing burden on developer and compile time.

                                                                                                                                                                            6. -2

                                                                                                                                                                              You are imagining a code base where the same complex data structure is instantiated with two different types. Is that realistic?

                                                                                                                                                                              1. 6

                                                                                                                                                                                You are imagining a code base where the same complex data structure is instantiated with two different types. Is that realistic?

                                                                                                                                                                                Realistic enough that the Linux kernel developers went through the hassle of developing generic associative arrays, circular buffers, and other generic data structures using void*.

                                                                                                                                                                                And so did Gnome with GLib, which provides generic lists, hash tables, and trees, along with several others structures, also using void*.

                                                                                                                                                                                And the standard libraries of most modern languages include reusable and generic sequence and associative data types, and some times significantly more than that.

                                                                                                                                                                                For most data structures, though, focusing on a single code base gives too narrow of a view. Generics allow libraries of data structures to be created, so even though a single code base only use one R* tree (or whatever), that R* tree library can be used as-is by any number of projects.

                                                                                                                                                                            7. 8

                                                                                                                                                                              The Abstract and Background sections of the draft design doc touch on the motivations. Additionally, each section describing a dimension of the design usually mentions, at least briefly, the motivation for that feature.

                                                                                                                                                                              1. 8

                                                                                                                                                                                Here is an example that I’ve wanted for ever, and can finally do. Higher order combinators that you can leverage first class functions with!

                                                                                                                                                                                Generic map, in go

                                                                                                                                                                                1. 1

                                                                                                                                                                                  That’s the type of thing I have seen as a justification, but I don’t get why that’s so important. Can’t you just use a for loop?

                                                                                                                                                                                  1. 22

                                                                                                                                                                                    “Can’t you just …” goes forever. “Can’t you just write your for loop with labels and jumps in assembly?”^^

                                                                                                                                                                                    For me, it’s all about abstraction. Having low level combinators, like this, that I can compose to build higher level abstractions in a generic way is wonderful.

                                                                                                                                                                                    ^^: See also whataboutism.

                                                                                                                                                                                    1. 3

                                                                                                                                                                                      I’m not sure that composing from higher level abstractions is always such a good idea. I like both Go (hobby projects) and Rust (work!) but I still fell that most of the time I prefer this level of abstraction:

                                                                                                                                                                                      type Server struct {
                                                                                                                                                                                      ...
                                                                                                                                                                                          Handler Handler // handler to invoke, http.DefaultServeMux if nil
                                                                                                                                                                                      ...
                                                                                                                                                                                      }
                                                                                                                                                                                      type Handler interface {
                                                                                                                                                                                          ServeHTTP(ResponseWriter, *Request)
                                                                                                                                                                                      }
                                                                                                                                                                                      

                                                                                                                                                                                      from this:

                                                                                                                                                                                       pub fn serve<S, B>(self, new_service: S) -> Server<I, S, E>
                                                                                                                                                                                          where
                                                                                                                                                                                              I: Accept,
                                                                                                                                                                                              I::Error: Into<Box<dyn StdError + Send + Sync>>,
                                                                                                                                                                                              I::Conn: AsyncRead + AsyncWrite + Unpin + Send + 'static,
                                                                                                                                                                                              S: MakeServiceRef<I::Conn, Body, ResBody = B>,
                                                                                                                                                                                              S::Error: Into<Box<dyn StdError + Send + Sync>>,
                                                                                                                                                                                              B: HttpBody + 'static,
                                                                                                                                                                                              B::Error: Into<Box<dyn StdError + Send + Sync>>,
                                                                                                                                                                                              E: NewSvcExec<I::Conn, S::Future, S::Service, E, NoopWatcher>,
                                                                                                                                                                                              E: H2Exec<<S::Service as HttpService<Body>>::Future, B>,
                                                                                                                                                                                          {
                                                                                                                                                                                          ...
                                                                                                                                                                                      

                                                                                                                                                                                      Don’t get me wrong, i like type level guarantees and I can see flexibility here, but in my experience with c++, rust and haskell is that generic programming often ends up complicating things to a degree that I personally don’t like.

                                                                                                                                                                                      1. 1

                                                                                                                                                                                        I think this is going to be a balance that the community has to find. I don’t regularly program in rust, but I’d be quite surprised if it wasn’t possible to get something close to the Go http API in it. The example you pasted seems complicated for the sake of being complicated. In theory, the Go community has been drilled into thinking in terms of the littlest abstraction that’ll work, which maybe makes it possible to generally avoid generic APIs that don’t actually need to be?

                                                                                                                                                                                      2. 3

                                                                                                                                                                                        “Can’t you just” does not go forever. It is a simpler way to say that the alternative is not significantly harder than what’s proposed. Is there some type of task that would be doable using a generic map but unreasonably hard using for loops?

                                                                                                                                                                                        I feel like Go was designed from the ground up to be written in an imperative style, and composing first order functions is more of a functional style of coding. If I understand, without generics you would be nesting for loops rather than composing map functions, which is no more difficult to understand or write.

                                                                                                                                                                                        I don’t follow the connection to whataboutism.

                                                                                                                                                                                        1. 2

                                                                                                                                                                                          I think it’s fine for your style of writing code to be to use loops and conditionals instead of map and filter. I think it’s a fine way to code that makes more sense in an imperative language. Straight for loops and while loops with if statements inside them is just better, more easily understandable code in an imperative language, in my opinion, than .map(...).filter(...).map(...) etc.

                                                                                                                                                                                          1. -1

                                                                                                                                                                                            Incidentally there is a repo wherein Rob Pike expresses his attitude towards this style of coding:

                                                                                                                                                                                            https://github.com/robpike/filter/

                                                                                                                                                                                            I wanted to see how hard it was to implement this sort of thing in Go, with as nice an API as I could manage. It wasn’t hard.

                                                                                                                                                                                            Having written it a couple of years ago, I haven’t had occasion to use it once. Instead, I just use “for” loops.

                                                                                                                                                                                            You shouldn’t use it either.

                                                                                                                                                                                            1. 2

                                                                                                                                                                                              I mean… that’s like … one man’s opinion… man. See also.

                                                                                                                                                                                              Generics are going to create a divide in the Go community, and it’s going to be popcorn worthy. There’s no point of adding Generics to the language if this filter thing “shouldn’t be used,” and the community rejects the abstractions that Generics provide.

                                                                                                                                                                                              This divide is easily already seen in the community as it relates to test helpers. On the one hand, there’s a set of developers that say “stdlib testing is more than enough.” On the other hand, there are people who want the full testing facilities of junit, with matchers, lots of assert style helpers, etc. Who is right? They all are, because those things work for their respective teams and projects.

                                                                                                                                                                                              This general dogmatic approach to language idioms is why I call it “idiotmatic” Go.

                                                                                                                                                                                              1. -1

                                                                                                                                                                                                I suppose if Ken and Rob wanted generics they would’ve put them in the original language, and there wouldn’t be this controversy. Time to go back to learning Erlang which seems old and dusty enough to not have big language changes and drama.

                                                                                                                                                                                          2. 16

                                                                                                                                                                                            You can’t pass a for loop to anything, you can only write it where you need it. Sure, toy examples look like toy examples, but the fact remains that Go has first-class functions, which should be a nice thing, but it doesn’t actually have a type system rich enough to express 90% of the things that make first-class functions worth having.

                                                                                                                                                                                            1. -1

                                                                                                                                                                                              You can’t pass a for loop to anything, you can only write it where you need it.

                                                                                                                                                                                              right, so the example code could be done with a for loop no problem. is there a more motivating example?

                                                                                                                                                                                              it doesn’t actually have a type system rich enough to express 90% of the things that make first-class functions worth having.

                                                                                                                                                                                              how do you mean?

                                                                                                                                                                                            2. 3

                                                                                                                                                                                              Consider composing multiple transformations and filters together. With multiple for loops you have to iterate over the array each time, while by composing maps you only need to iterate once.

                                                                                                                                                                                              1. 3

                                                                                                                                                                                                Just compose the operations inside the loop.

                                                                                                                                                                                                for x in y:
                                                                                                                                                                                                    ...f(g(x))...
                                                                                                                                                                                                
                                                                                                                                                                                                1. 2

                                                                                                                                                                                                  That works in some cases, but it’s pretty easy to find a counter example, too.

                                                                                                                                                                                          3. 7

                                                                                                                                                                                            In terms of collections, the truth is most of the time a map/slice is a good option. Here’s my top two favorite use cases for generics in go:

                                                                                                                                                                                            1. Result<T> and functions that compose over them.
                                                                                                                                                                                            2. Typesafe versions of sync.Map, sync.Pool, atomic.Value, even a rust like Mutex
                                                                                                                                                                                            1. 5

                                                                                                                                                                                              Oh man. I hadn’t even considered a better way to do error handling, eg. a Result type. People are gonna get so mad.

                                                                                                                                                                                              1. 5

                                                                                                                                                                                                Generics isn’t enough to do what people want to do with error handling 99.99% of the time, which is to return early. For that, you either need a macro, such as the aborted try proposal, or syntactic sugar for chaining such “functions that compose over them” (like Haskell’s do notation).

                                                                                                                                                                                                Otherwise you end up with callback hell à la JavaScript, and I think nobody wants that in Go.

                                                                                                                                                                                                1. 4

                                                                                                                                                                                                  I was more thinking of something where the if err pattern is enforced via the type system. You’re still not getting there 100%, you could get reasonably close, with a generic Result type that panics when the wrong thing is accessed, forcing you to check always or risk a panic.

                                                                                                                                                                                                  r := thing()
                                                                                                                                                                                                  if r.HasError() { handleError(r.Err()) }
                                                                                                                                                                                                  else v := r.Val() { handleSuccess(v) }
                                                                                                                                                                                                  

                                                                                                                                                                                                  And of course it’s easy to question why this is interesting until you do chaining of things, and get a full on, type safe Result monad.

                                                                                                                                                                                                  r := thing().andThen(func(i int) { ... }).andThen(func(i int) { ... })
                                                                                                                                                                                                  if r.IsErr() {
                                                                                                                                                                                                     handleErrForWholeComputation(r.Err())
                                                                                                                                                                                                  } else {
                                                                                                                                                                                                     handleSuccessForWholeComputation(r.Val())
                                                                                                                                                                                                  }
                                                                                                                                                                                                  

                                                                                                                                                                                                  The alternative can be seen in things like this where you skirt around the fact that you can’t generically accept a value in one of those called functions. This is also why I said people are going to get so mad. These things are confusing to people who haven’t dealt with them before, and will make Go much more expressive, but less easy to grok without effort.

                                                                                                                                                                                            2. 5

                                                                                                                                                                                              but is there a real-world setting where this is actually better than just copying code and doing s/type1/type2/g

                                                                                                                                                                                              All of them. Copying code manually is one of the worst things you can do in software development. If it weren’t, why even bother writing functions, ever?

                                                                                                                                                                                              My sense is that projects that use complex data structures almost always customize the data structures in a way that depends on the data type being stored.

                                                                                                                                                                                              The fact that libraries exist that don’t customise in such a way in languages with generics would disprove that notion.

                                                                                                                                                                                              1. 6

                                                                                                                                                                                                one of the worst things you can do in software development

                                                                                                                                                                                                For me that’s “making things unreadable for whoever comes after you”. And sometimes copying a bit of code is the optimal solution for avoid that.

                                                                                                                                                                                                1. 0

                                                                                                                                                                                                  but is there a real-world setting where this is actually better than just copying code and doing s/type1/type2/g

                                                                                                                                                                                                  All of them. Copying code manually is one of the worst things you can do in software development. If it weren’t, why even bother writing functions, ever?

                                                                                                                                                                                                  I disagree with your implication that the use of functions means code should never be copied. For example if you want to use strlcpy() in a portable C program, it makes more sense to put a copy in your source tree rather than relying on an external library. An extra dependency would add more headache than just copying the code.

                                                                                                                                                                                                  My sense is that projects that use complex data structures almost always customize the data structures in a way that depends on the data type being stored.

                                                                                                                                                                                                  The fact that libraries exist that don’t customise in such a way in languages with generics would disprove that notion.

                                                                                                                                                                                                  That’s why I said “almost always.” And remember that the existence of a library doesn’t mean it is used with any frequency.

                                                                                                                                                                                                2. 3

                                                                                                                                                                                                  Suppose you have a structure parametrizable by types T1, T2. You’re writing it in Go, so you assume that it’s ok if T1=string, T2=int. Also, in some of the places, you were using int for purpose unrelated to T2 (ie. if T2=foo, then there are still ints left in the source). Another programmer wants to copy-paste the code and change some types. How does he do it?

                                                                                                                                                                                                  1. 2

                                                                                                                                                                                                    I think “this would make copy-pasting code harder” is not so compelling an argument. One of the major points of introducing generics is that it would eliminate much of the present need for copy/paste in Go.

                                                                                                                                                                                                    1. 2

                                                                                                                                                                                                      Yes it would be harder than a search-and-replace, but that is still abstract and unrelated to any real-world use case.

                                                                                                                                                                                                      Yes, I’m just counterpointing the parent commenter’s argument. I know the value of generic structures.

                                                                                                                                                                                                    2. -1

                                                                                                                                                                                                      Yes it would be harder than a search-and-replace, but that is still abstract and unrelated to any real-world use case.

                                                                                                                                                                                                  1. 1

                                                                                                                                                                                                    Interestingly it looks like in the fast case Go is much faster while in the slower case it is only slightly faster.

                                                                                                                                                                                                    $ cargo run --release
                                                                                                                                                                                                        Finished release [optimized] target(s) in 0.02s
                                                                                                                                                                                                         Running `target/release/drop-thread`
                                                                                                                                                                                                    drop in another thread 72.731µs
                                                                                                                                                                                                    drop in this thread 277.387825ms
                                                                                                                                                                                                    
                                                                                                                                                                                                    $ go run main.go 
                                                                                                                                                                                                    drop in another thread 13.101µs
                                                                                                                                                                                                    drop in this thread 224ns
                                                                                                                                                                                                    
                                                                                                                                                                                                    1. 18

                                                                                                                                                                                                      In Go the “drop in this thread” is ns, not µs. In Rust the “drop in this thread” is ms, not µs. So I’d guess that Go’s “drop in this thread” is probably not bothering to drop anything at all, since the program ends before the GC gets invoked. Depending on how you wrote it, of course.

                                                                                                                                                                                                      1. 5

                                                                                                                                                                                                        So I’d guess that Go’s “drop in this thread” is probably not bothering to drop anything at all, since the program ends before the GC gets invoked.

                                                                                                                                                                                                        Yes, it would be equivalent (in time) to using std::mem::forget in Rust (don’t do that!). It’s a source of bugs that pop up in some Go code that interacts with C libraries. People will use runtime.SetFinalizer to call a C function that finalizes some resource. However, there is no guarantee that the GC runs before the program ends and thus the finalizer may never run.

                                                                                                                                                                                                        Comparing ‘drop in another thread’ between Go and Rust is also not so interesting. It’s measuring the time of starting a goroutine (cheap) vs. a native thread (more expensive).The time would probably go down for Rust when using a thread pool.

                                                                                                                                                                                                        1. 2

                                                                                                                                                                                                          Haha, good catch! :)

                                                                                                                                                                                                      1. 1

                                                                                                                                                                                                        I’m not a programming language expert, but I think the fact that Go and D have non-deterministic garbage collection means they can’t really fully “replace” C, C++, and Rust.

                                                                                                                                                                                                        I’m not a Rust expert either, but it seems to be following the same path of C++ into crippling complexity.

                                                                                                                                                                                                        These things suggest to me there’s still no real replacement for C, at least not one with any real “traction.”

                                                                                                                                                                                                        1. 2

                                                                                                                                                                                                          These things suggest to me there’s still no real replacement for C, at least not one with any real “traction.”

                                                                                                                                                                                                          Maybe zig?

                                                                                                                                                                                                          1. 1

                                                                                                                                                                                                            The problem is that–and somebody who has more up-to-date information, by all means correct me!–even in unmanaged langauges without GC, you can still totally have lag in freeing memory.

                                                                                                                                                                                                            Depending on the standard library and malloc implementation, you can’t even be guaranteed uniform behavior. Consider the case where you trigger a scan and coalesce of the underlying free block list for malloc or similar–I don’t think there are any APIs that conveniently say “okay, please fill this and do a bit of work coalescing blocks because I know I have more allocations of some size coming up.” or “okay, please immediately coalesce everything” or even “okay, fuck, just turn coalescing off because I Know What I’m Doing”.

                                                                                                                                                                                                            If people really need deterministic memory behavior, they need to put in extra work in every language.

                                                                                                                                                                                                          1. 3

                                                                                                                                                                                                            std::unordered_set is slow since it has to maintain a lot of guarantees regarding iterator validity which leads to many allocations (one per element in a set). It would be interesting to see comparison with much faster hash sets like tsl::robin_set or absl::flat_hash_set.

                                                                                                                                                                                                            1. 12

                                                                                                                                                                                                              I know this one is likely to be controversial, so I should say that I agree with it. This practice is suggested in Google’s C++ style guide, I’ve coded with it, and it’s made my code more robust and maintainable. The cost of maintenance far exceeds the cost of writing code to begin with; this is a simple thing with concrete benefits and it’s hard for me to see a justification for not doing it.

                                                                                                                                                                                                              (Edit: syntax issue with the link)

                                                                                                                                                                                                              1. 6

                                                                                                                                                                                                                Also, for c++ I find strong type aliases work pretty well, e.g.

                                                                                                                                                                                                                using IncludeDisabled = NamedType<bool, struct IncludeDisabledTag>;
                                                                                                                                                                                                                // caller uses:
                                                                                                                                                                                                                fetch(accountId, IncludeDisabled{true}, ...)
                                                                                                                                                                                                                // caller can't just pass true or false because of explicit constructor
                                                                                                                                                                                                                

                                                                                                                                                                                                                wouldn’t handle the “compatibility matrix” scenario, but works well when you need simple flags.

                                                                                                                                                                                                                You can also add cast operator to NamedType, that would make it transparent in if statements.

                                                                                                                                                                                                                1. 1

                                                                                                                                                                                                                  Sadly strong typedefs can cause performance degradations - wrapping int/float in a struct might require compiler (due to ABI requirements) to pass such values differently to calee.

                                                                                                                                                                                                              1. 1

                                                                                                                                                                                                                This year I’m using rust.