1. 6

    Articles likes this one always end up in the same boring language wars. There’s always at least one person that mentions how superior Rust’s exception handling is or that try-catch is the better paradigm.

    I program Go and Rust and really like how Go handles errors. The explicitness is something I like because it makes following the control flow very easy. On the other hand I dislike Rust’s ? because it is easy to overlook and if combined with map_err and the like it won’t become much clearer. Am I now an inferior programmer?

    1. 1

      In Swift, every throwing call must be handled explicitly, unlike Go. You must either use try or convert the call to a Result. It is much more explicit than comparing some extra return value to nil.

      When you try, you can catch the error through pattern matching, another feature Go will have in ten years’ time.

    1. 8

      Rubber duck debugging or programming is more effective than it should be. I can’t count the number of times where I figured out the solution for a problem as soon as I explained it to a co-worker (or a one of my cats when working remotely).

      1. 2

        The alarming effectiveness of cats at solving the gnarliest problems in programming is an intense trigger for imposter syndrome.

        That “Oh Fck I’m such a colossal idiot why didn’t I see that!” moment segues seamlessly into “I’m too stupid to do this stuff!”

      1. 41

        These days, are you even a real tech giant if you haven’t released (and abandoned?) a faster implementation of a language?

        Microsoft - ironpython / ironruby
        Google - unladen swallow
        Dropbox - mypy / mypyc
        CCPGames - stackless
        Stripe - sorbet compiler
        Facebook - hiphop
        ...
        
        1. 18

          Don’t forget yjit (developed at Shopify), Pyjion (developed at Microsoft), Pyston (developed at Dropbox originally), and Cinder (developed at Facebook) :)

          1. 4

            Ah, also, Microsoft is sponsoring Guido and Mark Shannon to work on faster CPython: https://github.com/faster-cpython

            1. 4

              Cinder (developed at Facebook)

              Looks like that and OP are similar:

              • facebookincubator/cinder: Instagram’s performance oriented fork of CPython.
              • facebookexperimental/skybison: Instagram’s experimental performance oriented greenfield implementation of Python.

              They have a few contributors in common, though seemingly not many.

              Edit: oh haha just noticed who I’m replying to. Do the two projects share any lineage?

              1. 3

                I work(ed) on both :) Some others did as well. There’s not much shared lineage, since Cinder is based on CPython and Skybison is from-scratch, but there are some shared ideas. The projects were developed in parallel but in a friendly way

                1. 3

                  Do you have any recommendations for production deployments? Since skybison README says it’s not supported for outside use. PyPy or stick to cpython?

                  1. 2

                    I really don’t know much about production environments in general or yours in particular. I think most of the time it’s going to be a case-by-case evaluation: what do you need (speed? compatibility? low memory? concurrency? something else?) and what is available to you to scratch that itch.

                    PyPy may well be perfect for your deployment, or it might not work out because you need to do a lot of C-API heavy work. It depends!

            2. 6

              Yeah I wouldn’t call CCPGames a tech giant, and also I thought Christian Tismer was the main force behind stackless, and he didn’t work there AFAIK. I also recall that they wanted to merge it for a long time but there was some fundamental incompatibility (probably with the C extension API). That doesn’t mean it was a bad idea – it’s healthy for have forks for experiments.

              Unladen Swallow was done by Python core devs that worked at Google. The main project didn’t succeed but the benchmarking work that was done and merged has been useful for all the performance work done in the last decade or so. There has been a bunch of performance work by Victor Stinner and I think he mentioned that he revived Unladen Swallow benchmark work and ran with it.

              1. 3

                Agreed; I don’t think CCP Games invented Stackless, I think they just deployed it on a large scale.

              2. 4

                “unladen swallow” Is this a Monty Python reference?

                1. 5

                  Indeed it is!

                2. 6

                  It warms my nationalistic heart to see CCP games called a tech giant.

                  1. 2

                    Stackless is still kinda around, in that PyPy added all their features iirc. ❤️

                  1. 6

                    I’m not sure when I would use this but I love it when people use languages in ways the authors hadn’t intended.

                    1. 16

                      Regardless of the practicality of this approach, this exercise found many bugs in the new Go generics implementation (most of which are now fixed) and opened several questions into their semantics.

                      1. 2

                        … this exercise found many bugs in the new Go generics implementation (most of which are now fixed) and opened several questions into their semantics.

                        Can you provide a link to the related discussion?

                      2. 4

                        “Here is an extremely convoluted way to make C kinda look sorta like C++ but without the additional type safety.”

                        “What’s the advantage?”

                        “It’s not C++.”

                        “SOLD!”

                      1. 1

                        The demo was funny to watch because “Schmutz” translates to filth or dirt in german and “Schmutz Tool” is how I sometimes call tools that suck 😅

                        In more seriousness, I think this will be pretty helpful when trying to patch some external dependency.

                        1. 2

                          It’s not an unintended meaning. In the US, the Yiddish word schmutz (which no doubt is from German originally) is part of popular culture.

                        1. 24

                          Upgrading @golang versions is actually a pleasurable task for me:

                          1. I’m 99% sure nothing will break.
                          2. Speedups of 5-10% are common.
                          3. New compiler or vet warnings tell me how to improve my code.
                          4. Excellent release notes.

                          Does any other language get this as right?

                          1. 6

                            Go’s secret sauce is that they never† break BC. There’s nothing else where you can just throw it into production like that because you don’t need to check for deprecations and warnings first.

                            † That said, 1.17 actually did break BC for security reasons. If you were interpreting URL query parameters so that ?a=1&b=2 and ?a=1;b=2 are the same, that’s broken now because they removed support for semicolons for security reasons. Seems like the right call, but definitely one of the few times where you could get bitten by Go.

                            Another issue is that the language and standard library has a compatibility guarantee, but the build tool does not, so e.g. if you didn’t move to modules, that can bite you. Still, compared to Python and Node, it’s a breath of fresh air.

                            1. 2

                              I’ve been upgrading since 1.8 or so. There have been (rarely) upgrades that broke my code, but it was always for a good reason and easy to fix. None in recent memory.

                              1. 1

                                1.16 or 1.15 also broke backwards compatibility with the TLS ServerName thing.

                              2. 4

                                Java is damn good about backward compatibility.

                                From what I recall, their release notes are pretty good as well.

                                1. 2

                                  As someone with just a little experience with Go, what’s the situation with dependencies? In Java and maven, it becomes a nightmare with exclusions when one wants to upgrade a dependency, as transitive dependencies might then clash.

                                  1. 3

                                    It’s a bit complicated, but the TL;DR is that Go 1.11 (this is 1.17, recall) introduced “modules” which is the blessed package management system. It’s based on URLs (although weirdly, it’s github.com, not com.github, hmm…) that tell the system where to download external modules. The modules are versioned by git tags (or equivalent for non-git SCMs). Your package can list the minimum versions of external packages it wants and also hardcode replacement versions if you need to fork something. The expectation is that if you need to break BC as a library author, you will publish your package with a new URL, typically by adding v2 or whatever to the end of your existing URL. Package users can import both github.com/user/pkg/v1 and github.com/user/pkg/v2 into the same program and it will run both, but if you want e.g. both v1 and v1.5 in the same application, you’re SOL. It’s extremely opinionated in that regard, but I haven’t run into any problems with it.

                                    Part of the backstory is that before Go modules, you were just expected to never break BC as a library author because there was no way to signal it downstream. When they switched to modules, Russ Cox basically tried to preserve that property by requiring URL changes for new versions.

                                    1. 2

                                      The module name and package ImportPath are not required to be URLs. Them being a URL is overloading done by go get. Nothing in the language spec requires them to be URLs.

                                      1. 1

                                        Yes, but I said “TL;DR” so I had to simplify.

                                    2. 2

                                      I also have only a little experience with Go. I have not yet run into frustrations with dependencies via Go modules.

                                      Russ Cox gave a number of great articles talking about how Go’s dependency management solves problems with transitive dependencies. I recall this one being very good (https://research.swtch.com/vgo-import). It also calls out a constraint that programmers must follow:

                                      In Go, if an old package and a new package have the same import path, the new package must be backwards compatible with the old package.

                                      Is this constraint realistic and followed by library authors? If not, you’re going to run into problems with Go modules.

                                      I’ve run into dependency hell in: Java, JavaScript, Python, and PHP – In every programming language I’ve had to do major development in. It’s a hard problem to solve!

                                        1. 1

                                          Is this constraint realistic and followed by library authors? If not, you’re going to run into problems with Go modules.

                                          It is (obviously) not realistic for most software produced in the world.

                                      1. 2

                                        I had a different experience, going from Java 8 to Java 11 broke countless libraries for me. Especially bad is that they often break at run- and not at compile time.

                                        1. 1

                                          I strongly agree. The first time major stuff broke was Java 9, which is exceedingly recent, and wasn’t an LTS. And that movement has more in common with the Go 2 work than anything else, especially as Java 8 continues to be fully supported.

                                      1. 8

                                        There is also spot-client, another Spotify GUI written in Rust™ which uses GTK. Both, spot-client and psst are lacking so many features¹ compared to the official client that a comparison is almost unfair. It’s more appropriate to call them minimal spotify clients.

                                        ¹ scrolling through huge playlists, changing their sort order, recommendations etc. (the stuff that makes Spotify good)…

                                        1. 1

                                          I prefer the official Spotify client on desktop for the reasons you list, and use spot-client on Pinephone.

                                        1. 3

                                          If you think blooms are cool, check out Vacuum Filters[1]

                                          [1] https://www.vldb.org/pvldb/vol13/p197-wang.pdf

                                          1. 3

                                            Thanks! From your link I ended up finding yet-another-filter, the Morton Filter

                                            1. 4

                                              Wow, never imagined what a rabbit hole this topic is. I was starting with Bloom, went over to Ribbon, then to Cuckoo and now to Vacuum and Morton filters.

                                          1. 6

                                            I would have liked to tag this article with datastructures but there is no such tag.

                                            1. 6

                                              compsci tends to be the correct goto for that stuff. :)

                                              1. 1

                                                On top of it, using CompSci neans that clicking the tag will teach them data structures, algorithms, optimizations, and more!

                                            1. 24

                                              This is getting tiresome. It’s always the same points rehashed. Why beat the same dead horse?

                                              1. 12

                                                Because they are beating a dead horse and ignoring that Go is an excellent pony.

                                                Many languages are weak at limiting ever expanding dependencies and build times. Go addresses this, and also has an excellent deployment story.

                                                Go was created partly out of frustration with C++ within Google and addresses many things that takes years to see that are problems in the first place.

                                                1. 6

                                                  This. Go does a lot of things wrong, but it got so much things right, ebough to make itself relevant.

                                                  1. 6

                                                    … addresses many things that takes years to see that are problems in the first place.

                                                    Very eloquently said. Throwing the kitchen sink into a language means supporting a ton of problematic patterns and footguns.

                                                    For example, even though I think everyone, even in the Go community, accepts that generics are pretty useful, doing them well means trade-offs. When you’ve seen some of the bizarre ways people abuse them in C++, it should give you pause that they’re always-good-no-caveats. Which is why the Featherweight Go paper that forms the model for Go’s eventual generics plan is heartening — it may not be perfect either, but it applies some wisdom to the right way to go about it without jumping into the deep end.

                                                    1. 4

                                                      C++ templates are also unusually terrible as far as templates go. I don’t think this is a strong argument.

                                                      I think this is less “Templates let you write really bad code” and more “C++ lets you write really bad code with templates.” For instance, D templates are much nicer - and more powerful.

                                                  2. 9

                                                    This is getting tiresome. It’s always the same points rehashed. Why beat the same dead horse?

                                                    As someone who changed languages from PHP to Go, after all these years I … still have no clue why people feel the need to do that.

                                                    But I’ve learned to smile. In my imagination I pat the “smart” developer on the head and just continue with my day. You know, making useful stuff that people like. If people need to vent, let them vent. But don’t take a blog post as gospel, just because it contains a lot of strong opinions.

                                                    1. 6

                                                      Why beat the same dead horse?

                                                      Usually because someone is forcing them to write Go and the terrible pain it causes them squirts out in a blog post.

                                                      1. 3

                                                        I do not see how anybody is “forced” to write Go. The market is so hot right now that anyone can just switch jobs if they are forced to program in a language they do not like.

                                                      2. 2

                                                        It looks like the author is a D-lang person.

                                                        You know the meme, about D programmers, misunderstood who think their language is the best, etc.

                                                      1. 1

                                                        I flagged this as broken link (could not find any alternative that fits better) because I only see a paywall and cannot read the article. Anyways, I haven’t had any high expectations since this is an article on medium.com .

                                                        1. 0

                                                          Language: the biggest missing part is goroutine/channel/defer, supports most features, some of them are, probably for the first time, implemented in a script language :), like Pointer/Interface/Struct.

                                                          Nothing to see here.

                                                          1. 2

                                                            If you do not need the physical thing then take a look at radio.garden. It is such a beautiful experience to discover radio stations in farthest corners of the earth just by spinning a globe in your browser.

                                                            1. 2

                                                              Cool! Thanks for the recommendation!

                                                              1. 1

                                                                Even better! Thank you!

                                                              1. 38

                                                                To me, this really drives home the need for language projects to treat dependency and build tooling as first-class citizens and integrate good, complete tools into their releases. Leaving these things to “the community” (or a quasi official organization like PyPA) just creates a mess (see: Go).

                                                                1. 9

                                                                  100% agree. I recently adopted a Python codebase and have delved into the ecosystem headfirst from a high precipice to find that’s improved drastically from the last time I wrote an app in Python — 2005 — but still feel like it’s in disarray relative to the polish of the Rust ecosystem and the organized chaos of the Ruby and JVM ecosystems in which I’ve swum for the last decade. I’ve invested considerable time in gluing together solutions and updating tools to work on Python 3.x.

                                                                  The article under-examines Poetry, which I find to meet my needs almost perfectly and have thus adopted despite some frustrating problems with PyTorch packages as dependencies (although PyTorch ~just fixed that).

                                                                  1. 5

                                                                    I also think poetry isn’t being considered enough. The article gives the impression that the author doesn’t have a lot of hands on experience of poetry but is curious about it. I’d recommend further exploring that curiosity. I understand that it’s hard to cover everything in a short article like this. If you’ve got an existing project using a working setup a lot of the points make sense and there’s no need to hurry up and change your setup. But I wouldn’t really call it a fair assessment of “The State of Python Packaging in 2021”.

                                                                    From my point of view it’s clear that pyproject.toml is the way going forward and is growing in popularity. Especially with the way considering it’s also required to specify the build system with modern setuptools going forward.

                                                                    As for the setup.cfg requiring an empty setup() with an setup.py is a half truth at best. It’s true that PEP-517 purposely defers editable installs to a later standard in order to reduce complexity of the PEP. But in practiceit’s not required if you use setuptools of a version equal to or greater than v40.9, released in spring of 2019. This is documented in the setuptools developers guide, if a setup.py is missing setuptools emulates a dummy file with an empty setup() for you. If you build you project with a PEP517/518 frontend you don’t need the setup.py. Having static setup.cfg is a massive improvement for the ecosystem as a whole since we can actually start resolving dependencies statically without running code, this benefit for the ecosystem as a whole should not be downplayed.

                                                                    I get the feeling that the author want to wait for a pipe-dream future where everything is perfectly specified and standardised before starting to adapt any of the new standards. I see this as completely fine and valid if you’re working on your own project, especially if you’ve already got existing working code. That said, in my opinion, I wouldn’t recommend it as the approach for everyone. I see it as necessary to start using the new standards on new projects so that we can start going forward, if we’re always clamping to the old way of doing things it’s going to be hard to progress and the progress will be hampered.

                                                                    I get the impression that the author is very knowledgeable and have plenty experience in the area, and I see the article as reflecting the opinion of the author which I respect but don’t fully agree with. I would love to have a chat with the author given the opportunity and hear more about his opinions. I’m also looking forward to read the 2022 edition next year. It’s also easy for me to contest some of the points here but it’s not completely fair without a reply from original author where he’s given a chance to elaborate and defend their choices.

                                                                    Full disclosure: I’m currently writing a book on the subject and I’ve researched the strides in Python Packaging quite heavily in recent time.

                                                                  2. 3

                                                                    just creates a mess (see: Go).

                                                                    It’s fair to say that packaging is a mess in Python but why exactly is packaging in Go a mess? Since 1.13 we have Go Modules which solves packaging very elegantly, at least in my opinion. What I especially like is that no central index service is required, to publish a package just tag a public git repo (there are also other ways to do that).

                                                                    1. 8

                                                                      Yeah, Go is fine now, but in the past, when the maintainers tried to have “the community” solve the packaging problem it was a mess. There were a bunch of incompatible tools (Glide, dep, “go get”, and so many more) and none of them seemed to gain real traction. Prior to Go modules the Go situation looked similar to the current Python situation. To their credit, the Go developers realized their mistake and corrected it pretty quickly (a couple years, versus going on a couple decades for Python, so far).

                                                                      1. 1

                                                                        Thank you for the explanation.

                                                                        Prior to Go modules the Go situation looked similar to the current Python situation.

                                                                        Yes, I agree with you that the situation was similar before Modules were a thing. I was fed up with the existing solutions around that time and had written my own dependency management tool as well.

                                                                      2. 4

                                                                        It’s fair to say that packaging is a mess in Python but why exactly is packaging in Go a mess?

                                                                        Not the original poster, but I think it’s because modules weren’t there from the start, and this allowed dep, glide, and others to pop up and further fragment dependency management.

                                                                    1. 2

                                                                      Note that this is the follow up article to Hardware Memory Models.

                                                                      1. 5

                                                                        People like the author kinda dive me nuts. I wish I could be so skilled:

                                                                        • Doesn’t use debuggers, because stepping through code is “slow and tiresome”
                                                                        • Doesn’t use code completion or IDEs

                                                                        In short, this person codes with a tooth pick and tweezers and is probably orders of magnitude more productive than me :)

                                                                        1. 13

                                                                          this person codes with a tooth pick and tweezers and is probably orders of magnitude more productive than me

                                                                          Maybe? I wouldn’t confuse asceticism for skill, or a confidently written narrative for authority or productivity.

                                                                          I think of myself as having a fair amount of programming experience, and I can’t imagine fixing understanding problems without debugging and instrumentation tools. I don’t buy the argument to authority the author makes about debuggers and the outsize personalities that have said they don’t use them.

                                                                          I also can’t imagine writing Rust without using rust-analyzer for completion. It’s just nice and I don’t understand the value in avoiding it.

                                                                          Don’t let exuberant manifestos diminish your own drive!

                                                                          1. 2

                                                                            Thanks very much that’s super refreshing to hear.

                                                                            I sometimes wonder if the ascetics are actually more numerous or if they’re just more likely to write up their preferred tool set than the scads of “cold dark matter programmers” who like me will take every bit of help they can get thank-you-very-much including code completion, IDEs, and debuggers, and anything else that will help me visualize and clarify my understanding of complex code.

                                                                            1. 2

                                                                              I sometimes wonder if the ascetics are actually more numerous or if they’re just more likely to write up their preferred tool set

                                                                              Mostly the latter. Whenever you have this feeling, of being out-of-touch with the world around you, don’t hesitate to look at statistics that show what developers at large actually use. The 2019 Stack Overflow Survey shows that the most popular editor, by far, is VSCode. Moreover IDEs occupy 50% of the top-10 most popular editors. IDEs are very popular and I have no doubt debuggers are as well.

                                                                          2. 4

                                                                            From my understanding of the article it reads like the author is mainly working with code solely authored by himself. Things start to look differently if you work with code bases that were authored by many developers and have a low test coverage, then a good debugger can save you some headaches. Java is not my favorite language by far, but the debugger integration in Intellij is just excellent and really helps to understand convoluted code. Also, you do not have to read any manual to start debugging Java code with most IDEs and that’s why their adoption is almost 100% in the Java world. I guess if we had such good debugger integration for other languages than more developers would use them.

                                                                            1. 1

                                                                              Totally agree.

                                                                              My day job is for a MegaCorp and I mostly work on legacy Python code bases with many objects and thousands of lines of code.

                                                                            2. 4

                                                                              I used to rely heavily on a debugger, but golang changed that for me. A fast automated test and some well placed printf’s are generally good enough to diagnose the issue.

                                                                              1. 2

                                                                                That may be true for some kinds of issues. Sometimes, though, you can’t easily add more print statements or the problem is not easily reproducible. Sometimes the debugging modifications actually change the behaviour of the program enough that you don’t experience the issue; e.g., by changing the timing around a race condition.

                                                                                Debuggers are not all classical single-stepping affairs, either. Sometimes they are post mortem debuggers, inspecting core dumps. Sometimes they are tracing tools like DTrace, which is effectively a sort of programmatic debugger.

                                                                                1. 1

                                                                                  Most debuggers are really bad at helping you find a bug when the failure is distant from the cause. If I hit an assert then it’s easy to fire up a debugger and go and look at the state and understand what’s wrong, but going from that to the place that introduced the incorrect state is often much harder. A tracing framework, even something ad-hoc like printf + grep, makes it easier to see what happened in the past that cause a failure now.

                                                                                  Ideally, you want time-travel debugging with watchpoints, but that generally works only for self-contained tests that don’t do I/O. Windbg is great if you have such a test (single-threaded, no network or user input, crashes at the end, root cause is somewhere much earlier): you run it, poke the state to find the incorrect value in some object, set a watchpoint on that address, and then run time backwards to find the last store to that address.

                                                                                  1. 1

                                                                                    That’s great. Logging definitely helps, but there are plenty of times where I don’t know where to place the logging because I don’t actually know what I’m looking for.

                                                                                    For example (Gonna use Python here because speak confidently about what you know, right? :) when I’m trying to debug why a decorator isn’t working right, if I’m doing something wrong with passing around the partials it’s gonna be awfully hard for me to properly place a print statement to figure that one out.

                                                                                    I suspect actual hours of experience or deliberate practice accrued plays in here as well. I don’t know how many years you’ve been programming. I’ve only really honest to god been working at practicing the craft of software development for about 5 years. I did 30 years of very simple procedural scripts before that but it’s not nearly the same thing.

                                                                                1. 39

                                                                                  Updates causing a reboot

                                                                                  Again, I’ve simply not experienced this. Now, back in the Windows 2000/XP days, yeah I think we all experienced this. However, for many years now, I’ve not seen this happen.

                                                                                  I have, many times, left my computer on overnight to come back to it being at the login screen with literally zero intervention. Looking at my update history, I think this happens about twice a month or so.

                                                                                  1. 20

                                                                                    Oh God! I really wish the author would tell us how in the world they achieved this state!

                                                                                    I have a Windows 10 machine that I use for work and it’s driving me nuts. Despite having disabled every single switch that Google told me to disable, this machine will automatically wake up and reboot to install updates if it’s on sleep.

                                                                                    Thing is, it doesn’t even work: this is a laptop, that I take with me on the road for my one customer whose stack depends on Windows, so the hard drive is encrypted. It reboots at 3 AM and then I wake up to… the Bitlocker prompt, which is followed, of course, by a good half hour of “hang on”. Should I seriously believe that nobody at Microsoft ever tried to update a computer with an encrypted hard drive?

                                                                                    It’s driving me nuts because the reason why that machine is on sleep is that it runs a diverse array of rather arcane applications, some of which aren’t exactly top-notch and lack various features like, uh, workspace management. So it takes me like 20 minutes to start up all of them and set things up back the way they were, so it’s easier to just let the laptop sleep.

                                                                                    On a tangential note: I think this is a hole that Microsoft have dug themselves into.

                                                                                    20 years ago there was really no question of whether you wanted to upgrade to one of the service packs. At best you’d wait two or three weeks to let early adopters find any of the truly bad, hard drive-wrecking blunders, but after that you’d update.

                                                                                    Nowadays, when you reboot after an update, you may boot to a more secure system with the latest security patch. Or a full-screen ad for Microsoft Edge that you have no idea how to hide, oh, and it’s set itself to be the default browser (guess who had to drive halfway across town in the middle of the pandemic because their parent had to teach online classes and they didn’t know how to make the ad go away – then drive back again because “they couldn’t find Firefox”). Or a brand-new version of Candy Crush Saga on Windows 10 Pro (I’ve given up wiping it, I now accept it as a fact of life, the way I accepted My Briefcase on Windows 95).

                                                                                    Of course nobody trusts the updates now, so now it’s a silent, subversive war, in which Microsoft has to find new ways to force updates because the users have been burned so many times they will never update on their own (fool me once etc. etc.) and everyone else tries to figure out ways to dodge them, at least until they can get their work done.

                                                                                    1. 6

                                                                                      I have had similar rage, and eventually wrote a little utility to just solve the problem: https://github.com/wheybags/Win10BSFixer

                                                                                      Every 10 seconds, it checks if the windows update service is running, and if it is, kills and disables it. Have had zero problems since, and it does allow you to pause the update blocking and manually update when you want to.

                                                                                      1. 2

                                                                                        You are my new favourite programmer now!

                                                                                    2. 6

                                                                                      Very common. Many, many times this has messed up cryptomining for me. I haven’t used windows for mining, or for anything for awhile now, so maybe that has changed in the last year or two.

                                                                                      1. 22

                                                                                        Very common. Many, many times this has messed up cryptomining for me.

                                                                                        I never thought I’d look on this behaviour as a good thing, until now.

                                                                                        1. 2

                                                                                          It’s still not. The real problem, giant mining firms with hundreds of thousands of GPUs calculating useless hashes 24/7, know how to get around it. It makes literally zero difference whether slylax puts their GPU to use overnight every now and then. Hell, they may even use their desktop as a crypto mining thermostat for all we know, in which case it’d make literally no difference compared to any other form of resistive heating.

                                                                                      2. 5

                                                                                        This was my major gripe. I never felt comfortable leaving the machine on a long running process overnight, even if I had remembered to go to the updates menu and disable updates for 7 days, which is the maximum AFAIR.

                                                                                        After having switched to Linux with Windows running in a VM for the few things I need, my machine runs faster and lighter, the fans spin less and I get more battery life. And I trust my computer again.

                                                                                        1. 1

                                                                                          The cancer is making its way to Linux, though. Ubuntu snaps have a similar “updates happen by our command and you can delay them a bit but that’s it” philosophy. It is infuriating if you are managing the rule lists for host-level intrusion detection.

                                                                                        2. 4

                                                                                          It even wakes itself up in the middle of night to do some updating and then reboots itself, only to end up in Linux because of the dual-boot. And it’s not exactly easy to convince it not to do that.

                                                                                          1. 3

                                                                                            I think this also depends on whether and how the IT department manages this. It is hard to discover who is responsible for this.

                                                                                            1. 3

                                                                                              This is my personal desktop, so my IT department is me.

                                                                                            2. 3

                                                                                              I own a windows 10 machine that I boot about once a month and it feels like I always have to do an update which requires a reboot. So, at least in my experience, this update/reboot thing is absolutely common.

                                                                                              1. 3

                                                                                                Updates causing a reboot

                                                                                                Again, I’ve simply not experienced this. Now, back in the Windows 2000/XP days, yeah I think we all experienced this. However, for many years now, I’ve not seen this happen.

                                                                                                I have, many times, left my computer on overnight to come back to it being at the login screen with literally zero intervention. Looking at my update history, I think this happens about twice a month or so.

                                                                                                Same here. Worse, I’ve lost work because of it more than once. Much more recently than the Win 2000/XP days.

                                                                                                About a year ago, when I got a document that I could only handle on Windows for some reason, fired up my not-too-frequently used Windows machine with Outlook on it, and read/started composing a reply. This was a bit earlier than my normal workday, around 4:30 AM. When I walked upstairs around 5:30 to make myself some more coffee and returned to my basement office around 5:50, the machine was sitting there, rebooted. It discarded my in-progress draft response. It didn’t save it to my IMAP drafts folder. It didn’t save it to a local drafts folder. It was just gone.

                                                                                                I’ve been using computers long enough to know I shouldn’t walk away from even a laptop without saving, but this age of auto-saved drafts has made me soft.

                                                                                                I think this phenomenon is especially bad for systems that don’t get booted and used all the time, which may account for the seemingly outsized perception of the problem by people who primarily use other OSes. If it’s been more than a couple weeks since I booted a VM, I feel like I need to allow an hour for it to update, reboot, update again and settle down post-update before I can really use it.

                                                                                                1. 4

                                                                                                  I think this phenomenon is especially bad for systems that don’t get booted and used all the time, which may account for the seemingly outsized perception of the problem by people who primarily use other OSes.

                                                                                                  This is exactly the issue with my gaming PC.

                                                                                                  I’m really cooling off on the idea of a gaming PC as of late because of BS like this. When I finally do arrange a time with friends to play every 2-3 weeks, it’s a dice roll whether W10 will pull some inane crap like this because you actually had the gall to boot it up and use it: “you need to update! You have to wait an unspecified amount of time!”

                                                                                                  What I really want to know is: what exactly is it doing after it applies updates? It seems like it just sits there for 5-10 minutes “finalizing” settings.

                                                                                                  The absolute worst: W10 thinking it is okay to upgrade your video driver while you are using it. Most games/apps just crash outright because they aren’t designed to handle this.

                                                                                                  1. 3

                                                                                                    I’m really cooling off on the idea of a gaming PC as of late because of BS like this. When I finally do arrange a time with friends to play every 2-3 weeks, it’s a dice roll whether W10 will pull some inane crap like this because you actually had the gall to boot it up and use it: “you need to update! You have to wait an unspecified amount of time!”

                                                                                                    Same for the XBox 360. It would disable a lot of features (e.g. networking) if you didn’t update (maybe it still does). We were not very regular gamers, so we would often start the XBox after a couple of weeks to call family on Skype with the Kinect camera. Only to disappoint them that they had to wait 30-60 minutes while the XBox fetches some update.

                                                                                                    1. 2

                                                                                                      what exactly is it doing after it applies updates? It seems like it just sits there

                                                                                                      One of the most annoying aspects of Windows updates is that user profile data seems to need migration to the latest schema. For whatever reason, this can’t occur during the system update and is instead ran the next time that user logs in. Which means updating in the middle of the night hardly saves me any time.

                                                                                                      1. 2

                                                                                                        If I’d guess, I’d say that user profile stuff is probably encrypted with the user’s password, so it has no way to read the user profile until the user logs in and it has the password. That would make sens to me at least.

                                                                                                        Not that that’s an excuse. There are definitely solutions here which would move the schema migration time to a less inconvenient time than right as you’re logging in, or ways to make the schema migration process faster. (Or ways to keep the user profile schema stable across most updates.)

                                                                                                      2. 1

                                                                                                        I’ve found that like 99% of the time, I can get a game to run on Linux now. I still sometimes reboot into Windows to play a game with friends if it’s a game I haven’t played before, but after that initial session, I usually go back into Linux and spend some time getting it to run in my main set-up. So far, there’s one game we’ve tried to play which I haven’t gotten to run in Linux - and that’s not due to a technical limitation, but because the anti-cheat detects that it’s not on Windows somehow and therefore disables online functionality.

                                                                                                        In a surprising amount of cases, all it takes is literally just downloading the game on Steam and letting Proton automatically do its thing. Sometimes, I have find an installer on lutris.com, but then it usually works fine once installed.

                                                                                                        I wish “getting the game to work on my system” wasn’t a thing I had to spend time on. But overall, it’s much nicer to have to do that once per game than to have to boot into Windows and deal with its updates, an environment I’m less used to, losing all my Linux state, etc.

                                                                                                  1. 5

                                                                                                    Neat idea, I really like the concise implementation. I still have a minor nitpick, initialize the context in attemptForward¹ with the incoming requests context so it gets canceled when the request is canceled and not only when it times out.

                                                                                                    ¹ How do I get permalinks in sourcehut, pressing y works in Github and GitLab and I know that sourcehut prevents Javascript as much as possible but this functionality would count as progressive enhancement for me :)

                                                                                                    1. 6

                                                                                                      Right-click the line number and copy the link, possibly by right-clicking and typing ‘L’ if you’re using firefox.

                                                                                                      1. 3

                                                                                                        Does not work for me in Firefox and man.sr.ht/git.sr.ht/ never mentions link or permalink anywhere. Anyways, this is getting off-topic.

                                                                                                    1. 1

                                                                                                      Never used -d and I think it can be omitted, e.g. from go get -d -u ./... or go get -d github.com/path/to/module. This is what go help get says:

                                                                                                      The -d flag instructs get not to build or install packages. get will only update go.mod and download source code needed to build packages.

                                                                                                      Building and installing packages with get is deprecated. In a future release, the -d flag will be enabled by default, and ‘go get’ will be only be used to adjust dependencies of the current module. To install a package using dependencies from the current module, use ‘go install’. To install a package ignoring the current module, use ‘go install’ with an @version suffix like “@latest” after each argument.

                                                                                                      1. 3

                                                                                                        The one key thing this blog post is missing: “but why?”

                                                                                                        1. 3

                                                                                                          Following one of the article’s links leads to Go issue 395 which contains the following motivation statement:

                                                                                                          One motivation for doing this is that using an array pointer allows the compiler to range check constant indices at compile time.

                                                                                                          a function like this:

                                                                                                          func foo(a []int) int { return a[0] + a[1] + a[2] + a[3]; }

                                                                                                          could be turned into:

                                                                                                          func foo(a []int) int { b := a.[0:4]; return b[0] + b[1] + b[2] + b[3]; }

                                                                                                          allowing the compiler to check all the bounds once only and give compile-time errors about out of range indices.