1. 1

    As a genuine question from someone who hasn’t used procedural programming productively before, what would be the benefits of a procedural language to justify its choice?

    1. 3

      I would say less conceptual/cognitive overhead, but I don’t know if that’s something that can be said of this language as a whole, as I have no experience with it.

      By that I mean something like: I have a rough idea of what code I want from the compiler, how much mental gymnastics is required to arrive at the source-level code that I need to write?

      I would imagine that’s an important consideration in a language designed for game development.

      1. 4

        Yeah, it makes perfect sense.

        To dumb down Kit’s value prop, it’s a “Better C, for people who need C (characteristics)”.

      2. 2

        On top of alva’s comment, they compile fast and are easy to optimize, too.

        1. 1

          I looked this up for some other article on lobste.rs. I found wikipedia to have a nice summary

          https://en.wikipedia.org/wiki/Procedural_programming

          Imperative programming

          Procedural programming languages are also imperative languages, because they make explicit references to the state of the execution environment. This could be anything from variables (which may correspond to processor registers) to something like the position of the “turtle” in the Logo programming language.

          Often, the terms “procedural programming” and “imperative programming” are used synonymously. However, procedural programming relies heavily on blocks and scope, whereas imperative programming as a whole may or may not have such features. As such, procedural languages generally use reserved words that act on blocks, such as if, while, and for, to implement control flow, whereas non-structured imperative languages use goto statements and branch tables for the same purpose.

          My understanding is that if you use say C you are basically using procedural language paradigms.

          1. 2

            Interesting. So basically what was registering in my mind as imperative programming is actually procedural.

            Good to know. Thanks for looking it up!

            1. 2

              I take “imperative” to mean based on instructions/statements, e.g. “do this, then do that, …”. An “instruction” is something which changes the state of the world, i.e. there is a concept of “before” and “after”. Lots of paradigms can sit under this umbrella, e.g. machine code (which are lists of machine instructions), procedural programming like C (where a “procedure”/subroutine is a high-level instruction, made from other instructions), OOP (where method calls/message sends are the instructions).

              Examples of non-imperative languages include functional programming (where programs consist of definitions, which (unlike assignments) don’t impose a notion of “before” and “after”) and logic programming (similar to functional programming, but definitions are more flexible and can rely on non-deterministic search to satisfy, rather than explicit substitution)

              1. 1

                If functional programs don’t have a noton of before and after, how do you code an algorithm? Explain newton’s method as a definition.

                  1. 1

                    both recursion and iteration say “do this, then do that, then do … “. And “let” appears to be assignment or naming so that AFTER the let operation a symbol has a meaning it did not have before.

                    open some namespaces
                    open System
                    open Drawing    
                    open Windows.Forms
                    open Math
                    open FlyingFrog
                    

                    changes program state so that certain operations become visible AFTER those lines are executed, etc.

                    1. 3

                      It is common for computation to not actually take place until the result is immediately needed. Your code may describe a complicated series of maps and filters and manipulations and only ever execute enough to get one result. Your code looks like it describes a strict order the code executes in, but the execution of it may take a drastically different path.

                      A pure functional programming language wouldn’t be changing program state, but passing new state along probably recursively.

                      1. 1

                        but you don’t really have a contrast with “imperative” languages - you still specify an algorithm. In fact, algorithms are all over traditional pure mathematics too. Generally the “state” being changed is on a piece of paper or in the head of the reader, but …

                      2.  

                        so that AFTER the let operation

                        If we assume that let is an operation, then there is certainly a before and an after.

                        That’s not the only way to think about let though. We might, for example, treat it as form of linguistic shorthand; for example treating:

                        let x = somethingVeryLongWindedInvolving y in x * x
                        

                        as a shorthand for:

                        (somethingVeryLongWindedInvolving y) * (somethingVeryLongWindedInvolving y)
                        

                        There is no inherent notion of before/after in such an interpretation. Even if our language implements let by literally expanding/elaborating the first form into the second, that can take place at compile time, alongside a whole host of other transformations/optimisations; hence even if we treat the expansion as a change of state, it wouldn’t actually occur at run time, and thus does not affect the execution of any algorithm by our program.

                        Note that we might, naively, think that the parentheses are imposing a notion of time: that the above tells us to calculate somethingVeryLongWindedInvolving y first, and then do the multiplication on the results. Call-by-name evaluation shows that this doesn’t have to be the case! It’s perfectly alright to do the multiplication first, and only evaluate the arguments if/when they’re needed; this is actually preferable in some cases (like the K combinator).

                    2. 2

                      If functional programs don’t have a noton of before and after, how do you code an algorithm?

                      Roughly speaking, we define each “step” of an algorithm as a function, and the algorithm itself is defined as the result of (some appropriate combination of) those functions.

                      As a really simple example, let’s say our algorithm is to reverse a singly-linked-list, represented as nested pairs [x0, [x1, [x2, ...]]] with an empty list [] representing the “end”. Our algorithm will start by creating a new empty list, then unwrap the outer pair of the input list, wrap that element on to its new list, and repeat until the input list is empty. Here’s an implementation in Javascript, where reverseAlgo is the algorithm I just described, and reverse just passes it the new empty list:

                      var reverse = (function() {
                        function reverseAlgo(result, input) {
                          return (input === [])? result : reverseAlgo([input[0], result], input[1]);
                        };
                        return function(input) { return reverseAlgo([], input); };
                      })();
                      

                      Whilst Javascript is an imperative language, the above is actually pure functional programming (I could have written the same thing in e.g. Haskell, but JS tends to be more familiar). In particular, we’re only ever defining things, in terms of other things. We never update/replace/overwrite/store/retrieve/etc. This style is known as single assignment.

                      For your Newton-Raphson example, I decided to do it in Haskell. Since it uses Float for lots of different things (inputs, outputs, epsilon, etc.) I also defined a bunch of datatypes to avoid getting them mixed up:

                      module Newton where
                      
                      newtype Function   = F (Float -> Float)
                      newtype Derivative = D (Float -> Float)
                      newtype Epsilon    = E Float
                      newtype Initial    = I Float
                      newtype Root       = R (Float, Function, Epsilon)
                      
                      newtonRaphson :: Function -> Derivative -> Epsilon -> Initial -> Root
                      newtonRaphson (F f) (D f') (E e) (I x) = if abs y < e
                                                                  then R (x, F f, E e)
                                                                  else recurse (I x')
                      
                        where y  = f x
                      
                              x' = x - (y / f' x)
                      
                              recurse = newtonRaphson (F f) (D f') (E e)
                      

                      Again, this is just defining things in terms of other things. OK, that’s the definition. So how do we explain it as a definition? Here’s my attempt:

                      Newton’s method of a function f + guess g + epsilon e is defined as the “refinement” r of g, such that f(r) < e. The “refinement” of some number x depends on whether x satisfies our epsilon inequality: if so, its refinement is just x itself; otherwise it’s the refinement of x - (f(x) / f'(x)).

                      This definition is “timeless”, since it doesn’t talk about doing one thing followed by another. There are causal relationships between the parts (e.g. we don’t know which way to “refine” a number until we’ve checked the inequality), but those are data dependencies; we don’t need to invoke any notion of time in our semantics or understanding.

                      1. 2

                        Our algorithm will start by creating a new empty list, then unwrap the outer pair of the input list, wrap that element on to its new list, and repeat until the input list is empty.

                        Algorithms are essentially stateful. A strongly declarative programming language like Prolog can avoid or minimize explicit invocation of algorithms because it is based on a kind of universal algorithm that is applied to solve the constraints that are specified in a program. A “functional” language relies on a smaller set of control mechanisms to reduce, in theory, the complexity of algorithm specification, but “recursion” specifies what to do when just as much as a “goto” does. Single assigment may have nice properties, but it’s still assignment.

                        To me, you are making a strenuous effort to obfuscate the obvious.

                        1. 3

                          Algorithms are essentially stateful.

                          I generally agree. However, I would say programming languages don’t have to be.

                          When we implement a stateful algorithm in a stateless programming language, we need to represent that state somehow, and we get to choose how we want to do that. We could use successive “versions” of a datastructure (like accumulating parameter in my ‘reverse’ example), or we could use a call stack (very common if we’re not making tail calls), or we could even represent successive states as elements of a list (lazy lists in Haskell are good for this).

                          A strongly declarative programming language like Prolog can avoid or minimize explicit invocation of algorithms because it is based on a kind of universal algorithm that is applied to solve the constraints that are specified in a program.

                          I don’t follow. I think it’s perfectly reasonable to say that Prolog code encodes algorithms. How does Prolog’s use of a “universal algorithm” (depth-first search) imply that Prolog code isn’t algorithmic? Every programming language is based on “a kind of universal algorithm”: Python uses a bytecode interpreter, Haskell uses beta-reduction, even machine code uses the stepping of the CPU. Heck, that’s the whole point of a Universal Turing Machine!

                          “recursion” specifies what to do when just as much as a “goto” does.

                          I agree that recursion can be seen as specifying what to do when; this is a different perspective of the same thing. It’s essentially the contrast between operational semantics and denotational semantics.

                          I would also say that “goto” can be seen as a purely definitional construct. However, I don’t think it’s particularly useful to think of “goto” in this way, since it generally makes our reasoning harder.

                          To me, you are making a strenuous effort to obfuscate the obvious.

                          There isn’t “one true way” to view these things. I don’t find it “strenuous” to frame things in this ‘timeless’ way; indeed I personally find it easier to think in this way when I’m programming, since I don’t have to think about ‘time’ at all, just relationships between data.

                          Different people think differently about these things, and it’s absolutely fine (and encouraged!) to come at things from different (even multiple) perspectives. That’s often the best way to increase understanding, by find connections between seemingly unrelated things.

                          Single assigment may have nice properties, but it’s still assignment.

                          In name only; its semantics, linguistic role, formal properties, etc. are very different from those of memory-cell-replacement. Hence why I use the term “definition” instead.

                          The key property of single assignment is that it’s unobservable by the program. “After” the assignment, everything that looks will always see the same value; but crucially, “before” the assignment nothing is able to look (since looking creates a data dependency, which will cause that code to be run “after”).

                          Hence the behaviour of a program that uses single assignment is independent of when that assignment takes place. There’s no particular reason to assume that it will take place at one time or another. We might kid ourselves, for the sake of convenience, that such programs have a state that changes over time, maybe going to far as to pretend that these hypothetical state changes depend in some way on the way our definitions are arrangement in a text file. Yet this is just a (sometimes useful) metaphor, which may be utterly disconnected from what’s actually going on when the program (or, perhaps, a logically-equivalent one, spat out of several stages of compilation and optimisation!).

                          Note that the same is true of the ‘opposite’ behaviour: garbage collection. A program’s behaviour can’t depend on whether or not something has been garbage collected, since any reference held by such code will prevent it from being collected! Garbage collection is an implementation detail that’s up to the interpreter/runtime-system; we can count on it happening “eventually”, and in some languages we may even request it, but adding it to our semantic model (e.g. as specific state transitions) is usually an overcomplication that hinders our understanding.

                          1.  

                            A lot of what you see as distinctive in functional languages is common to many non-functional languages. And look up Prolog - it is a very interesting alternative model.

                            1.  

                              A lot of what you see as distinctive in functional languages is common to many non-functional languages.

                              You’re assuming “what I see”, and you’re assumption is wrong. I don’t know where you got this idea from, but it’s not from me.

                              I actually think of “functional programming” as a collection of styles/practices which have certain themes in common (e.g. immutability). I think of “functional programming languages” as simply those which make programming in a functional style easier (e.g. eliminating tail calls, having first-class functions, etc.) and “non-functional programming languages” as those which make those styles harder. Most functional programming practices are possible in most languages.

                              In other words, I agree that “A lot of [features of] functional languages is common to many non-functional languages”, but I have no idea why you would claim I didn’t.

                              Note that in this thread I’ve not tried to claim that, e.g. “functional programming languages are better”, or anything of that nature. I was simply stating the criteria I use for whether to call a style/language “imperative” or not; namely, if its semantics are most usefully understood as executing instructions to change the state of the (internal or external) world.

                              And look up Prolog - it is a very interesting alternative model.

                              I’m well aware of Prolog. The research group I was in for my PhD did some fascinating work on formalising and improving logic programming in co-inductive settings; although I wasn’t directly involved in that. For what it’s worth I’m currently writing a project in Mercury (a descendent of Prolog, with static types among other things).

                1.  

                  So procedural languages are similar to imperative languages, but with somewhat more abstraction?

              1. 1

                I did not find this explicitly mentioned, but surely the name resolution in OOP is dynamic rather than lexical?

                1. 2

                  Depends on the language doesn’t it?

                  1. 1

                    I would argue that message passing, with the objects deciding what to do about a message received at runtime captures the essence of dynamic binding.

                    However, I agree with your point. OO is somewhat amorphous at this point, and one may very well implement a language without late binding and call it OO.

                    Edit: To clarify what I meant; dynamic binding is where the execution path rather than the lexical ordering determines how a method or variable is resolved. When an object receives a message, the message resolution is determined by the execution path that involved that object. That is, one can not predict in advance using lexical knowledge alone what method will be called.

                    1. 8

                      The post talks both about name resolution (lexical and dynamic scope) and method resolution, and sometimes seems to conflate the two.

                      All mainstream OO languages that I’m familiar with use lexical scope, while most of them use dynamic binding.

                      1. 1

                        Yes, agreed. Got muddled :/

                1. 6

                  Preparing my first patches for rustc.

                  Also working on an Icelandic dictionary web app/service, combining the data sets of ISLEX and BÍN with a nice, fast UI. ISLEX is a dictionary with example sentences in several nordic languages, and BÍN has inflection tables.

                  Neither of them are very good with misspelled/transliterated words, so I’m working on fuzzy matching so that Thjodskra matches Þjóðskrá, and so on. Having it all in one, easier to use tool will be nice, I think.

                  1. 45

                    I use and love linux, and have read many things about Linus being abusive and what not. I am on the spectrum and wasn’t diagnosed til my 40s. Looking back on my earlier adult years, I was described as abrasive, obnoxious, and many others.

                    I tend not to suffer fools lightly, but somehow, on my own have learned better self-editing skills. Hopefully Linus will figure this out, because it truly will benefit everyone in the community.

                    1. 11

                      on my own have learned better self editing skills.

                      Any tips? I’m probably in a similar position but am trying to be less of an asshole.

                      1. 22

                        Wow. I wish I had a great answer for this. Feeling things, ANYTHING, has always been hard for me, but one thing that has always made me feel things is art. Music and cinema are usually where I go. When something in either of those arenas makes me feel something, I reflect on it and think. I think about that feeling and how it might apply to me and others, and I dunno, maybe it’s re-written my brain wiring a little bit.

                        I guess one basic thing I also do is just not respond sometimes. I give it time, and think about it. When I’m on the internet now, I can’t tell you how many times I’ve started a reply, and then just bailed on it, and never sent it. Or I’ve started a reply, and copied it into my clipboard so I could spend a little time thinking if I really wanted to send it. It’s in the clipboard if I need it.

                        Whereas 30+ years ago, if I was on my BBS or another, I would just furiously write a reply or a message and just hit save, without thinking. So maybe some of this has come with age, also. Supposedly we get wiser as we get older.

                        1. 13

                          I am (was?) also in a similar situation. I never insulted people, like Linus, but I would give very blunt feedback, because that’s how I like to receive feedback. It took me a while (I’m in my thirties now) but I eventually recognised that different people respond differently to different styles of feedback. So I would observe other people’s communication styles, and then mimic a person’s style when giving them feedback. It felt dishonest and almost manipulative at first, but I noticed how much smoother my interactions would be, and after a while I could do it without much effort. It made me more effective in teams, and I think my coworkers feel more positive about working with me these days.

                          1. 6

                            Don’t reply on impulse. Play devil’s advocate when reading your replies. When in doubt, clarify that you are criticizing an idea or a behavior and not attacking the person behind it. If necessary, acknowledge and repeat back what the other person wrote to ensure you are understanding each other before responding.

                          2. 3

                            I am on the spectrum and wasn’t diagnosed til my 40s.

                            This is what surprises me about this post - and your comment. I’m not being judgemental - I’m just ignorant about the condition(s) other than exposure in the media - which must be the worst way to learn about anything.

                            Linus is married and I expect he has a social circle apart from his professional and technical contacts.

                            I’m surprised he hasn’t come to realise until now. Still good for him to publicly admit and address it - that alone takes a lot of bravery - including your comment.

                            1. 10

                              It was actually someone in my social circle who suggested I read Jon Elder Robison’s book, Look Me in the Eye, which began my journey. She said I reminded her a lot of him. When I was in grade school, Aspergers wasn’t really a thing to the point of mass awareness. When it became a thing, I was already in high school. I surely would have benefited from some special education in my more formative years of grade school, but instead I had to learn it the hard way through social failure. This method wasn’t always successful, either.

                              Relationships of all sorts still baffle me, and I often question peoples’ choices when they make a beeline for the worse possible decision, when the best choice is obvious to me, but hey.

                              Human behaviour is so broad that I suspect people on the Aspergers side of the spectrum were just dismissed with people saying, “Oh, that’s just John being John.” In my family, the behaviour was probably more accepted because after my diagnosis, and learning what to look for, it’s clear that my dad is on the spectrum, also. So my behaviour was just probably explained by “the apple not falling far from the tree.”

                              Despite that, my mom definitely didn’t have the patience for a kid on the spectrum. It was bad.

                              But becoming self aware later in life, from where I sit, is a common thing. With age comes wisdom, hopefully.

                              1. 1

                                Thanks for taking the time to reply,

                                I was sent on a management course once which turned out to be a cleverly disguised self-improvement course but I think the thing that stayed with me more than anything was the instructor saying that “people are messy” - his exact phrase, repeated several times. I think part of what he meant was that there is no logic and no rules that govern everybody and every single relationship is unique and challenging in its own way.

                                That freed me from a lot of prejudice and stress I think. Although it may sound scary that you can’t rely on a set of instructions or a template for dealing with people, it’s also quite liberating and helped me avoid stereotyping people and treat them more individually rather than thinking there is some cultural, racial, religious (or any other) “norm” for anyone.

                                1. 3

                                  One thing I learned from working for this particular boss was, “What’s true for me isn’t necessarily true for you (or others). What struck me was a particular example he gave at a staff meeting, one day. This company had an inside sales force. It was phone stuff. They never left the office unless we went to trade shows, but he made them all wear ties because, “Wearing a tie makes you feel better, doesn’t it?” Well speaking for myself, it didn’t. Anything on or near my adam’s apple makes me gag, and wearing a tie all day was torture. The lesson learned was that HE didn’t see that what was true for him, wasn’t always true for everyone else. I applied that lesson to myself from that day forward. I think in management there are some universal truths about respect and behaviour that must apply to everyone, and then there’s all that individual relationship stuff you talked about.

                                  I also know that being on the spectrum, and being awesome like we are, doesn’t always allow us to see these things so clearly in the moment. After all it’s literally a brain wiring thing.

                                  For example. I see a person in this thread replying to everyone about how Linus doing what he is doing is BAD and this and that. I’m beginning to wonder if this person might not be on the spectrum, also, and might be unaware of what they’re putting out into the universe.

                                  Thanks to everyone who’s having a reasonable and rational discussion about this.

                                  BTW, I occasionally host panels at Sci Fi cons about Aspergers and Neuro-diversity with the title, “Sheldon, Asperger, and You,” and they have all been wildly successful. My hope is always to give someone else the gift of self awareness I got when my friend suggested Jon Elder Robison’s book to me.

                          1. 3
                            1. It can’t do anything technologically useful.
                            2. It should be fast at doing what it does, so that it is safe to call LOLWUT on production instances.
                            3. The output should be entertaining in some way.

                            This is irritating to all of us with open PRs for real improvements, bugfixes, and enhancements that are starved for attention.

                            Because of the master-slave fiasco and intense work involved with scrubbing everything, he now needs a diversion to like working on his own project again? That’s great, it’s over – now let’s get back to brass tacks and fix defects, finally finish replication enhancements now being worked on for 2 years, finally wrap up streams (Salvatore’s pet project nobody asked for), and improve performance to play catch-up with other datastores.

                            1. 30

                              Or, antirez can spend his time as he sees fit, just like any other FOSS maintainer.

                              1. 9

                                I’m sorry your PRs weren’t getting attention, but it was very important to change a word and the negative discourse associated with that (and this resulting cry for help) were much more critical to spend cycles on.

                                You can’t prioritize software quality over Twitter grumping, that’d be silly.

                                1. 6

                                  I haven’t followed the details of the master-slave kerfuffle, but it seems to be simply a failure of community management. As a lazy maintainer, it seems like the proper route is just to say “I acknowledge that people feel so strongly about this sort of terminology and will happily accept PR’s to fix the problem; this seems like a good candidate for new contributors to get their feet wet with” and link to a connected issue tracker.

                                  Then after a year or two of no nobody submitting fixes you close the issue as WONTFIX and get on with life.

                                  Edit: That said, taking a break from the stuff you have to do and making something functioning, silly and completely irrelevant in the grand scheme of things can be deeply satisfying. Sometimes you need that sort of thing to remind us why we love doing what we do.

                                  1. 3

                                    Yeah, I still don’t understand how Twitter discussions can have this impact on people’s lives.

                                    Together with just some wording used since the beginning of IT. So why can’t words acquire new meanings? Isn’t that the definition of a living language?

                                    1. 3

                                      Because the people are suffering from some kind of delusion.

                                      I would like to see the budding young DBA-to-be who veered off IT/CS/STEM because he or she got triggered by the word “slave”.

                                      Or even honest testimonies along the lines of “I was always interested in code, but I’d suffer immense panic attacks when I saw the word ‘blacklist’. I’m a Person of Color so this touches me deeply. The maintainer was kind enough to rename it (we settled on disallowlist) and now I commit a few times a year to the project. I have never felt this included and welcome in my life. Best of all? No one even complained about the broken APIs after the rename!”

                                      1. 1

                                        What I find weird is the “matter of fact” tone plus many contributors (not necessarily the maintainer) caving in right away, as if they also felt dirty while typing “git push - u origin master” or felt all the weight of worldwide injustices when the main DB switched to the “slave” one. I was relieved reading sane supporters though.

                                      2. 2

                                        Yes words do this constantly. But only in a negative way. Negative connotations tend to hang around. That’s why using these words is problematic. Also impractical, since you’d have to add a disclaimer that you mean the word in the new sense not the broadly known old one. If someone knows an example of some words changing from negative to positive connotations I’d be happy to hear about this.

                                        For the current example I honestly don’t understand the quarrels people have. Why is dropping language that’s strongly tied to a history of colonisation and oppression a bad thing? Especially when other words can describe the same architectural pattern as accurately as the original words?

                                        And every programmer knows that choice of words is important, we shouldn’t use them too lightly.

                                        To turn the question around: So why can’t concepts get new names if the old ones are problematic?

                                        1. 7

                                          If someone knows an example of some words changing from negative to positive connotations I’d be happy to hear about this.

                                          • Fun - to cheat or hoax
                                          • Smart - a sharp stinging pain
                                          • Fond - a fool
                                          1. 4

                                            “Nice” is one of such words. It meant foolish and silly.

                                            The problem isn’t much about naming by itself: you want to use “disallowedList” and “allowedList”? Want to use “primary” and “replica”? Want to use “kaka” and “popo”, do as you wish. But going ahead and picking a project at seemingly random and force them to change words that have been picked as they are (or used to be) the standard name of those elements in a somewhat aggressive way then that’s where I’m drawing the line.

                                            Or creating chaos on the issues section or on social media, extending the use of such standard words to the morals of the maintainers, that’s totally disgusting and absolutely useless.

                                            What I find even more shocking isn’t the vocal part that enjoys stirring up drama for whatever reason (there is clearly a reason why these groups are doing this and it cannot be to make the tech world a friendlier place, that’s for sure) but it is people who just shrugs them off or who, just like you, now supports their point because they are somewhat technically correct.

                                            Let’s start harassing all Spanish speaker developers who use the word “negro” for their black elements, how about the word “sheet” that reads as poo in Swedish, how about the word “pitch” that is extremely similar to a bad word in some Slavic languages, and “git”?

                                            That is and would be dumb to do. Also, why is the “American” morality be pushed down the throats of the rest of the world? Just because they still cannot cope with their past, is that a good reason to force everyone to change their behaviour?

                                            1. 3

                                              I share the idea that this debate is totally dumb. There were intellectuals in the 90s that brought this up with Intel and IDE controllers. PATA went away and that debate didn’t matter, but now we see the same bullshit arising again.

                                              The most vocal people in this fight are extremely childish and troll/harass developers. That’s not right. If you take a reasonable stance, you’re a racist.

                                              I’m tired of outrage culture.

                                              I highly recommend Brendan O’Neil’s speech on offence: https://www.youtube.com/watch?v=BtWrljX9HRA

                                              and I also recommend the original post about this debate with ver well reasoned arguments:

                                              http://antirez.com/news/122

                                              1. 2

                                                “In fact, pretty much every leap forward in history… pretty much every freedom we enjoy is a product of individuals having given offense. Having offended against the orthodoxies of their age. Offensiveness is not something we have to begrudgingly accept. Offensiveness is the motor of human progress.”

                                                I’ll add the people against offending folks are defending beliefs created by offending folks ranging from speech to progress. Just like he said. They wouldn’t exist if their rules were enforced by the orthodoxy of the day when people were trying to get those reforms started. So, they glorify the reformers who offended piles of people creating their current belief systems but say nobody is allowed to offend their orthodoxies suggesting alternative systems. Double standards are a common sign of bullshit.

                                                Edit: Oh, wait, he just said that, too, later in the speech. I’m still watching it.

                                              2. 2

                                                how about the word “sheet” that reads as poo in Swedish

                                                I don’t want to get into the broader discussion again, but I speak fluent Swedish; sheet /ʃiːt/ does not look or sound like skit /ˈɧiːt/.

                                                1. 1

                                                  Can’t argue with you, I just looked up English words which sounded/looked like bad words in other languages. Maybe they had something specific in mind, don’t know :)

                                                2. 2

                                                  IMNSHO the use of the word “slave” isn’t as simple as being “American”. The African slaves were often sold off by their own chieftains, and different types of slavery have existed and (may be argued to) exist around the world.

                                                  The point about stirring up shit is more relevant. These are homonyms; a word that sounds the same or is spelled the same as another can have different meanings, as rhe examples above.

                                                  The slave in an IT or mechanical context simply isn’t the same type of slave that picked cotton in the southern states.

                                                  I’m sure there are plenty of Slavic lobsters here, but I haven’t read a single comment, here or elsewhere, of one of them being triggered by the etymology of that word.

                                                  1. 2

                                                    Exactly and that’s because on a global platform, filled with people from all around the world, with absolutely different cultures and languages, people (including myself) are not going to ruin someone else’s day just because they used a word which was/sound/looks/is derogatory in my own language on something totally unrelated.

                                                    If there was something totally unacceptable, one could look into why such a word was chosen or if it was intended at all, inform them privately of the thing (if, say, they are interested in being known in those countries) and move on. Not starting a debate about something pretty much every single culture in the world has had.

                                                    This seems to come from the wave of social justice which is plaguing certain countries, where one is offended for someone else and wants to be their saviour, while making everyone more miserable in the process, probably to achieve a “victory” for humanity or just themselves.

                                                    1. 1

                                                      It’s not specifically American at all. Human trafficking rings (a polite euphemism for ‘selling people into slavery’) are still being fought by law enforcement around the world today.

                                                      I’m sure there are plenty of Slavic lobsters here, but I haven’t read a single comment, here or elsewhere, of one of them being triggered by the etymology of that word.

                                                      Reasonable people aren’t triggered by thousand-year-old etymology.

                                                      https://en.wikipedia.org/wiki/Human_trafficking#Revenue indicates $150 billion/year in revenue derived from forced labor, globally. Consider that your users might actually include someone who has been enslaved and would rather not be reminded of it at work.

                                                      1. 2

                                                        Yet your example is hypothetical. There might actually be someone. People shouldn’t be triggered by homonyms at all.

                                                        Maybe the next hill to die on is killing or terminating child processes. Many women need to have late abortions and be reminded at work of infanticide.

                                                        This will never stop unless maintainers put their foot down and say that messing around with APIs because a vocal minority bullies them is not ok.

                                                        The case would be stronger if the proponents of this had personal experience to share, or other evidence to back it up. Even then, we’re talking about software, not people. Better would be to donate to Amnesty or do something else than change every word and rewrite all the dictionaries.

                                                        1. 1

                                                          People shouldn’t be triggered by homonyms at all.

                                                          If only we got a choice about what trauma the world inflicted on us.

                                                          Maybe the next hill to die on is killing or terminating child processes

                                                          Maybe. But since nobody has, to my knowledge, brought it up - you are raising a ridiculous straw-man (straw-person, ha).

                                                          This will never stop unless maintainers put their foot down and say that messing around with APIs because a vocal minority bullies them is not ok.

                                                          Of the things that might stop it, that seems like one of the least likely to work.

                                                          As noted elsewhere in the thread, “Feel free to submit a complete PR, including all documentation updates” is more than enough to get them to leave you alone. In the unlikely event that someone cares enough to actually do the work, I’d suggest you’ve just gained a hardworking co-contributor.

                                                    2. 1

                                                      Please do not conflate my questions or position with abusive behaviour towards others. My post was not about that. I haven’t asked you to do anything, nor have I endorsed abusive behaviour by others. If my questions or position causes so much grief and anger maybe it’s worth exploring why that is the case?

                                                      Please relax, there’s no need for this aggravating tone here.

                                                      1. 1

                                                        Mmm what?

                                          1. 9

                                            Familiarising myself with rustc, so that I can contribute to it.

                                            1. 21

                                              “Moreover I don’t believe in the right to be offended, because it’s a subjective thing. Different groups may feel offended by different things. To save the right of not being offended it becomes basically impossible to say or do anything in the long run. Is this the evolution of our society? A few days ago on Hacker News I discovered I can no longer say “fake news” for instance.”

                                              Everyone should have a right to be offended, because that’s a continuous empathy machanism.

                                              In society, as we interact with each other, there may be situations where someone may feel offended, and that’s okay. We could even offend someone accidentally, and that’s okay too. The adult life is complex. Life is complex. We get feedback, learn, and iterate. It’s been like that since ever.

                                              What isn’t okay is to think that other people shouldn’t be offended with something, because “It isn’t a big deal”. They may be offended, and that’s something you’ll have to deal with. We should be ready, and conscious, that our acts, even when we think are harmless, could be affecting other people’s emotions, they have the right to do so.

                                              That’s, basically, empathy. And without empathy, we won’t go anywhere.

                                              Overall, I would agree with the author, but I deeply disagree in that statement. It’s not “everyone is offended” or “no one should be offended”, it’s way more complex than that.

                                              ¿Is it okay to have “Master-Slave” in Redis, as it may offend (or just feel unwelcome) to some people? Just measure the possibilities, and based on this, on feedback, and on empathy, decide what’s the best decission to make here. But don’t take away the right to be offended to the people.

                                              1. 2

                                                I fully agree that we should be sensitive to others perspectives and situations and try to always have an open mind.

                                                But I strongly disagree that there exists any right to not be offended.

                                                The problem with such a premise is that anyone can choose to be offended by literally anything. Or they can say they are offended by something when really they just want a soapbox to stand on. Or you might offend someone and not even know it. The bottom line is that if you try to go out of your way to offend no one, you will quickly find that you have nothing left that you can safely say.

                                                1. 8

                                                  Note that they are talking about the right to be offended, not a right to not be offended. That is quite different.

                                                  1. 2

                                                    It’s the same thing once they take action. They’re offended. They want the thing changed so theyre not offended. Equivalent in practice.

                                                  2. 3

                                                    Having a right to be offended doesn’t mean to be, automatically, offended for everything.

                                                    There’s a sweet spot, a sane spot, which is: Be offended whenever you feel like that, and just use that card when you feel that offense.

                                                    But, already having the right, you still need some social skills to interact with each other. Someone that gets offended for too many things will interact with a society that will reply with feedback. That ends up shaping you.

                                                    The point is: No 100% offense. No 0% offense. There’s a sweet spot. And the sweet spot requires the right to be offended.

                                                  3. 2

                                                    You are taking what antirez said literally, but I don’t think that is charitable. Most people agree that emotions/feelings usually precede notions of right and wrong. I doubt antirez wants to deny people their feelings.

                                                    What I think he means by having “a right to be offended” is “being entitled to having your way based on the fact that you feel offended”. Using master-slave terminology offends some people and their basic argument is that that alone is sufficient reason that it should be changed.

                                                    Antirez sees that as a bad argument and feels that people do not have a right to have their way based on the fact that they feel offended. And honestly, they probably wouldn’t want that right either, because those making these arguments are usually people with opinions that deeply offend their more conservative countrymen. Who would then also be entitled to getting their way, based on their feelings of being offended.

                                                    If we’re using empathy as a measuring stick, we should apply it equally and also require empathy of those that feel offended. When you feel offended, understand that someone does not intend to offend you. Understand that they may simply not understand why something is offensive to you. Recognize that feelings are regularly used coercively and your feelings thus have very little weight. Recognize patience and persistence are needed to achieve change.

                                                    1. 5

                                                      What I think he means by having “a right to be offended” is “being entitled to having your way based on the fact that you feel offended”

                                                      If that’s what he meant, I agree (And would sugest to write that, instead). You have the right to be offended, and your feelings should be taken in count, but being offended doesn’t empower you with the absolute truth.

                                                      If we’re using empathy as a measuring stick, we should apply it equally and also require empathy of those that feel offended.

                                                      Totally agree. Empathy is a two-way road.

                                                      1. 1

                                                        (And would sugest to write that, instead).

                                                        Some of the modes of failing to communicate I regularly see in issue reports written by colleagues:

                                                        • not realizing that what they wrote doesn’t mean what they intend it to mean (especially non-native English speakers)
                                                        • not realizing they are leaving out knowledge or intermediate reasoning steps that make the report confusing and easy to misunderstand
                                                        • misunderstanding the issue and writing things that don’t make much sense given a correct understanding of the issue (but are completely sensible assuming their understanding of the issue)
                                                        • misunderstanding or failing to make explicit their own arguments/reasoning (related to the second, but concerning non-factual or very indirect matters, such as reasons for having a hunch about a cause)
                                                        • probably various other failure modes that I haven’t clearly distinguished yet.

                                                        Whenever I find someone seems to be saying something weird or ridiculous, I start by assuming there is a communication problem. After fleshing out the issues I may still disagree, but at least the thing I’m disagreeing with is an actual opinion held by the other. So in this case, I’m much inclined to not take what antirez wrote very literally.

                                                        (And I would even go as far as to say that even if antirez would chime in to say he did mean it literally, then I would have some serious questions before I would actually believe that to be the case. Thinking you believe something while not actually believing something is a very real thing)

                                                        1. 2

                                                          It totally happens, but trying to guess what the author was trying to say while failing on communication seems like too much guessing for me, not optimal.

                                                          I prefer to understand exactly what the author says, and, if there’re misunderstandings, a quick discussion will clear everything. (And maybe the next time, the author is able to communicate better).

                                                  1. 1

                                                    More inclusive and open

                                                    Male and female emoji have been merged into gender-neutral emoji that are relevant to you

                                                    I fail to see why this is “more inclusive” or “open”. I mean, I’m all for people who are gender-neutral, I have no problems with this, but considering that the vast majority of the population isn’t gender-neutral, it’s actually less inclusive, by definition. Either provide more possibilities or go ahead and just say that there are fewer options. But don’t bend over backward to appease a small amount of people by normalizing everyone. :(

                                                    1. 6

                                                      The way I see it is that Unicode emoji tried to be gender-inclusive by adding a “female” modifier (emoji + zero-width joiner + ♀️).

                                                      This reinforces a false binary, and the way it’s implemented in mainstream emoji design reinforces gender stereotypes. Women have long hair, makeup, and pink clothes; men have short hair and blue clothes; that sort of thing.

                                                      Gender isn’t something that can be seen, and so I don’t think adding more and more gender options makes sense. In my opinion, it would be much better to offer stylistic choice, such as “long hair” or “makeup”, as options unrelated to gender, since that’s what they are.

                                                      I don’t agree that having fewer gender options makes it less inclusive. It isn’t saying that every emoji represents a non-binary or agender person or anything. It simply does not specify a gender, and so they aren’t excluding anyone on basis of gender.

                                                      Edit: it’s like how the basic facial expression emoji were never gendered to begin with, and so there is no need to add more gender options to them.

                                                      1. 0

                                                        Gender isn’t something that can be seen

                                                        Most of the time it can but not on something as tiny and reductive as an emoji without having to use things like clothes color.

                                                        1. 0

                                                          Sure, you can guess, and odds are you’d be right a lot of the time, but it still isn’t defined by any kind of outward appearance.

                                                      2. 2

                                                        Additionally, I find it odd that they’ve chosen to reduce the set of available choices when it comes to gender, but they’ve greatly expanded the choices when it comes to race. I think they should decide whether they want to provide options for things like race, gender, sexuality or not provide options.

                                                        1. 1

                                                          I poked around and found a relevant pair of questions in the FAQ on the race and gender questions. They don’t specifically compare the two decisions, but the rationale for each is there.

                                                      1. 2

                                                        Registered a domain and am currently setting up group chat software for queer folks in this tiny country that has become my home.

                                                        Facebook is very entrenched here, but I spoke to some friends who recently deleted their accounts, and we figured it’s worth a shot. I hope it gets some uptake.

                                                        1. 8

                                                          Imagining a time where I can go to the local maker space and print some open source garments that I have modified to have larger pockets.

                                                          In the present, I just stick to what works and get a lot of stuff from the same brand, since I know it fits me and my essential items well.

                                                          1. 5

                                                            Programmable sewing machine would be quite amazing.

                                                            1. 1

                                                              http://softwearautomation.com/li-fung-announce-partnership-softwear-automation/

                                                              Softwear’s revolutionary digital t-shirt SEWBOT® Workline is fully autonomous and requires a single operator, producing one complete t-shirt every 22 seconds…

                                                              1. 1

                                                                Found this as well: https://www.youtube.com/watch?v=qXFUqCijkUs Seems like clothes would have be ‘re-architected’ for this method.

                                                                1. 1

                                                                  Why would they need to be rearchitected? The video doesn’t seem to point to that directly.

                                                                  1. 1

                                                                    Not all clothes are assembled from fabric panels that stack neatly on top of each other, consider the crotch of the common pants, or double inner seam of jeans.

                                                              2. 1

                                                                Ha, there’s actually some work on this, I think there’s a DARPA project as well, robotic garment assembly. I’ve given this topic a lot of thought myself. Robots can wield, why not sew?

                                                            1. 13

                                                              Participating in the annual “queer days” festivities.

                                                              1. 1

                                                                And of course someone is upset about this and marks it as spam.

                                                                1. 2

                                                                  It’s sometimes hard to tell where people just disagree or are haters. This is a thread about literally anything we might be doing this weekend. Someone marked that as spam. Clearly a hater. Ignore them and enjoy your weekend. ;)

                                                              1. 7

                                                                Bad idea, it should error or give NaN.

                                                                1/0 = 0 is mathematically sound

                                                                It’s not mathematically sound.

                                                                a/b = c should be equivalent to a = c*b

                                                                this fails with 1/0 = 0 because 1 is not equal to 0*0.

                                                                Edit: I was wrong, it is mathematically sound. You can define x/0 = f(x) any function of x at all. All the field axioms still hold because they all have preconditions that ensure you never look at the result of division by zero.

                                                                There is a subtlety because some people say (X) and others say (Y)

                                                                • (X) a/b = c should be equivalent to a = c*b when the LHS is well defined

                                                                • (Y) a/b = c should be equivalent to a = c*b when b is nonzero

                                                                If you have (X) definition in mind it becomes unsound, if you are more formal and use definition (Y) then it stays sound.

                                                                It seems like a very bad idea to make division well defined but the expected algebra rules not apply to it. This is the whole reason we leave it undefined or make it an error. There isn’t any value you can give it that makes algebra work with it.

                                                                It will not help programmers to have their programs continue on unaware of a mistake, working on with corrupt values.

                                                                1. 14

                                                                  I really appreciate your follow-up about you being wrong. It is rare to see, and I commend you for it. Thank you.

                                                                  1. 8

                                                                    This is explicitly addressed in the post. Do you have any objections to the definition given in the post?

                                                                    1. 13

                                                                      I cover that exact objection in the post.

                                                                      1. 4

                                                                        It will not help programmers to have their programs continue on unaware of a mistake, working on with corrupt values

                                                                        That was my initial reaction too. But I don’t think Pony’s intended use case is numerical analysis; it’s for highly parallel low-latency systems, where there are other (bigger?) concerns to address. They wanted to have no runtime exceptions, so this is part of that design tradeoff. Anyway, nothing prevents the programmer from checking for zero denominators and handling them as needed. If you squint a little, it’s perhaps not that different from the various conventions on truthy/falsey values that exist in most languages, and we’ve managed to accommodate to those.

                                                                        1. 4

                                                                          Those truthy/falsey values are an often source of errors.

                                                                          I may be biased in my dislike of this “feature”, because I cannot recall when 1/0 = 0 would be useful in my work, but have no difficulty whatsoever thinking of cases where truthy/falsey caused problems.

                                                                        2. 4

                                                                          1/0 is integer math. NaN is available for floating point math not integer math.

                                                                          1. 2

                                                                            It will not help programmers to have their programs continue on unaware of a mistake, working on with corrupt values.

                                                                            I wonder if someone making a linear math library for Pony already faced this. There are many operations that might divide by zero, and you will want to let the user know if they divided by zero.

                                                                            1. 7

                                                                              It’s easy for a Pony user to create their own integer division operation that will be partial. Additionally, a “partial division for integers” operator has been been in the works for a while and will land soon. Its part of operators that will also error if you have integer overflow or underflow. Those will be +?, /?, *?, -?.

                                                                              https://playground.ponylang.org/?gist=834f46a58244e981473c0677643c52ff

                                                                          1. 2

                                                                            I’ve never heard of this joke, but if you want to find a cycle in a linked list, the canonical way to do it is to use two pointers and have one walk one step at a time, while the other walks two. If they are ever equal after they take a step, there’s a cycle. Using signals is – I think it’s safe to say – way over the top. (Unless that’s the joke.)

                                                                            1. 8

                                                                              That is the joke. The way I heard it was: keep free()ing the nodes, and if there’s a crash (due to double-free) you found a cycle.

                                                                              1. 2

                                                                                I’ve heard of the two-pointer approach (with pointer variables typically given the names “tortoise” and “hare”), but I really like the double-free approach.

                                                                                1. 1

                                                                                  Of course, free(x) could be a noop if you have a garbage collecting C (like Zeta-C)

                                                                                1. 22

                                                                                  After writing Go for 5 years, I’d recommend Rust for C developers. It’s more complicated than Go for sure, but also has more to offer. The lack of garbage collection and support of generics are definitely a plus compared to Go.

                                                                                  Go is a better language for junior devs, but I wouldn’t call C programmers junior. They should be able to digest Rust’s complexity.

                                                                                  1. 9

                                                                                    They should be able to digest Rust’s complexity.

                                                                                    Non trivial amount of C programmers are still doing C to avoid additional complexity. Not everyone wants a kitchen & sink programming language.

                                                                                    1. 6

                                                                                      Rust can definitely get overly complex if the developers show no constraint (i.e. type golf), but the control afforded by manual memory management makes up for it, IMHO. Unless it’s a one-run project, performance will eventually matter, and fixing bad allocation practices after the fact is a lot harder than doing it right from the beginning.

                                                                                      1. 1

                                                                                        Couldn’t they just start with a C-like subset of Rust adding from there to their arsenal what extra features they like? It’s what I was going to recommend to those trying it for safety-critical use since they likely know C.

                                                                                        1. 9

                                                                                          I think it’s rather difficult to write rust in a C like manner. This contrasts with go, where you can basically write C code and move the type declarations around and end up with somewhat unidiomatic but working go.

                                                                                          1. 3

                                                                                            I think C++ as a better C works because you still have libc besides the STL, etc. The Rust standard library uses generics, traits, etc. quite heavily and type parameters and lifetime parameters tend to percolate to downstream users.

                                                                                            Though I think a lot of value in Rust is in concepts that may initially add some complexity, such the borrow checker rules.

                                                                                            1. 3

                                                                                              The problem with C++ is its complexity at the language level. I have little hope of teams of people porting various tools for static analysis, verification, and refactoring to it that C and Java already have. Certifying compilers either. C itself is a rough language but smaller. The massive bandwagon behind it caused lots of tooling to be built, esp FOSS. So, I now push for low-level stuff either safer C or something that ties into C’s ecosystem.

                                                                                            2. 4

                                                                                              You could argue the same for C++ (start with C and add extra features). Complexity comes with the whole ecosystem from platform support (OS, arch), compiler complexity (and hence subtle difference in feature implementations) to the language itself (C++ templates, rust macros). It’s challenging to limit oneself to a very specific subset on a single person project, it’s exponentially harder for larger teams to agree on a subset and adhere to it. I guess I just want a safer C not a new C++ replacement which seems to be the target for newer languages (like D & Rust).

                                                                                              1. 4

                                                                                                It’s challenging to limit oneself to a very specific subset on a single person project, it’s exponentially harder for larger teams to agree on a subset and adhere to it.

                                                                                                I see your overall point. It could be tricky. It would probably stay niche. I will note that, in the C and Java worlds, there’s tools that check source code for compliance with coding standards. That could work for a Rust subset as well.

                                                                                                “I guess I just want a safer C not a new C++ replacement which seems to be the target for newer languages (like D & Rust).”

                                                                                                I can’t remember if I asked you what you thought about Cyclone. So, I’m curious about that plus what you or other C programmers would change about such a proposal.

                                                                                                I was thinking something like it with Rust’s affine types and/or reference counting when borrow-checking sucks too much with performance acceptable. Also, unsafe stuff if necessary with the module prefixed with that like Wirth would do. Some kind of module system or linking types to avoid linker errors, too. Seemless use of existing C libraries. Then, an interpreter or REPL for the productivity boost. Extracts to C to use its optimizing and certifying compilers. I’m unsure of what I’d default with on error handling and concurrency. First round at error handling might be error codes since I saw a design for statically checking their correct usage.

                                                                                                1. 3

                                                                                                  I can’t remember if I asked you what you thought about Cyclone. So, I’m curious about that plus what you or other C programmers would change about such a proposal.

                                                                                                  I looked at it in the past and it felt like a language built on top of C similar to what a checker tool with annotations would do. It felt geared too much towards research versus use and the site itself states:

                                                                                                  Cyclone is no longer supported; the core research project has finished and the developers have moved on to other things. (Several of Cyclone’s ideas have made their way into Rust.) Cyclone’s code can be made to work with some effort, but it will not build out of the box on modern (64 bit) platforms).

                                                                                                  However if I had to change Cyclone I would at least drop exceptions from it.

                                                                                                  I am keeping an eye on zig and that’s closest to how I imagine a potentially successful C replacement - assuming it takes up enough community drive and gets some people developing interesting software with it.

                                                                                                  That’s something Go had nailed down really well. The whole standard library (especially their crypto and http libs) being implemented from scratch in Go instead of being bindings were a strong value signal.

                                                                                                  1. 2

                                                                                                    re dropping exceptions. Dropping exceptions makes sense. Is there another way of error handling that’s safer or better than C’s that you think might be adoptable in a new, C-like language?

                                                                                                    re Zig. It’s an interesting language. I’m watching it at a distance for ideas.

                                                                                                    re standard library of X in X. Yeah, I agree. I’ve been noticing that pattern with Myrddin, too. They’ve been doing a lot within the language despite how new it is.

                                                                                                    1. 4

                                                                                                      Dropping exceptions makes sense. Is there another way of error handling that’s safer or better than C’s that you think might be adoptable in a new, C-like language?

                                                                                                      Yes, I think Zig actually does that pretty well: https://andrewkelley.me/post/intro-to-zig.html#error-type

                                                                                                      edit: snippet from the zig homepage:

                                                                                                      A fresh take on error handling that resembles what well-written C error handling looks like, minus the boilerplate and verbosity.

                                                                                                      1. 2

                                                                                                        Thanks for the link and tips!

                                                                                          2. 7

                                                                                            Short build/edit/run cycles are appreciated by junior and senior developers alike. Go currently has superior compilation times.

                                                                                            1. 10

                                                                                              Junior and senior developers also enjoy language features such as map, reduce, filter, and generics. Not to mention deterministic memory allocation, soft realtime, forced error checking, zero-cost abstractions, and (of course) memory safety.

                                                                                              1. 3

                                                                                                Junior and senior developers also enjoy language features such as map, reduce, filter, and generics.

                                                                                                Those are great!

                                                                                                deterministic memory allocation, soft realtime, forced error checking, zero-cost abstractions, and (of course) memory safety.

                                                                                                Where are you finding juniors who care about this stuff? (no, really - I would like to know what kind of education got them there).

                                                                                                1. 8

                                                                                                  I cared about those things, as a junior. I am not sure why juniors wouldn’t care, although I suppose it depends on what kind of software they’re interested in writing. It’s hard to get away with not caring, for a lot of things. Regarding education, I am self-taught, FWIW.

                                                                                                2. 1

                                                                                                  Map, reduce and filter are easily implemented in Go. Managing memory manually, while keeping the GC running, is fully possible. Turning off the GC is also possible. Soft realtime is achievable, depending on your definition of soft realtime.

                                                                                                  1. 1

                                                                                                    Map, reduce and filter are easily implemented in Go

                                                                                                    How? Type safe versions of these, that is, without interface{} and hacky codegen solutions?

                                                                                                    1. 1

                                                                                                      Here are typesafe examples for Map, Filter etc: https://gobyexample.com/collection-functions

                                                                                                      Implementing one Map function per type is often good enough. There is some duplication of code, but the required functionality is present. There are many theoretical needs that don’t always show up in practice.

                                                                                                      Also, using go generate (which comes with the compiler), generic versions are achievable too. For example like this: https://github.com/kulshekhar/fungen

                                                                                                      1. 9

                                                                                                        When people say “type safe map/filter/reduce/fold” or “map, reduce, filter, and generics” they are generally referring to the ability to define those functions in a way that is polymorphic, type safe, transparently handled by the compiler and doesn’t sacrifice runtime overhead compared to their monomorphic analogs.

                                                                                                        Whether you believe such facilities are useful or not is a completely different and orthogonal question. But no, they are certainly not achievable in Go and this is not a controversial claim. It is by design.

                                                                                                        1. 1

                                                                                                          Yes, I agree, Go does not have the combination of type safety and generics, unless you consider code generation.

                                                                                                          The implementation of generics in C++ also works by generating the code per required type.

                                                                                                          1. 5

                                                                                                            The implementation of generics in C++ also works by generating the code per required type.

                                                                                                            But they are not really comparable. In C++, when a library defines a generic type or function, it will work with any conforming data type. Since the Go compiler does not know about generics, with go generate one can only generate ‘monomorphized’ types for a set of predefined data types that are defined an upstream package. If you want different monomorphized types, you have to import the generic definitions and run go generate for your specific types.

                                                                                                            unless you consider code generation

                                                                                                            By that definition, any language is a generic language, there’s always Bourne shell/make/sed for code generation ;).

                                                                                                            1. 1

                                                                                                              That is true, and I agree that go does not have support for proper generics and that this can be a problem when creating libraries.

                                                                                                            2. 3

                                                                                                              That’s why I said “transparently handled by the compiler.” ;-)

                                                                                                              1. 0

                                                                                                                I see your point, but “go generate” is provided by the go compiler, by default. I guess it doesn’t qualify as transparent since you have to type “go generate” or place that command in a build file of some sort?

                                                                                                                1. 1

                                                                                                                  Yes. And for the reasons mentioned by @iswrong.

                                                                                                                  My larger point here really isn’t a technicality. My point is that communication is hard and not everyone spells out every point is precise detail, but it’s usually possible to infer the meaning based on context.

                                                                                                                  1. -1

                                                                                                                    I think the even larger point is that for a wide range of applications, “proper” and “transparent” generics might not even be needed in the first place. It would help, yes, but the Go community currently thrives without it, with no lack of results to show for.

                                                                                                                    1. 1

                                                                                                                      I mean, I’ve written Go code nearly daily since before it was 1.0. I don’t need to argue with you about whether generics are “needed,” which is a pretty slimy way to phrase this.

                                                                                                                      Seems to me like you’re trying to pick a fight. I already said upthread that the description of generics is different from the desire for them.

                                                                                                                      1. -2

                                                                                                                        You were the first to change the subject to you and me instead of sticking to the topic at hand. Downvoting as troll.

                                                                                                  2. 1

                                                                                                    By superior, I guess you meant shorter?

                                                                                                    1. 2

                                                                                                      Compiling a very large go project with a cold cache might take a minute (sub-second once the cache is warm).

                                                                                                      Compiling a fairly small rust app with a warm cache has taken me over a minute (I think it’s a little better than that now).

                                                                                                      1. 1

                                                                                                        Yes, and superior to Rust in that regard. Also the strict requirement to not have unused dependencies contributes to counteract dependency rot, for larger projects.

                                                                                                  1. 2

                                                                                                    Suing abandonware archives is too meanly. Personally I found Nintendo franchises like all these marios and zeldas as disgusting as Hollywood stuff. They had done lots of aggressive marketing in social networks recently to ensure “geek culture” is associated with their silly characters targeted to 5-year-old kids. I hope if all these ROMs would be removed from internets, this will lower popularity of Nintendo brands.

                                                                                                    1. 12

                                                                                                      It’s not abandonware when they’re maintaining their titles for virtual console on recent platforms. It’s not targeted at just 5-year-olds, it’s family entertainment that plenty of adults enjoy. Your comparison with Hollywood is far-fetched, and the adjectives you use are very trollish.

                                                                                                      1. 3

                                                                                                        when they’re maintaining their titles for virtual console

                                                                                                        Except they’re not? On a switch only VC Mario title is an arcade one. No Zelda except BOTW (the latest one). DS Zelda titles are only available second-hand as cartridges.

                                                                                                        1. 4

                                                                                                          They’re available on the 3DS VC. I’ve been playing through them all. And I’m in my thirties, FWIW. :)

                                                                                                          1. 4

                                                                                                            This was not the case at one point if memory serves. It is also no guarantee going forward.

                                                                                                            1. 2

                                                                                                              I think the point that people have been making is that Nintendo had no interest in re-releasing these games until they discovered how popular they were in the ROM scene and second hand markets.

                                                                                                      1. 16

                                                                                                        Moving from Linux, though, could have upsides for Google. Android’s use of the technology, which is distributed by Oracle Corp., is at the center of a lengthy, bitter lawsuit between the two companies.

                                                                                                        I am confused. I thought they were confusing Linux with Java, but the very next paragraph addresses the Java situation.

                                                                                                        A previous version of this story was corrected to make clear Oracle link with Linux.

                                                                                                        🤔

                                                                                                        1. 4

                                                                                                          If I had to guess, the reporter writing the story couldn’t imagine them spending the resources to replace something in Android and have that thing not be what Oracle is suing them over.

                                                                                                          1. 2

                                                                                                            lol… I think they just referred to Java as “Linux” in the correction as well 🤣

                                                                                                          1. 6

                                                                                                            I live in a small island nation, that will continue to see drastic changes due to climate change.

                                                                                                            I haven’t thought much about its impact on my work, but I’ve thought a lot about my work’s impact on it. And more generally, I didn’t know if I could stay in tech at all.

                                                                                                            But, I found a job that would have me work on embedded systems to help reduce supple-chain waste on a large scale, so that seems like a positive use of my existing skills.

                                                                                                            1. 5

                                                                                                              Another Keyboardio Model 01 user. It’s the only keyboard of its kind (split, ortholinear) that I’ve tried, where I can comfortably reach the most important keys. I have gone through periods of being unable to type at all, and have almost no pain now. I’ve had an Ergodox, a Kinesis Advantage, and a Kinesis Freestyle.

                                                                                                              I have made some customisations, by modifying the stock firmware, to make it easier for me to use my main 3 natural languages, without having to switch the input language in my OS.

                                                                                                              1. 4

                                                                                                                re standard libraries

                                                                                                                One idea I had when looking at transpilers and C-like LISP’s was to make a Python-like LISP. Also thought of Nim since they look similar. Anyway, the idea is to embed a Python-compatible language in a well-tooled LISP or Scheme where Python code could be easily ported. Start porting its standard library. Automate this process with Python semantics matched to the LISP. Eventually, one can do most things in the LISP using all those Pythonic libraries with the extra benefit of native, code compiler. Maybe also do it in reverse where one can extract idiomatic Python for distribution to those that don’t know the LISP version. Last part of that brainstorm was possibly doing it in Racket so people who started with or know Python can go to How to Design Programs to learn Scheme then to the Pythonic Scheme to get its power reusing their existing knowledge and libraries.

                                                                                                                Just a brainstorm folks might find interesting. Python has gotten pervasive and critical enough that I do keep thinking back on automated methods to optimize it, secure it, etc.

                                                                                                                1. 8

                                                                                                                  Not quite like what you’re describing, but have you seen Hy?

                                                                                                                  1. 4

                                                                                                                    I haven’t. Excerpting this:

                                                                                                                    “This is pretty cool because it means Hy is several things:

                                                                                                                    1. A Lisp that feels very Pythonic
                                                                                                                    2. For Lispers, a great way to use Lisp’s crazy powers but in the wide world of Python’s libraries (why yes, you now can write a Django application in Lisp!)
                                                                                                                    3. For Pythonistas, a great way to start exploring Lisp, from the comfort of Python!”

                                                                                                                    That looks like it’s at least half of what I was aiming for. Cool stuff. Bookmarking it. Thanks for the link!

                                                                                                                  2. 5

                                                                                                                    There is a python implementation in Common Lisp, https://github.com/metawilm/cl-python. There is also a library to run a CPython interpreter inside a Common Lisp image and interface with it: https://github.com/mmontone/burgled-batteries

                                                                                                                    Also Marijn Haverbeke, of code-mirror fame, had a similar idea but with JavaScript instead of Python so cl-javascript was born.

                                                                                                                    1. 1

                                                                                                                      That’s more like it! Even runs on multiple implementations of CL. Bookmarked. :)

                                                                                                                  1. 2

                                                                                                                    Ouch. I worked on some Python stuff a few jobs ago, and the optional_arg=[] feature is one I will never forget. I was made aware of it before I had a chance to shoot myself in my shared, mutable foot.

                                                                                                                    Seems to be like it’s one of those things that can quite readily evade unit tests, too.