1. 7

    Calling it “the real reason” is a bit of stretch (it’s more like “what I realized by accident after N years in the industry”), but the reason does actually sound quite compelling – to the point that I makes so much sense that struggled to remember why I preferred spaces all this time.

    I think the reason is alignment – I do things like

    $foo->bar()
        ->baz()
        ->etc(...)
    

    or

    sprintf("%s %s %s\n",
            $foo
            $bar
            $baz);
    

    regularly, and spaces guarantee that these will actually show up consistently. You could have the cake and eat it by using tabs for indentation and spaces for alignment – which makes sense when you think about it, but somehow “feels dirty” to mix the two.

    1. 8

      tabs for indentation and spaces for alignment

      This sounds reasonable to me.

      but somehow “feels dirty” to mix the two

      I think I can learn not to fee dirty if I remember that I wont actually be mixing the two. The tabs are strictly in prefix.

      1. 7

        The tough part is that if you are writing Python, mixed tabs and spaces are illegal, and the standard style guide for the language specifies spaces only. Outside of Python, it feels like tabs for indentation and spaces for alignment requires editor support: at a minimum, visible whitespace, but preferably also for automating the number of tabs and number when reindenting.

        I have always been a partisan of spaces-only, but this is the first argument for tabs that I find really strong. I do feel like I need to work towards adopting tabs.

        1. 12

          The tough part is that if you are writing Python, mixed tabs and spaces are illegal

          “Indentation is rejected as inconsistent if a source file mixes tabs and spaces in a way that makes the meaning dependent on the worth of a tab in spaces; a TabError is raised in that case.” That is, you can use spaces for alignment if you consistently use tabs for scoping.

          e.g. This works

          $ cat -t x.py
          def a(x):
          ^Iprint("1",
          ^I      "2"
          ^I      "3")
          a(1)
          

          And python does not complain.

          $ python -t x.py
          1 23
          
          1. 3

            Thanks, yes, you’re right. This leaves just the task of always maintaining perfect consistency in using tabs for scoping and spaces for alignment. Plus being willing to ignore the standard style guide (PEP 8) and avoid using code formatting tools like black.

      2. 4

        somehow “feels dirty” to mix the two.

        Why? Tabs are for indentation (semantic) whereas spaces are for alignment (visual). They’re different things.

        1. 1

          It’s “dirty” when different lines use different characters for indentation and alignment. e.g. line 1 uses 2 spaces for a single level of indentation, and line 2 uses 1 tab for a single level of indentation. (I’m not disagreeing with or discounting your point about having a rule to consistently abide by.)

          1. 2

            That is a different situation than what was described and called “dirty”.

        2. 4

          The main downside to using tabs + spaces is editor support. Back when I used it, I think kate was one of the few editors that didn’t mess up my code. I eventually moved to spaces only out of frustration with different editors.

          The other downside is all the derision you get for using tabs.

          1. 2

            You can’t use spaces for alignment for the same reason that tabs are apparently more accessible: different people will use tabs to mean different things. If you use space for alignment you are just moving the problem around, insisting that a tab is equal to N spaces – to keep your precious alignment correct.

            1. 12

              If you use tabs only for indentation, then your spaces will always line up. E.g. if you are 2 levels of indentation deep, and want to line up with the 3rd character, you have 2 tabs and 2 spaces. Regardless of tab length, 2 tabs and 2 spaces will end up at the same column as 2 tabs and 2 characters.

              Rule of thumb is if you are visually lining up to a previous line, use spaces. If you are adding a level of indentation, use a tab.

              1. 4

                That makes sense, I’m wrong :)

                I suppose a follow-up question is, does spaces for alignment satisfy the usability concern which tabs help with?

                1. 2

                  That’s a good question. I would imagine the answer isn’t so much that spaces for alignment helps, it’s the tabs for indentation that help. Spaces for alignment satisfies the “consistent alignment” part of the problem.

            2. 1

              If you drop the first method call/arg to a new line, indented one level more you get a similar effect with tabs only. And you save some horizontal space when the var/symbol on the first line is longer than one tab-width.

              JetBrains tools call this style “chop down” I believe.

            1. 8

              So, an interesting side effect of the GPL is you’re effectively banning your software from being run in large enterprise environments with legal departments that are concerned that having any GPL code will be infectious and that Stallman will come and steal all their monies :)

              Our socialist free software utopia is ripe for exploitation by capitalists, and they’ll be rewarded for doing so. Capitalism is about enriching yourself - not enriching your users and certainly not enriching society.

              IMO this boils down to whether or not you think capitalism is inherently exploitative at its base or whether it can also be a force for good.

              I’m on the fence on this one. I would love to live in a post materialism utopia, and in that world, I would be utterly in favor of the GPL and the total freedoms it guarantees.

              But in this world, the world where my choices are profit or die (quite literally in my case) , I’m less convinced that profiting from other people’s work when it’s a gift, ostensibly freely given, is inherently exploitative.

              I give people free software because I want them to reciprocate with the same. That’s really all the GPL does.

              This right here? This is the best articulation of all the hurt and anger I see around companies like the one I work for building commercial products based on OSS code bases. This actually makes sense to me, and is perfectly reasonable.

              Permissive licenses were designed to allow for commercial use of the licensed work, so having expectations to the contrary seem like a recipe for disappointment to me. Rather than being outraged, software authors should choose licenses that will do what they want and mean, and save their energy for creating more awesome software :)

              As others have said it’s a great article - super thoughtful and well written. Thanks for posting it!

              1. 8

                I’m on the fence on this one. I would love to live in a post materialism utopia, and in that world, I would be utterly in favor of the GPL and the total freedoms it guarantees.

                There’s great irony here; as the article points out, in such a world the GPL wouldn’t exist, because it would be pointless.

                1. 6

                  More correctly, it would be unnecessary. Like in the scientific environment, where people don’t feel the need for reciprocity and anti-troll clauses when publishing a paper.

                  1. 2

                    In the scientific environment, most of it gets put behind paywalls even though that isn’t strictly necessary. I think they also give them the copyrights, too, in many cases. There’s been more papers on the open sites recently. So, we might look at the scientific environment like software when it was mostly proprietary with a strong upswing of F/OSS.

                    1. 1

                      most of it gets put behind paywalls

                      Researchers are not being paid by that and that’s also besides the point. There are no restrictions on the concepts of the paper, e.g. a theorem. Readers can teach the theorem to other people or use it without some legal restriction (e.g. being required to provide citation or not to sue the author of the theorem)

                  2. 5

                    There’s great irony here; as the article points out, in such a world the GPL wouldn’t exist, because it would be pointless.

                    My understanding is that GPL is exactly that: a copyright way of fighting copyright. From what I remember Stallman basically created it to restore the world to the state it was before people started copyrighting software: hardware came with the full source code and you could modify whatever you wanted. Kinda like the freedom @SirCmpwn is describing in the article.

                    1. 1

                      You’re absolutely right. In a sense, the GPL exists to protect software author’s intent FROM capitalism and the legal mechanisms around it.

                        1. 1

                          He’d know. Look forward to reading that interview when I have more time.

                    2. 9

                      you’re effectively banning your software from being run in large enterprise environments

                      This is generally false. Only some large companies are avoiding GPL. Only some versions of it (3). And only in some use-cases. Also, they can change their decision without asking you.

                      IMO this boils down to whether or not you think capitalism is inherently exploitative at its base or whether it can also be a force for good.

                      How can you leap to this conclusion from reading a license? Plenty of companies release software under conditions that are way more restrictive than GPL (closed source, partnership agreements, contribution agreements…).

                      1. 3

                        This is generally false. Only some large companies are avoiding GPL. Only some versions of it (3). And only in some use-cases. Also, they can change their decision without asking you.

                        I will absolutely cop to my statement being too general, but you’re going to far the other way. I can speak to at least several environments where this is in fact the case.

                        1. 3

                          What, exactly, is the case? I’m aware of the internal policies of some FAANGS and other large companies.

                          1. 8

                            I can only speak for Google (having worked at the open source office), and our docs on GPL are here: https://opensource.google.com/docs/thirdparty/licenses/#restricted

                            Google’s monorepo and strong launch tooling means that we have very high confidence that GPL code doesn’t sneak into code that it shouldn’t, and we take great pains to ensure that all OSS is separated into a separate directory tree to make sure that people don’t accidentally patch the library and trigger a reciprocal license. We can do this because we have the money to have an OSS office, because we have the money to build the tooling, and because we have the institutional support to be a good OSS neighbor.

                            If I was CTO of a smaller company or one where all the code was federated into small repositories that I can’t track, I personally would ban GPL-style licenses. License forgiveness is certainly helpful, but once you’ve violated the license you are in a sticky situation where you have to either excise the library, or find employees who never looked at the code to clean-room implement it. Depending on how big that library is you might be very screwed. I would just see GPL as too dangerous.

                            1. 6

                              I would just see GPL as too dangerous.

                              That’s basically the point. If you plan to restrict users, stay away from the code that was written to provide them with freedom :)

                            2. 3

                              The (small) company I work for (based in Sweden, sells software for telecoms) bans the use of GPL libraries.

                              1. 5

                                The company I work for (based in Finland, sells software for telecoms) also bans the use of GPL libraries. ;)

                                1. 0

                                  There’s a pattern emerging. It’s… that we need to sell GPL license exemptions to telecoms. Oh yeah!

                        2. 3

                          Except GPL would actually allow you to make money as a creator by selling a dual license. If you released it as MIT, then well, too bad.

                          1. 0

                            Care to explain this a bit? MIT is a permissive license, so you can sell your work, as can others. What’s “too bad” about this?

                            1. 2

                              Let’s say you have a library you wrote with MIT license that a company wants to use. You can’t sell them a license but you can sell them support. Most companies will simply not pay you.

                              However, with GPL, companies are afraid to use your library for free because GPL would force them to open source. You can say “look, I can sell you a license and you won’t be forced to open source”. This is a dual license scheme where companies pay you for the right not to have to open their own code.

                          2. 3

                            you’re effectively banning your software from being run in large enterprise environments

                            Are you ? AFAIK, you are not allowed to modify it privately or use it as an integral part of another solution. If you just use the tool as an end user on your own, I am 99% sure you can’t be approached by the layers. If I am wrong, I would also like to know :)

                            1. 12

                              The point is that these companies don’t actually care what the true legal implications are and just run away out of GPL phobia.

                              The GPL is used commercially in many places, so if you think you can’t do business with the GPL you’re either mistaken or your business is shady.

                              1. 2

                                The point is that these companies don’t actually care what the true legal implications are and just run away out of GPL phobia.

                                I see it more as paranoia, but in some cases, paranoia grounded in cold hard fact. When you are the biggest target, your legal department needs to figure out how to protect said target from attack. In order to do that, it MUST set incredibly paranoid boundaries to protect the company’s liability.

                                1. 3

                                  Sort of. Apple forbids all GPLv3 but Google doesn’t. Both of these have comparable legal departments and are equally attractive targets and ship about as equally important software. They shouldn’t come to different conclusions on GPlv3.

                                2. 1

                                  You and @feoh are talking about different thing which I don’t care for. I talk about legal stuff only, not about human psychology here. Please focus on topic.

                                  1. 3

                                    No, this is the topic. You’re “effectively banning” your software because those companies have internal rules to ban any GPL software. They don’t care what the actual rules are, because effectively they have decided to interpret them their own way.

                                    Legal stuff is human psychology anyway, you have to convince a judge and a jury, who are fallible, biased, manipulatable humans.

                                3. 1

                                  You are. Speaking from my personal experience at one such large corporate enterprise, use of GPL licensed software is straight up banned.

                                  1. 6

                                    I don’t know where you work, so I can’t comment on specifics, but I have found at other places I worked many coworkers thought “using any GPL’d software was banned” but all ran Bash on their MacOS laptops… now maybe you’re all Windows all the time and really have a ban where you work, but in my experience such bans are not quite so total as is sometimes perceived.

                                    1. 3

                                      So you’re banning stupid people from using your software (stupid, because apparently they can’t read a license and estimate its effect). I’d call that a net win because it reduces customer support requests: stupid as they are, they’re probably of the “you must fix the issue I have, now, for free” kind, too.

                                      1. 2

                                        FSVO “stupid people” which includes “smart people who’ve chosen to work for people who make stupid decisions”, sure. But it’s not an invalid point.

                                        1. 4

                                          Respectfully, you’re both being a bit elitist here. There are limits on what we can conceive of based around our previous personal experiences.

                                          I have been thorugh the process of thinking something was stupid, only to learn that no really it’s NOT stupid and there were honest to god good reasons behind this or that restriction which I just wasn’t aware of at the time.

                                          Are they decisions you’d make? Possibly not. Are they decisions I’d make under the circumstances? Maybe and maybe not. I know I don’t have all the answers, and I’m arguably in a better position to have a wider view than some.

                                      2. 2

                                        One person already pointed out FAANG are known to do this. What they do doesn’t generalize to most enterprises, though. Heck, their success has a lot to do with being opposite of most enterprises. You should probably just say the specific companies, esp if it’s SaaS like Amazon.

                                        1. 5

                                          FAANG are known to do some of that.

                                          I work at Google and editing GPL code (not just using, actually changing and distributing an external project, coreboot) is what they hired me for, so the GPL is certainly not “banned”. There are bans though and the list is public: https://opensource.google.com/docs/thirdparty/licenses/#banned

                                          1. 0

                                            No but as someone else explained in more detail, it’s walled off from the mono-repo to protect the main code base from the viral nature of the GPL.

                                            Google has wisely chosen to put enough resources into play that it can safely play with fire safely.

                                    2. 3

                                      Rather than being outraged, software authors should choose licenses that will do what they want and mean, and save their energy for creating more awesome software :)

                                      You’re missing the important case where one’s ethics does not necessarily align with what one thinks should be enforced by law. For example, you might think that cheating on your SO is wrong, but it is generally not illegal to do.

                                      Just because I share similar goals as the FSF, does not mean I agree with their desired means to accomplish those goals.

                                      Effectively, you’re espousing a form of “the ends justify the means.”

                                      (You don’t need to ask me why I disagree with using copyleft as a means. Just go look up arguments against the use of intellectual property.)

                                      1. 2

                                        “Support Intellectual Prosperity, Not Property!”

                                        1. 1

                                          You’re missing the important case where one’s ethics does not necessarily align with what one thinks should be enforced by law. For example, you might think that cheating on your SO is wrong, but it is generally not illegal to do.

                                          So then get involved with activism efforts to change said law to more fully align with your desires?

                                          My point is simple - we live in a society awash with outrage, and honestly I think it’s becoming a canned response to way too much, so I’m suggesting the channeling of that energy into something more useful. That’s all.

                                          1. 2

                                            All I’m saying is that your outlook on how to choose licenses is extremely short sighted. And you aren’t the only one falling into this trap. Lots of people, for example, think it’s entirely unreasonable to be upset with someone plagiarizing your work if you put it into the public domain. And you’re effectively making the same argument, and it’s ridiculous.

                                            1. 1

                                              I don’t agree. You’re making analogies that don’t work, at least in my world view. I’m sure you have information or background that I don’t, but can you please help me understand how writing some code and then putting it under a license which is explicitly designed to allow it to be copied, sold or otherwise used in a particular way is equivalent to plagiarizing someone’s written work which was explicitly designed NOT to be copied etc?

                                              1. 3

                                                Sorry, but I don’t see what you’re missing. My last comment had zero analogies. The first analogy in my initial comment (cheating on SO) was merely used to demonstrate that laws and ethics are not the same thing. That is, just because I don’t want to use the full weight of the law to force you to do something (e.g., the GPL) doesn’t mean I thinkI don’t agree with the motivation for the GPL in the first place (reduce the amount kf proprietary code).

                                                In other words, saying you should choose a license based on its effect neglects the fact that one may disagree with the means by which the license achieves said effect.

                                                For example, I might choose to publish my source code in the public domain. In the eyes of the law, it would be legal for anyone to do anything with that work without restriction, including plagiarizing it. If you argue that one should choose a license only by its effect, then you’d think this was completely reasonable since I chose to put it into the public domain and knew this could happen. But what I’m saying is that this is a fairly shallow way to interpret license usage, and that it would be completely reasonable for the publisher to be upset at someone plagiarizing their public domain work. Because laws and ethics are not equivalent.

                                                1. 1

                                                  For example, I might choose to publish my source code in the public domain. In the eyes of the law, it would be legal for anyone to do anything with that work without restriction, including plagiarizing it. If you argue that one should choose a license only by its effect, then you’d think this was completely reasonable since I chose to put it into the public domain and knew this could happen. But what I’m saying is that this is a fairly shallow way to interpret license usage, and that it would be completely reasonable for the publisher to be upset at someone plagiarizing their public domain work. Because laws and ethics are not equivalent.

                                                  I see where you’re coming from now, and you’re right. I am a citizen of the US. In the US, putting something into the public domain says that you can do whatever the hell you want with that code. If you copy the code and claim it’s yours, then I would think that is morally bankrupt of you to do, but you wouldn’t be violating the law.

                                                  The law is what it is, and we have to live by it, or break it and face the consequences. When I have discussions with people, my assumption is that generally speaking “we will act within the boundaries of the law” goes without saying.

                                                  I guess if you think people’s outrage is just and warranted, then that’s fine. I don’t know that I agree with you, but I also suspect that we are coming at this from two very different perspectives and I’m unsure whether it makes sense to try to have a meeting of the minds in this forum.

                                                  1. 1

                                                    I’m not advocating breaking the law. I’m not sure how I could be clearer unfortunately, and I don’t know why you think I’ve abdicated the assumption that one should generally act within the law. This is about choosing licenses and the reasons for doing so. i.e., It can be about the means as well as the ends.

                                        2. 2

                                          IMO this boils down to whether or not you think capitalism is inherently exploitative at its base or whether it can also be a force for good.

                                          As you mention later a lot of us don’t have a choice whether or not to participate in capitalism, but it is inherently exploitative. For example, you wouldn’t be forced to choose between profit or die unless you were being exploited in the first place.

                                          But you raise a really important point, which is that being able to avoid capitalism is a luxury and that’s something to keep in mind whenever we criticize people’s actions.

                                          1. 2

                                            As you mention later a lot of us don’t have a choice whether or not to participate in capitalism, but it is inherently exploitative. For example, you wouldn’t be forced to choose between profit or die unless you were being exploited in the first place.

                                            False dichotomy, every developed country has some form of social welfare for its citizens to fall back on should they absolutely need it. Even in the wacky old free-market capitalist utopia United States.

                                            1. 2

                                              False dichotomy, every developed country has some form of social welfare for its citizens to fall back on should they absolutely need it. Even in the wacky old free-market capitalist utopia United States.

                                              … Have you ever lived on welfare or other state supported benefit / plan? I have, albeit admittedly while I was still under my mother’s roof. I had MassHealth and she lived in survivor’s benefits and SSI to raise me.

                                              We got by and I never starved but please don’t put living in such a state forward as a viable alternative.

                                              For instance, with the expensive medical care I require, were I living on welfare or something like it, I might not die, but I’d likely wish for death given the hardship such a situation would impose.

                                              It’s very easy to make arguments based on theory, but living the reality is something quite different.

                                              1. 1

                                                I was responding to the grandparent’s statement that I quoted and the fact that he/she painted a false dichotomy under capitalism of “profit or die” and used social welfare systems as a counterpoint. I didn’t say every country’s social welfare systems are perfect, just that by and large, they exist and they keep a lot of people from dying.

                                              2. 0

                                                I’m not sure what you’re getting at, social welfare is not a capitalist construct.

                                                1. 1

                                                  But lack of social welfare is not a capitalist construct either.

                                            2. 2

                                              “ermissive licenses were designed to allow for commercial use of the licensed work, so having expectations to the contrary seem like a recipe for disappointment to me. Rather than being outraged, software authors should choose licenses that will do what they want and mean, and save their energy for creating more awesome software :)”

                                              That’s what I keep saying.

                                            1. 2

                                              I don’t want to bash† this project because it seems really, really cool. It’s the kind of thing I hope becomes very popular, but I have one pet peeve. I’m not part of the Rust Evangelism Strike Force, but a modern language like this should be written in a modern systems language, in my opinion.

                                              It could be Rust, it could Go, it could be Swift, it could be C#/F#, heck, even Java can be AOT compiled these days :)

                                              I’m guessing that the project is reasonably old for something announced recently (I see commits in the Github interface from 2 years ago and if I’m reading the Github commits graph correctly, the first commits seem to be from 2014), plus the author probably already knew C aaaand C is portable so it helps with Ops adoption.

                                              Anyway, this is a minor point, I hope this gets mass adoption, it’s badly needed. We need a language designed in the 21st century as the default Ops language. Powershell is a bit clunky plus adoption is a bit low so there’s plenty of room in this space.

                                              Good luck!

                                              † Pun intended.

                                              1. 3

                                                I see what you did there with bash :)

                                                Don’t have time to elaborate too much but C was chosen

                                                • as the language that I will be never be stuck with and won’t be able to solve something.
                                                • I can look how the problems I will be seeing are already solved in bash, Ruby, Python (all in C)

                                                I also pushed as much as I can into stdlib which is in NGS, hoping that if I need to change the implementation it will not be harder than it needs to be.

                                                Thanks!

                                                1. 4

                                                  I can tell you rust isn’t so hot for interpreters due to the ownership model being at odds with GC, and Go/C# ain’t so hot for low level things because of the runtime with many background threads.

                                                  1. 1

                                                    the ownership model being at odds with GC

                                                    Could you elaborate more on this? As far as I understand there are tons of ways to move the borrow checking to runtime.

                                                    1. 1

                                                      Then your interpreter takes a large performance hit, which isn’t the greatest thing. I didn’t say it is impossible, just not as great as people claim.

                                                      1. 1

                                                        Why does writing a GC in Rust mean a larger performance hit than doing it in some other language like C?

                                                        1. 1

                                                          Because you need to use runtime ownership reference counting on every mutable operation with RefCell (I think) .

                                                          1. 1

                                                            You don’t have to. You can just use raw pointers the same way you would in C.

                                                            One could argue that using unsafe operations like that defeats the purpose of using Rust, but I disagree. You can limit these unsafe operations to your gc/allocation code and vet them for safety, while the rest (bulk) can be in safe Rust.

                                                            Having written GCs in both C and Rust I prefer doing it in Rust. You don’t get much better safety but you can get better ergonomics.

                                                            1. 1

                                                              Having written GCs in both C and Rust I prefer doing it in Rust. You don’t get much better safety but you can get better ergonomics.

                                                              How do you use GC’d types from rust safely? The GC owns the value so they are usually always immutable values in rust gc’s.

                                                              1. 1

                                                                Since we’re talking about a scripting language, you would only directly access the GC’d types from Rust in the actual runtime code itself. However you don’t have to expose those values directly to any “user” code. For example, Lua uses a stack for interop instead of giving direct access (and all the mess that entails).

                                                                In Rust, you could give the user code in those cases something like a &Handle<RealType> that counts as a borrow on the stack and thus prevents destructive operations from invalidating the reference.

                                                                This gets a lot hairier if your runtime allows concurrent access, but at the end of the day anything you can do in C you can also do in unsafe Rust.

                                                                If you mean to implement a GC for Rust itself to be used seamlessly with other code, then yeah you run into the issues you’re talking about but that’s not the case here.

                                                                1. 1

                                                                  I see what you mean, I guess it may be easier to divide the objects into two areas and not use safe rust to access gc objects ever.

                                                            2. 1

                                                              runtime ownership reference counting on every mutable operation with RefCell

                                                              RefCell does not do reference counting; are you thinking of Rc? Rc is reference counting garbage collection - that’s the whole implementation, just use Rc. No extra cost over a reference counting garbage collector implemented in C. If what you want is a tracing GC, many exist: for instance, this one by withoutboats. https://github.com/withoutboats/shifgrethor

                                                              1. 1

                                                                RefCell does do reference counting, but not like you think… From the docs of RefCell:

                                                                A mutable memory location with dynamically checked borrow rules

                                                                The way they dynamically check borrow rules is by reference counting them…

                                                                As for your tracing GC reference, you could read the full readme of that GC to find more of it’s limitations.

                                                                1. 1

                                                                  RefCell does do reference counting, but not like you think… From the docs of RefCell:

                                                                  If you want to be pedantic, then sure, a RefCell does “count references”, but it does not implement a reference-counting GC pattern (the memory is freed only in accordance with normal ownership rules, as can be seen by the simple fact that it does not implement Drop (see src)) and therefore isn’t really relevant here.

                                                                  If you are unhappy with that GC you could take a look at the lustre GC which is used in a Lua VM at the moment, or at Manishearth’s gc and his blog post on it, or at this WIP gc for use with VMs, or at any of the other interesting GC projects written in Rust.

                                                                  Perhaps you are thinking of rcgc, which does use Rc reference counting to implement a garbage collector.

                                                                  I guess I’m just not sure what it is you’re trying to show here. Implementing a GC has a cost, but my point is that there is no additional cost from using Rust. Because you are implementing the component of the system that enforces memory safety, this is the appropriate place for unsafe code and therefore you will not have any mandatory performance penalty from using previously implemented abstractions.

                                                                  1. 1

                                                                    if you want to be pedantic, then sure, a RefCell does “count references”

                                                                    but my point is that there is no additional cost from using Rust.

                                                                    This is a direct contradiction… Let me put it this way, in rust who owns a GC ref? to use a GC ref in a mutable way you need to use something like RefCell which has a runtime cost. You don’t need that in C. That is all that I am saying…

                                                                    1. 1

                                                                      You don’t have to use RefCell, so it doesn’t matter what RefCell costs. If you were to implement a RefCell-like counter for mutable vs immutable references, you couldn’t do much better than RefCell, but if you don’t need that functionality you can just forgo it and use raw pointers, just like in C.

                                                    2. 2

                                                      What would be your ideas for modern ops language? Here are mine:

                                                      • Steal the sh pipe syntax (Python, Ruby, TCL, Lua fail here)
                                                      • More data types than string (bash, zsh fail here)

                                                      Powershell would qualify. Is there anything really wrong with it except it looks verbose?

                                                      1. 2

                                                        Powershell would mostly qualify but it needs higher adoption and in my opinion it needs to be a truly Open Source project, preferably a foundation. Microsoft might decide to add stuff that is detrimental to it, overall, just to further business interests.

                                                        It also needs to start popping up in distribution repos. You should be able to just apt install pwsh and yum install pwsh, from the default repos of most Linux distributions.

                                                    1. 18

                                                      The original WebKit blog post is worth reading: https://webkit.org/blog/8821/link-click-analytics-and-privacy/

                                                      Disabling ping does not make your browser more private. It just spurs websites to switch to methods that are less user-friendly but more reliable (and undetectable by the UA).

                                                      Arguably UAs could disable ping but make it undetectable by JavaScript. My hunch though is that websites would just UA-sniff that particular browser and always do the user-unfriendly method, which would be much worse because then that browser would be guaranteed a worse experience, permanently. Then users would complain that it’s “slow” and switch to the “fast” browser.

                                                      In short, there are lots of different considerations that a browser needs to weigh when making a decision like this, and there are no easy answers. Browsers and websites are caught in an eternal cat-and-mouse game over things like privacy and performance.

                                                      1. 4

                                                        Why not let publishers that are unfriendly to users privacy deliver bad user experiences? I don’t think a browser that cares about privacy should be providing features to let bad actors be bad actors more efficiently. Let them destroy UX and reap the consequences, however minor. This strikes me as giving up and sweeping the problem under the rug.

                                                        The market share preserving argument doesn’t hold because if in order to retain market share you have to do the same stuff that browsers that don’t respect privacy do, well then you’ve joined the race to the bottom.

                                                        1. 3

                                                          From a game theoretic analysis here, the current situation of using redirects is a Nash equilibrium: https://en.wikipedia.org/wiki/Nash_equilibrium

                                                              sites  ping |  redirect
                                                          browsers        |
                                                          ----------------|----------
                                                          ping       1 2  |  0 1
                                                          ----------------|-----------
                                                          no ping    2 0  |  0 1
                                                          

                                                          The browser/user benefits most from the bottom left corner; however if they chose the “no ping” strategy then the sites are incentivized to switch strategies to redirects, which improves their payoff but gives the worst payoff to the users. The sites’ best payoff is the top left corner; the ping is faster and gets them the data they want, however the user would prefer to have their privacy preserved by turning off pings.

                                                          Having the browsers implement pings is an attempt to avoid a prisoners’ dilemma-type situation where everyone is worse off (the bottom right quadrant); anticipating the responses to your own moves is just playing smart.

                                                      1. 2

                                                        I’ve been trying to get a working wayland setup (to be able to mix different DPI displays), so far sway is the most stable and well behaved component. Unfortunately a lot of apps either don’t support wayland natively or misbehave, and even though you can get things to run with xwayland they won’t look nice on hidpi displays.

                                                        Also, --my-next-gpu-wont-be-nvidia as a command line option is quite funny.

                                                        1. 2

                                                          (1) The memory sizes are some fixed numbers. E.g, 32, 64, 128, etc, not random;

                                                          I had a hard time parse this line. What does “fixed numbers” even mean? Does it mean the numbers have to be compile time constants?

                                                          1. 2

                                                            Sorry for my poor English. Because I use memory size as the key of the hashtable, and the key space of hashtable will affect performance. If user only uses some “fixed” size memory, it will have a better performance. Otherwise, the performance may be downgraded. For example, I use CUDA to do some mathematical computation, and only allocate memory in some size: 8K, 16K, the performance gets a remarkable improvement compared using the original CUDAMalloc* APIs, thanks!

                                                            1. 2

                                                              I still don’t understand what you are saying.

                                                              What is a ’“fixed” size memory?

                                                              Some magic numbers picked by tuning performance? Do I need compile time known constants? Can I give a number at runtime?

                                                              I guess you actually want to do a page aligned allocation. Is this what you are saying?

                                                              1. 2

                                                                What “fixed” size means in this case is that you expect to have many allocations/frees of the same size, i.e., you are allocating and freeing many objects of the same size throughout execution of the program.

                                                                And you very likely do not want to page-align ever allocation of, say, 100 bytes. It would be very inefficient if every allocation of 100 bytes was on a different 4K page.

                                                                1. 1

                                                                  Yes, it should be “arbitrary”. Sorry for my poor English.

                                                                  1. 1

                                                                    I update README, hope this can make clear. But sorry again for my poor English.

                                                                  2. 1

                                                                    I think “arbitrary” is what you mean rather than “random”.

                                                                1. 21

                                                                  I hope to see more of this — if workers with as much leverage as we have don’t speak up against technology we create being used for evil, we can’t call ourselves engineers.

                                                                  1. 13

                                                                    Relying on morality when incentives go the other way does not scale.

                                                                    1. 6

                                                                      Exactly. It has to be a large number of people that damage their mission directly or indirectly with media pressure. Otherwise, it’s something with no impact. At least people are following their principles, though.

                                                                      1. 6

                                                                        It has to be a large number of people that damage their mission directly or indirectly with media pressure.

                                                                        Can you trust an engineering company who ignores the opinions of its engineers?

                                                                        We are talking about one of the most celebrated company of western economy, often cited as an example of excellence.

                                                                        Leaving Google for ethical concerns poses a serious burden on the employment of these engineers that will probably be marked as dangerous employees for the time being.

                                                                        We can assume that this is something they knew, as Google don’t hire dumb guys.

                                                                        So why they quit?

                                                                        My bet is that the militar use of the Google’s artificial intelligence technology is so dangerous that these engineers felt obliged to leave the organization beyond any doubt.

                                                                        Otherwise, it’s something with no impact.

                                                                        Well, it’s a first step.

                                                                        And a courageous one.

                                                                        Its impact goes beyond the worldwide image of Google, beyond the direct issues in their production line.

                                                                        It is an example.

                                                                        1. 4

                                                                          Can you trust an engineering company who ignores the opinions of its engineers?

                                                                          It doesn’t matter. What matters here is (a) the companies’ goals/incentives, (b) how successful they are at achieving them, and (c) if a tiny number of engineers quitting changes that. Note that (b) includes implicit support by the many people who use their products and services voting with their wallet. The stuff in (a) means they’re anywhere from apathetic to damaging for a lot of ethical issues around privacy and making money. Due to (b), actions to damage them have to put a huge dent in that or make them think it will. (c) doesn’t do that. So, (c) is probably irrelevant to Google. The article itself says as much:

                                                                          “However, the mounting pressure from employees seems to have done little to sway Google’s decision—the company has defended its work on Maven and is thought to be one of the lead contenders for another major Pentagon cloud computing contract, the Joint Enterprise Defense Infrastructure, better known as JEDI, that is currently up for bids.”

                                                                          I gave them credit in my other comment for standing up on their principles. That’s respectable. It’s just that a “dozen” or so people quitting a company with over 70,000 employees with people waiting to fill their positions doesn’t usually change anything. They’d instead have to campaign in media or government aimed at stopping those contracts or drone operations. At least half the voting public and current President support military action overseas. The other half didn’t convince their prior President to stop drone use or strikes. There are also not large swaths of Google customers threatening to stop using Google Search, Gmail, etc if Google doesn’t turn down government contracts.

                                                                          So, quitting over this is pointless if the goal is to achieve something. At best, it’s a personal decision by those individuals to not be involved in something they disagree with that’s going to happen anyway. That’s fine but practically a separate thing from ending these contracts. If anything, we’ll just get a shift in Google employees from those who might leave over the contracts to people who range from favoring them or just griping about them continuing to work there. I think most will be in latter category.

                                                                          1. 2

                                                                            It’s just that a “dozen” or so people quitting a company with over 70,000 employees with people waiting to fill their positions doesn’t usually change anything.

                                                                            The fact is that fewer talented people will want to fill their position.
                                                                            This is a pretty serious issue, if engineers are the core resource of your company.

                                                                            Now, I’d guess most Google engineers don’t feel as important to the company as they feel the company is important to them. This happens in many companies, and I would guess Google has turned this kind of internal narrative into an art.

                                                                            The fact is that, instead, Google literally would not exists without those engineers.

                                                                            These few have shown exactly that: that working in Google is not that important.
                                                                            It’s a matter of time, but if Google do not take serious actions to avoid this general wake up, other engineers will follow. And the same might happen in Facebook, in Apple and in many other smaller IT companies.

                                                                            On the other hand, in Europe and everywhere else, people will start to ask why engineers from a company that operate in their territories, are so afraid for what the company is doing, to quit. To avoid the risk of being associated with the company future. To avoid sharing its responsibility.
                                                                            Politicians will be less friendly to a company that might be doing something really evil for a foreign state.

                                                                            I agree that more engineers should follow their example, but I know that life is not that easy.
                                                                            However people continuing to work there might organize to keep the company “on track”, and this might lead to the creation of a labor union.

                                                                            1. 4

                                                                              The fact is that fewer talented people will want to fill their position.

                                                                              You have to prove that assumption. Google changed their Don’t Be Evil motto doing sneakier and sneakier stuff overtime. They’re a surveillance company that hires brilliant people to do interesting work for high pay and good perks. They’ve had no trouble that I’ve seen keeping new people coming in. Status quo has the evidence going against your claim: it’s a shady, rich company with in-demand jobs whose shady activities haven’t changed that for years. There’s also nearly 70,000 workers mostly in favor of it with more trying to get in.

                                                                              “However people continuing to work there might organize to keep the company “on track”, and this might lead to the creation of a labor union.”

                                                                              That’s a different issue entirely. Given I am in a union, I think it would be cool to see it happen. Unlike OP topic, that could happen with higher probability. Silicon Valley will do everything they can to stamp it out in mean time, though. Still a long shot.

                                                                              1. 0

                                                                                The fact is that fewer talented people will want to fill their position.

                                                                                You have to prove that assumption.

                                                                                Not an assumption, but a deduction: people avoid cognitive dissonance, if possible.

                                                                                A dozen people leaving a company cause of ethics, means that such company forced them too high on cognitive dissonance, and this will make Google relatively less attractive, in comparison to the alternatives: a talented engineer want to fix problems, not fool herself to avoid the pain of contradictions.

                                                                                Our brain consume around 20% of our energy, after all.

                                                                                This is the same reason that make me guess others will quit Google in the future.
                                                                                Because now they have a new thinkable precedent.
                                                                                A new, effective solution to reduce their cognitive dissonance.

                                                                      2. 2

                                                                        I agree. But we also can’t rely on companies that we don’t own to incentivize us to act in a moral fashion – engineers need a governing body for that.

                                                                        1. 1

                                                                          What about entering both US political parties and changing the policy? If you believe that killing people is wrong, maybe make it a law?

                                                                          Sometimes the only way to advance your field is to step out of it and fix the external systems. And war zones are definitely not a good environment in which to build global information network to advance everyone’s wellbeing…

                                                                        2. 1

                                                                          I think it’s definitely a factor. Many prominent business people would not like to be associated with payday loan companies, for example.

                                                                          I think this is less about being the silver bullet for problems, and more about being one of the 20 or 30 things we need to be doing to make the world A Better Place(TM)

                                                                        3. 13

                                                                          We can’t even speak up for honest pay for an honest day’s work–and that’s a lot less subjective than some arbitrary definition of “evil”.

                                                                          1. 4

                                                                            Why not both?

                                                                            1. 4

                                                                              At least the “evil” one is super cloudy.

                                                                              Say you are an engineer working at a company that builds control software for missiles. You are a pacifist, and so you decide to introduce a minor bug (or fail to patch a discovered bug) that causes the missile to not detonate when it lands.

                                                                              • Are you good for not facilitating the loss of life?
                                                                              • Are you evil for misleading your employer about the labor of yours that they’ve purchased?
                                                                              • If the missile lands on a poor grunt and severs their legs causing them to bleed out over minutes instead of detonating properly and just kinda instantly killing them, are you evil for prolonging suffering?

                                                                              That’s just scratching the surface of morality in engineering.

                                                                              1. 6

                                                                                That’s fair – and I should’ve been explicit earlier. I believe that there are (at least) two moral guidelines that should be taken into account.

                                                                                The first is a professional code of ethics, similar to what ACM has here. Of course even this is cloudy – for example, in my opinion 1.2 “Avoid harm to others” would necessarily preclude working for a missile manufacturer in the first place. At the very least, if one views missiles and missile software as being a necessary “evil”, safeguards should be put in to protect human life at all cost, etc. etc. The minutiae of the professional code of ethics can and should be rigorously debated, because it provides a minimally viable base for how we should conduct ourselves. So for example, the question of whether or not working in the weapons manufacturing industry truly violates rule 1.2 should be an explicit discussion that is had in a professional organization (not a workplace per se).

                                                                                The second guideline is in line with your own personal moral code. This is important because it provides for people who are religious (or not) or any other number of cultural influences that have caused a person to believe what they believe today. This, of course, has to be superseded by the professional code – for example, if I personally believe that discrimination based on what TV shows you enjoy is okay, that doesn’t mean that my personal morality should define what happens in a professional setting. But in the hypothetical case you provided, even if I don’t feel that writing that software goes against a professional code of ethics, if I am a pacifist, it goes against my personal code. I know from the professional code that purposefully writing bad or buggy software is wrong, and so my only option is to find another job in which both my personal and professional codes of ethics can be upheld.

                                                                                1. 9

                                                                                  Why discuss an unlikely hypothetical rather than the issue at hand? Why the need to logically define evil beyond any confusion? This is not even possible in the general case for anything. Can you logically define ‘fun’ such that everyone agrees? At the end of day, evil means what people talking about it think it means, and it’s better to work off of that than to halt all discussion until we achieve the impossible task of absolutely grounding natural language in logic.

                                                                                  1. 6

                                                                                    It’s precisely because evil is so ill-defined that talking about it is difficult. As @mordae points out, it’s more effective to talk about other incentives.

                                                                                    And again, I’m not saying “halt all discussion”–quite the opposite! I’m saying that the issue is more nuanced than “don’t be evil”.

                                                                                    1. 1

                                                                                      I certainly agree with that. I still think it’s worth going into, because at a certain point you’re likely to end up doing it anyway. For instance, if we start talking about incentives, we might end up talking about how to incentivize people towards good, or at least, some concept of “not evil”. I’m not saying it trumps incentives or that this is a more effective approach, I’m just saying we should still have the discussion.

                                                                                      I think a trap we as engineers often fall into is to attempt to build everything up from laws and axioms. That doesn’t quite work for morality, and the nebulous nature of it means it rarely gets discussed. The software industry in particular is very focused on “solving problems” and never asks questions like “should we solve this problem?”

                                                                                      I guess another scary thing about it is that we can’t really empirically verify what the right answer is, and depending on the issue we might even have multiple valid answers. But sometimes just asking the question is worthwhile, even if we don’t have an answer.

                                                                                      Perhaps tech companies should start hiring philosophers.

                                                                                      1. 2

                                                                                        Perhaps tech companies should start hiring philosophers.

                                                                                        I’d argue that a good programmer is a philosopher almost by definition.

                                                                                        We talk like if our field was an engineering field but most of times we don’t build things constrained by the physical world (yeah I know what latency is… I said most of times :-D).

                                                                                        Or we talk like if our field was just applied math, pure and intangible, but then we talk about usability or we kill someone through a self driving car.

                                                                                        But ultimately we work with ideas.

                                                                                        The choice to ignore the ethics of our work is up to us.

                                                                                        But we have much more instruments to think about our role in the world than any “professional philosopher” hired to think for us (in the interest of the company).

                                                                                        1. 1

                                                                                          if we start talking about incentives, we might end up talking about how to incentivize people towards good, or at least, some concept of “not evil”.

                                                                                          That’s how you do it. In Google’s case, a publicly-traded company, that means you have to hit them in the wallet in a way that knocks out the contract. Alternatively, convince their management to change their charter or use other legal means to block whole classes of action in the present and future that they agreed were evil. I’m not sure if that would even work in Google’s case but one can start businesses like that in nonprofit or public benefit form.

                                                                                      2. 1

                                                                                        I think friendlysock was trying to illustrate the point with some examples. The comment succeeded given the other person understood the points. There’s nothing wrong with that. You said to instead work off claims about evil in this situation based on what people are saying. In this case, what does evil mean exactly to both those employees and various stakeholders in the United States? Based on the political debates, I know there’s quite a few different views on whether these programs are evil or not. Even within the main, political parties, in Silicon Valley, and in Google itself.

                                                                                        The only thing sure is that about 4,000 of Google’s 70,000 people plus some other folks writing a letter don’t like what Google is doing. Of the 4,000, only a dozen or so showed it’s worth not working for Google. So, that’s under under 1% of Google’s workforce. The others are continuing to support Google’s success, including that program indirectly, while protesting that program. They may or may not leave but I think most will stay: workers gripe more than they take action in general case, esp if employer’s actions is morally a mix to them or six digits are involved. If they leave, there’s a lot of people willing to take their place with no long term effect on Google. The remainder and some new hires collectively are apathetic to this or believe it’s morally acceptable.

                                                                                        Many of the people staying would probably tell you they’re decent people with Google doing a lot of good for the world (arguably true) despite this evil. We saw this in NeverAgain pledge. Others would tell you this kind of thing is inevitable enough that Google not doing it would make no difference. Some of them would even say it’s better if they do it so they can do it right minimizing harm. Yet another group will claim these programs prevent a larger number of deaths than they cause or prevent real damage vs hypothetical risks detractors talk about. People ranging from those developing software to those doing drone strikes might believe they’re saving lives in their work while the dozen that quit will be doing less valuable work in tech for their own benefit.

                                                                                        I don’t think there’s a clear answer of evil if I’m looking at the stakeholders in this discussion. They’re all over the place with it. The acting public is in a few camps: those doing a mix of opposing and tolerating drone operations who lost the election; those mostly supporting them whose party is in control; billions of dollars worth of users and businesses who don’t care enough to switch providers; tiny, tiny, tiny slice of revenue from those that will. Put in that light, nothing they’re doing will matter past their own conscience. Hell, those thinking the tech is evil might have been better off staying in there half-assing the programming on purpose to make it look like such tech just isn’t ready to replace people yet. There’s precedents for that with many of them in defense industry except for profit rather than moral reasons.

                                                                              1. 12

                                                                                What’s the best way to use Mastodon? I appreciate its dedication to privacy, but the distributed nature of Mastodon confuses me. I feel like it’s the World of Warcraft server problem, where it’s impossible to find a server with all your friends on it without one server having everyone on it.

                                                                                1. 11

                                                                                  You don’t have to be on the same server, you can follow accounts from other instances.

                                                                                  1. 10

                                                                                    Many of us in the BSD world went with https://bsd.network/.

                                                                                    You might try the instances.social finder: https://instances.social/.

                                                                                    One of the things I like about Mastodon is I can join a server (or servers) that are more closely aligned to my interests. By monitoring the instance timeline I see all the posts. I don’t have to find a bunch of people to follow immediately. I can grow the list by following the folks I notice posting things I enjoy reading.

                                                                                    1. 2

                                                                                      What network do Haskellers use?

                                                                                      1. 4
                                                                                      2. 1

                                                                                        Yeah that’s one of the things I really dig about it. It’s a metacommunity. You find an instance that focuses on your interests, or create one of your own if that’s what floats your boat, and it becomes a microcosm unto itself, but you all still share the global timeline.

                                                                                      3. 6

                                                                                        Replace instance with server and mastodon with e-mail. Then all these explanations become less confusing. Unless your server’s admin or your peer’s admin blocks your messages, you can write messages to every peer on every other server as you see fit.

                                                                                        Does that make sense to you?

                                                                                        1. 4

                                                                                          You don’t need to find a server with everyone in it since federation allows you to follow people on other servers. I do recommend to simply find a community you enjoy and use that as home-base.

                                                                                          1. 1

                                                                                            With sites like joinmastodon.org or instances.social, I haven’t experienced this to be too much of a problem. Yes, it takes a while, but you can always delete an account and create a new one on another instance.

                                                                                            To me, the real problem seems to be the difficulty to find interesting accounts to follow, and create a informative, fun and interesting stream. There are a lot of inactive accounts, regardless of the server (mine is one of these), and some active ones, but I can’t really re-create the same level of experience as on twitter, reddit or image boards, for example, even though I have stopped using all of these by now.

                                                                                          1. 8

                                                                                            Still in the midst of reading this, but just have to say: worst website background ever

                                                                                            1. 4

                                                                                              Firefox’s reader mode is a lifesaver here.

                                                                                              1. 2

                                                                                                Yes, I had to use that too. I tried to read it the way it was displayed but it was too distracting

                                                                                              2. 2

                                                                                                I removed the background and background color via inspector which makes it a lot easier to read.

                                                                                                1. 1

                                                                                                  I’ve done enough accessibility work on the web to announce: this site’s contrast is great, but its presentation is horrific.

                                                                                                1. 6

                                                                                                  This video is what I use when countering the myths about how C was designed. It goes to the papers and constraints that led Richards’ team to chop ALOL into BCPL. Then, the modifications from BCPL to B to C. Understanding the context of why C was the way it was might help folks understand why we should upgrade given we’re no longer in those constraints either in hardware or programming features.

                                                                                                  1. 10

                                                                                                    I think there is a reasonable argument that C won on its merits. The following is a list of some languages that were available in 1975 and my opinion of why they lost out to C. C is pretty much the only language on this list with a portable implementation that ran on minicomputers.

                                                                                                    Algol 60 - call by name is expensive, not really intended for system software

                                                                                                    Algol 68 - complex to implement, standard uses an obscure formal semantics, requires a runtime, compilers did not emerge for years

                                                                                                    Algol W - first implementation was for IBM mainframes in an infix assembly language, few other implementations

                                                                                                    BCPL - untyped, inferior to C in some ways, limited support for byte addressing

                                                                                                    BLISS - semantics for assignment are unusual, untyped, no portable compiler, only for DEC architectures

                                                                                                    Coral66 - British military standard, may not have had recursion

                                                                                                    Fortran 66 - not really suited to system software, although a number of vendors wrote operating systems in an extended Fortran

                                                                                                    Forth - different programming model, mostly interpreted

                                                                                                    IMP72 - implemented mostly on supercomputers, low level of abstraction (Fortran II), complex (extensible) grammar

                                                                                                    Jovial73 - DoD standard, no standard IO

                                                                                                    LRLtran - no implementations for minicomputers

                                                                                                    MAD - low level of abstraction, implementations ran on mainframes

                                                                                                    NELIAC - low level of abstraction

                                                                                                    Pascal - weak standard, no separate compilation, Wirth moved on to new languages

                                                                                                    PL.8 - internal to IBM, compiler ran on mainframes

                                                                                                    PL/I - complicated to implement, early implementations were slow

                                                                                                    PL/S - internal to IBM, compiler ran on mainframes

                                                                                                    RTL/2 - British language for realtime systems, probably unknown in the US.

                                                                                                    Simula 67 - uses garbage collection, inventors wanted license fees

                                                                                                    1. 2

                                                                                                      Great list. Remember that there’s two parts to this: one is how they designed it; one is what happened later. Your list seems to be what happened later after comparing its design to everything else unmodified. Whereas, mine says they’d have cherry-picked the best of anything on that list modifying it for their situation. In each case, they’d pick whatever was safest or cleanest by default switching to unsafe only where necessary. As hardware improved, the safety and maintainability would improve.

                                                                                                      That’s the approach Wirth took with Modula-2 and the rest of his languages. Most others did as well doing languages for safety or programming in the large. It’s now the standard way to do things with many citing an escape from the safety and maintainability problems of C. So, the evidence leans toward Wirth’s choice.

                                                                                                    2. 1

                                                                                                      If I wanted to both re-write indent(1) in not-C and continue to distribute it as a part of FreeBSD, NetBSD, OpenBSD - which programming language should I “upgrade” to? What choice do I have?

                                                                                                      1. 2

                                                                                                        My top choices for contenders would be rust, zig, myrddin and nim. zig being the closest to C with many fixes.

                                                                                                        1. 4

                                                                                                          One issue with rust currently is that building the compiler will dominate compile times until most of the distribution is ported to rust.

                                                                                                          1. 3

                                                                                                            What about Wirth’s new Oberon-07?

                                                                                                            Recently it has got a new promising little compiler to C, OBNC.

                                                                                                            1. 2

                                                                                                              Hadn’t seen that, will check it out.

                                                                                                              1. 1

                                                                                                                I’d really appreciate your opinion, since you cited Myrddin, which is my favourite contender for the package system of Jehanne.

                                                                                                                I do not really know any of the two (I used Pascal years ago.. but Oberon seem better).

                                                                                                                But of all the C alternatives I could decide to integrate in Jehanne (the way Perl was integrated in Unix) these seem the best two candidates for their balance between simplicity and practicality.

                                                                                                                Wirth’s Oberon win on simplicity, but Obi’s Myrddin win on practicality (according to my shallow understanding so far… take this with a grain of salt!)

                                                                                                                1. 2

                                                                                                                  FWIW, Myrddin is probably going to be the easiest to port to Jehanne, since it already runs on Plan 9, and has a very small system abstraction layer.

                                                                                                                  1. 1

                                                                                                                    Hi Orib! Yes, you are right! Myrddin is the most practical choice for Jehanne.

                                                                                                                    Also it provides language features I like, such as ADT and pattern matching, and it already has a practical standard library.
                                                                                                                    But honestly I haven’t had the time to try your hints: I saved them from my irc log, but… really I didn’t had the time… :-(

                                                                                                                    Nevertheless I’m also rather fashinated by Oberon-07: Wirth keeps cleaning it, removing redundant features. I know this add pressure to the library and applicative code, but…

                                                                                                                    I think you can see the affinity with my strive for simplicity in Jehanne.

                                                                                                            2. 4

                                                                                                              All of those fall over on portability. Rust is amd64 and i386 only, myrddin is amd64 only, and building the zig compiler requires llvm. nim has the best story with amd64, i386, ppc and arm, which still isn’t enough.

                                                                                                              1. 1

                                                                                                                I think you are wrong about rust, there have been plenty of posts of embedded arm and other processors targetted by rust. LLVM has lots of targets and can compile itself, so it is relatively portable, though extremely complex.

                                                                                                                1. 3

                                                                                                                  Is rust on other architectures done natively or by cross-compiling? I don’t know about the others but OpenBSD requires that the base install can build itself on every architecture.

                                                                                                                  1. 1

                                                                                                                    https://forge.rust-lang.org/platform-support.html - it seems like rustc can run on at least 5-6 architectures. and the groundwork is there for more.

                                                                                                                    Zig itself has two stdlibs, one is based on libc so I bet that it could run on more platforms.

                                                                                                                    1. 6

                                                                                                                      He is right, the only platforms at the moment able to self-build rust are amd64 & i386. OpenBSD requires much more. You participated in a previous thread so you know that rust in the base system is not likely to happen. Hence rust is not the answer to:

                                                                                                                      If I wanted to both re-write indent(1) in not-C and continue to distribute it as a part of FreeBSD, NetBSD, OpenBSD - which programming language should I “upgrade” to? What choice do I have?

                                                                                                                      With the current status quo, the only language fitting the above question I believe is Perl.

                                                                                                                      1. 2

                                                                                                                        https://github.com/Microsoft/checkedc seems to be one of the more practical approaches to upgrading C, though obviously not ready.

                                                                                                            3. 2

                                                                                                              Maybe Vala. It compiles to C but has dependency on GObject.

                                                                                                              1. 2

                                                                                                                The answer is C++. Every architecture that OpenBSD currently supports has a C++ compiler in base (well actually compXX.tgz). I’d imagine the answer is similar for FreeBSD and NetBSD. You may be able to get away with C++11 on the popular architectures but I think the less popular ones you’re stuck with C++03 or even C++98.

                                                                                                                1. 1

                                                                                                                  The general choice is anything that compiles to C. If they’re picky about coding standards, what you would have then is a cultural argument instead of one on language capabilities. They wouldn’t allow something better. Then, you might be forced to do what folks like Per Brinch Hansen did back when hardware couldn’t run ALGOL: write in one language you can’t share for its benefits with a second version done against that in language you can share. To automate that, I recommended a while back someone make a safe, clean, superset language that’s compatible with C plus exports to readable code in that language. Throw in real macros and REPL for an extra reason to use it.

                                                                                                                  Then, we don’t have a CVSup-style situation where author uses a safe, maintainable, high-level language for its benefits but people eventually rewrite that stuff in C anyway.

                                                                                                              1. 10

                                                                                                                Huh. I didn’t realize Java is going the Firefox/Chrome model of releases.

                                                                                                                Overall if you have good unit tests in your software, this shouldn’t be a big deal. Update to Java x, run sbt test or gradel test or whatever, update your test-running CI container to java x, let it run there, update your production Dockerfiles to java x, deploy and check your integration tests.

                                                                                                                Oh you don’t have a lot of unit tests? .. wait, you don’t have any unit tests?! … Well it will probably just work .. have fun!

                                                                                                                1. 6

                                                                                                                  I don’t think it’s that straightforward for everyone. It’s hard to measure the performance impact of changes to the JVM, as well as potential obscure bugs, from just unit testing. I think most big deployments and libraries will stick to LTS releases as a result, which isn’t that bad given it’s about the old pace of updates anyway.

                                                                                                                  1. 6

                                                                                                                    To support this point, for a specific example of a more obscure change in a JDK that caused programs to fail, see http://www.oracle.com/technetwork/java/javase/8u20-relnotes-2257729.html - it’s a long list but note this

                                                                                                                    Collection.sort defers now defers to List.sort

                                                                                                                    Previously Collection.sort copied the elements of the list to sort into an array, sorted that array, then updated list, in place, with those elements in the array, and the default method List.sort deferred to Collection.sort. This was a non-optimal arrangement.

                                                                                                                    The consequence of changing to sorting in place (the optimal arrangement), is that programs which sorted in one thread and concurrently iterated in another are more likely to crash with this JVM than previously. Might be hard to test for that even in an integration test!

                                                                                                                    Unit testing is dangerous because it gives inexperienced coders false confidence that changes are good.

                                                                                                                  2. 2

                                                                                                                    Huh. I didn’t realize Java is going the Firefox/Chrome model of releases.

                                                                                                                    Well, at least Firefox has train releases + a long term release. Java doesn’t seem to have that.

                                                                                                                    1. 11

                                                                                                                      Didn’t the article mention Java 8 being a long term release?

                                                                                                                      1. 13

                                                                                                                        Yes, Java has LTS releases, currently 8 and then 11. http://www.oracle.com/technetwork/java/eol-135779.html

                                                                                                                        1. 4

                                                                                                                          Ah, sorry, I had missed the precise scheme. I thought 8 was LTS, as it was the last “old-fashioned” release.

                                                                                                                          1. 1

                                                                                                                            Note that Red Hat will support OpenJDK 8 after Oracle discontinues their support as they have with previous releases in the past; they commit to it up to October 2020: https://access.redhat.com/articles/1299013

                                                                                                                      1. 10

                                                                                                                        Interesting perspective, although the author seems to be dismissive of other people’s experiences. Having had a supportive environment from day 1, she then makes an appeal for people to stop being supportive to others who may not have had the same environment? And this based on the claim that some attempts at support are harmful, but how that’s harmful is not explained.

                                                                                                                        Also, “it’s not a problem in South India so it shouldn’t be a problem elsewhere” is not a very compelling argument. It seems he author has had a largely positive experience free of discrimination, and doesn’t understand people who have experienced bias. At the very end is an appeal to some kind of gender-blindness. Unfortunately that only works in environments that are already free of bias. In a biased environment, being blind to differences will lead to ignoring the existing bias.

                                                                                                                        Perhaps I would understand the author better if the points were more fleshed out, but as it is there are glaring gaps in this analysis.

                                                                                                                        1. 8

                                                                                                                          Maybe walking up to someone and saying “Oh I really wanted to listen in, because you are the only woman here” is sexist no matter what culture you’re from.

                                                                                                                          1. 2

                                                                                                                            I can definitely appreciate the argument that anti-intellectualism in America breeds the kind of high-school cheerleader/quarterback gender stereotypes that come back to bite all adults in their professional lives. (edit: grammar)

                                                                                                                            1. 1

                                                                                                                              I read this as another “here is my personal experience” post. It’s a nice reminder that as more effort is made to bring under-represented groups into the field we also need to be careful not to set lower expectations on those individuals as engineers or treat them differently than we would any other engineer. Things can be done with events and organizations in terms of pipeline and making sure groups are represented, but those individuals probably don’t want to be picked to speak or have an audience simply because of the color of their skin or their gender.

                                                                                                                              It’s a difficult balance to achieve, but that doesn’t make it any less worthwhile. This is a problem about people, so the only way to move forward is by understanding the people affected (and everyone else in the equation for that matter) to the furthest extent possible.

                                                                                                                              Edit: typo

                                                                                                                            1. 13

                                                                                                                              Finally! This article is about desktop, but OpenSSH is coming to all of Windows, including IoT Core where I work. I’ve been championing the upgrade for years now. Compared to our old SSH implementation, OpenSSH is more stable, supports newer encryption standards, and can send files over sftp.

                                                                                                                              Very excited to see this land. Kudos to the Powershell team for putting in most of the porting work, and of course to OpenBSD for developing OpenSSH in the first place.

                                                                                                                              1. 5

                                                                                                                                Last time I tried anything microsofty in that sort of realm I started throwing things at the screen. (Can’t remember what it was telnet maybe? Their built in “term” thing?)

                                                                                                                                It obstinately refused to resize, and got the wrapping horribly wrong and clearly had been written by somebody who had an ideological hatred of the command line.

                                                                                                                                Downloaded putty and…. Oh My! It all just worked and worked correctly!

                                                                                                                                So merely having a ssh client will not cause me to shift from putty, having a ssh client that works properly and slickly might convince me.

                                                                                                                                1. 7

                                                                                                                                  Well, for IoT Core I’m more excited about the OpenSSH server than the client. I’ve been connecting to it with PuTTY.

                                                                                                                                  That said, the Windows command-line has vastly improved from 8.1 to 10. The biggest improvement is that text reflows as you resize the window. Copy/paste was also improved.

                                                                                                                                  Telnet and SSH are just transports. I bet your frustration was due to the old Windows conhost.exe being a terrible terminal.

                                                                                                                                  1. 2

                                                                                                                                    When you connect to IoT Core via SSH what shell are you dropped in to?

                                                                                                                                    1. 1

                                                                                                                                      Just plain old CMD. Usually Powershell is present too, but OEMs can choose to build an image without Powershell.

                                                                                                                                      If you want to connect directly to a Powershell session, it has its own remote shell feature, enter-pssession.

                                                                                                                                      1. 1

                                                                                                                                        There’s a more detailed answer by Joey Aiello in the HN thread.

                                                                                                                                    2. 3

                                                                                                                                      Their built in “term” thing?

                                                                                                                                      AFAIK some projects such as the Git command line utilities for Windows have for years now shipped with a TTY which is based on PuTTY’s TTY (just not using any of the SSH code or anything) and it’s much nicer.

                                                                                                                                      1. 2

                                                                                                                                        ConEmu is another tool that will improve your commandline life on Windows. As for Microsoft products, there are many people who swear by Powershell!

                                                                                                                                        1. 2

                                                                                                                                          Powershell is a nice shell, but it lives inside the same terminal (conhost.exe) that CMD does.

                                                                                                                                          1. 1

                                                                                                                                            Cmder is a great shell built on top of ConEmu that even has support for the quake-style appear/disappear animation.

                                                                                                                                        2. 2

                                                                                                                                          Try cmder for a decent terminal. The git version comes with a bunch of tools (including ssh, ls, etc) and provides a terminal experience on Windows that won’t make you throw things at the screen (hopefully!).

                                                                                                                                        3. 1

                                                                                                                                          That’s pretty impressive. OpenSSH makes a lot of POSIX assumptions about things like PTYs and fork.

                                                                                                                                        1. 52

                                                                                                                                          Just as important as Firefox being a distinct product is that it uses its own rendering engine. There are only three major browser rendering engines: Trident/WhateverTheyCallTheEdgeEngine (Microsoft), WebKit/Blink (Chrome, Chromium, Safari, Opera, most one-off browsers like Web in GNOME, WebPositive on Haiku, etc), and Gecko/Servo (Firefox).

                                                                                                                                          It’s not enough to have a million different browsers if they’re all using the same rendering engine. We need variety in implementations on that front too…

                                                                                                                                          1. 11

                                                                                                                                            Very good point; I spoke of this issue with a colleague a couple of weeks ago, and I asked: “what happens if Microsoft decides to get out of the web browser market and Mozilla collapses?” Then, for all intents and purposes, Google would literally control the web. Now, I don’t know how likely it is that Microsoft would stop its Edge effort or that Mozilla would go under—probably not very likely in the short term. Still, it seems to me that the complexity of the modern web (HTML 5, CSS, JavaScript with a state-of-the-art JIT compiler, DRM, etc.) makes it unlikely that we’ll see another web engine—much less a free web engine—that can compete with the current trio, and practically impossible to see enough new web engines to actually create competition.

                                                                                                                                            1. 7

                                                                                                                                              Agreed, the only way you web standards can realistically be called standards is if there’s a variety of implementations, and a variety of vendors with enough influence to shape those standards.

                                                                                                                                              1. 5

                                                                                                                                                EdgeHTML. No really, that’s the name of the rendering engine. Microsoft continues to amaze with their horrendous naming :)

                                                                                                                                                1. 9

                                                                                                                                                  Could be worse. Could be EdgeTML.

                                                                                                                                                  1. 1

                                                                                                                                                    Older versions of IE could be called “FML”, which is exactly how you feel when tracking those IE only bugs.

                                                                                                                                              1. 2

                                                                                                                                                silly question. what does this give you? all the actions in the gifs are already fully realized by the time that something happens. By the time it shows you something visual the action is fully completed.

                                                                                                                                                1. 3

                                                                                                                                                  I haven’t used this in particular, but the feature in general is super handy for yanking for instance. You’ll immediately know if you did 3yy or if you accidentally did 34398yy. Even for deleting, it gives you a quick visual hint that gives you an intuitive feel for how much you deleted.

                                                                                                                                                  1. 1

                                                                                                                                                    I will have to try it out. that could actually be very useful just for yanking.