1. 29

    I kind of want to downvote this, unfortunately with my 600-ish karma there isn’t an option for that.

    The post itself says essentially, for people who are even remotely familiar with the topic, nothing more than the title. I was expecting a lot more, but there is no direct demonstration of any of it. It just says “read these other posts” (Which I have, in the past). It’s only purpose is to serve as an advert for the other posts. That’s not content.

    1. 12

      Yeah, this might very well be the first case I can think of where I legitimately wanted to “downvote” without giving any of the typical flag reasons. It’s stretching to call it spam, off-topic, or any of the others, but nevertheless, it’s low-quality.

      Sure, people who follow Steve’s blog would be interested in knowing that the third part of the series will never actually come. But for lobsters viewers? It’s kind of a waste of space.

      1. 2

        Maybe “low-effort” or “content-free” could be a good new flag?

        1. 6

          Well, it is a difficult thing to write about.

          I know what Steve Klabnik means. C was informed by PDP assembly and does feel somewhat like VAX assembly, it doesn’t feel like Z80 assembly (my first love) and it very much does not feel like well-written modern x86/arm assembly. But it’s difficult to show that using examples, to write that clearly using the kind of prose Steve wants to write.

          Some of the Java I’m compiling seems to translate more directly to well-written fast modern assembly language, which implies that Java is a lower-level language than C. Ridiculous, yes? But the when I have the JVM opcodes and the (extremely liberal) Java memory model, I’m permitted to reorder instructions more than C compilers (bound by the much stricter C memory model) can’t, and the resulting assembly language looks more like how I’d write the same function in assembly. I don’t particularly try to do this, I just notice the effect when I stare at compiler output, and it tells me that C’s memory model is a noticeably bad fit for modern CPUs.

          Syntax is easy to show using the kind example-laden text Steve prefers, but this kind of… guidance not so. I can see why Steve decided to strike it off his todo list.

      2. 5

        Weird, you should be able to flag this submission.

        1.  

          You can flag it, but what as?

        2. 12

          Agreed. Core point (in only two-three paragraphs of source):

          If you go too far into “C runs directly on the hardware,” you may be surprised when a compiler does something that you didn’t expect.

          Same criticism holds for almost everything other than analog circuitry, and I’m a little tired of it being used by Rust folks as a generic shibboleth to discredit C.

          1. 7

            I’m not sure if that was your intention, but your point doesn’t really have anything to do with what @alexandria was saying. She was saying that this post has no real new content and it doesn’t seem like she disagrees (or agrees) with anything the author was saying while you certainly do. So it’s weird to me to say “Agreed” and go off on something entirely different.

            1. 2

              Do you mean to say that it holds to an equal degree for almost everything other than analog circuitry?

              C is odd, at least the code I see. It’s sort of low level, with bit-banging and a rule that memcmp matches ==. But on the other hand doesn’t translate nicely to the next level down (assembly language), and shouldn’t a low-level language translate easily to assembly?

              1. 0

                Yes, thank you. Assembly instructions may get turned into microcode and processors are free–much to the delight of security researchers everywhere–to reorder and change and pack and do all kinds of weird things with seemingly straightforward routines.

          1. 1

            I’d honestly entirely forgotten about Ogg. Is it still a thing in a meaningful sense, what with the MP3 patents having expired?

            1. 6

              Ogg is a container format, able to hold different codecs inside, Vorbis is the codec designed to replace MP3. Now Ogg is being used with the Opus codec, with quite success.

              1. 3

                Ugh, I thought that Opus had its own container format/was using MKV already …

                Tried to parse Ogg once, wouldn’t recommend.

              2. 6

                Spotify uses ogg vorbis for streaming to their apps: https://en.wikipedia.org/wiki/Spotify#Technical_information

                1. 5

                  Ogg vorbis file size pretty regularly beat out vbr mp3’s at the max setting I could distinguish in a blind listening test. If a lossless source is available I always prefer encoding vorbis myself for use on my own (non internet) music player! The criticisms of the Ogg container make sense though. I’ve never really seen Vorbis in any other container tbh.

                  1. 3

                    Old-style WebM files used Vorbis in a Matroska container.

              1. 5

                This looks way bigger than “offline web apps”. It seems to delete any kind of script-writeable information after 7 days. That kills every kind of application with any kind of client-side storage.

                Lots of applications use things like LocalStorage, or cookies written to by scripts, to store session tokens and such. This looks like it’ll break all of that, and the privacy improvements seem to be marginal at best.

                1. 3

                  So you get automatically logged out if you go a whole week without using it. How is that disastrous? It just means you need to enter your username and password again, probably by clicking the “Log In” button and touching your finger to the home button for a few seconds.

                  1. 2

                    clicking the “Log In” button

                    It says “offline web apps” in the title. Sounds like you’re talking about a service with a centralized log-in server.

                    1. 4

                      I’m replying to the parent comment, not the OP:

                      Lots of applications use things like LocalStorage, or cookies written to by scripts, to store session tokens and such.

                      Offline apps don’t need session tokens.

                      1. 0

                        I’m fine with session tokens expiring like that, for the reasons you stated. Again, maybe a bit of a short expiration period that would benefit from customization. I’ve even seen Safari for iOS ask, upon reaching the 100-tab limit, how often the user would like for tabs to be purged. This seems like an even more crucial application of such a prompt.

                        I still think an exception should be made for websites a user has specifically placed on their home page, alongside all their other, “official” apps. Needless to say, though, this seems to be against Apple’s long-standing interests for obvious reasons.

                1. 6

                  I’m glad all the new languages have switched (Rust, Swift too). It’s the same amount of typing:

                  if (cond) then
                  if cond {then}
                  

                  It’s easier to parse. Avoids “goto fail” errors. After getting used to it, it also feels more consistent: code attached to a construct is always a block, and expressions never need unnecessary parens.

                  1. 8

                    Rust has its own version of the problem, that we could call the “brace association” problem. Basically, you have to decide if Symbol is a struct name, and thus Symbol { ... } is a struct literal, or if it’s just a variable name.

                    if Symbol { whatever } { whatever }
                    

                    Rust goes with “it’s a variable name”, by fiat*, but that’s how the dangling else was solved, too.

                    * since a struct literal cannot be of type bool, it’s not an arbitrary choice, but just because it can’t possibly type check doesn’t mean it can’t be parsed.

                    1. 2

                      Nice, I didn’t realize this ambiguity existed. For humans, it helps that types are upper case and variables are lower case, but that’s by convention so it doesn’t help the parser much. Also, I am again slightly baffled by the amount of work rustc puts into weird edge cases:

                         Compiling playground v0.0.1 (/playground)
                      error: struct literals are not allowed here
                       --> src/main.rs:8:8
                        |
                      8 |     if foo { i: 3 } {
                        |        ^^^^^^^^^^^^
                        |
                      help: surround the struct literal with parentheses
                        |
                      8 |     if (foo { i: 3 }) {
                        |        ^            ^
                      
                  1. 4

                    To me this reads like a long list “don’t do this, don’t do that”. But it’s thin on justification and guidance what to do instead.

                    The guide rather oddly is very protective about leaking memory, to the point of forbidding destructors in refcounted types. The Rust project has agreed that memory leaks are not a safety issue, so I’d like to see justification why the guide disagrees.

                    There’s “don’t have panics” which is easier said than done. There are tools and techniques for it, but not in this guide.

                    The guide discourages, but doesn’t completely ban mem::uninitialized. That’s OTOH surprisingly lenient, because it’s a deprecated footgun.

                    1. 3

                      A huge number of bugs over time in sled have been due to reliance on Drop implementations to be run at certain times. Over-reliance on Drop is absolutely a bad smell for a project that intends to be reliable.

                      Anyone who has been in a position to rely on code working over time would agree that Rust’s definition of safety falls far short of production readiness. Leaks are not safe for production. mem::forget is often not safe for production. etc… etc…

                      1. 1

                        I just had an idea where an allocator tracks allocations by call site and reserves a certain amount of memory for the callsite, so that it isn’t continuously allocated and deallocated, it puts it on a preferred allocation list. Like a soft reservation. Could reduce fragmentation as well as latency in allocations. Thoughts? Somewhere between fully static memory allocation vs completely dynamic.

                        1. 2

                          How does it differ from a stack? It sounds the same to me?

                      2. 1

                        The Rust project has agreed that memory leaks are not a safety issue, so I’d like to see justification why the guide disagrees.

                        The Rust project claimed that the borrow checker prevented memory leaks until, just before the 1.0 release, they realised it didn’t, and decided that memory leaks were not a memory safety issue any more.

                        1. 2

                          Rust has had reference counting since the first bootstrap, and the ability to leak memory by creating cycles has always been a well-known property of reference counting.

                          The designer of scoped threads didn’t think of it. That’s not the same thing as actively claiming that they are impossible.

                          1. 2

                            I don’t remember not-leaking-memory being a borrow checker thing. Borrowing depends on ownership, but it’s a layer on top of it. For example, the major borrowck to NLL rewrite didn’t touch drop behavior.

                            The leakpocalypse was related to Drop being used to guard safety of scoped threads. After that was shown unsound and removed, there wasn’t anything left in the stdlib that needed Drop for safety, so leaking could be declared safe.

                        1. 23

                          Posts homophobic abuse, gets blocked. Shows no contrition. Somehow thinks gitlab will treat him differently next time.

                          1. 6

                            haha, good point re: gitlab. He’s just trading one centralised hosting provider for another.

                            That reminds me, I should probably update my post about self-hosting cgit to include this sort of thing.

                            1. 3

                              Attention! Due to a complaint submitted by this person: [censored], the hosting provider has forced me to delete the binaries for the utility I wrote more than 10 years ago and that hasn’t bothered anyone for all these years. You can tell this character everything you think of him to his Twitter account.

                              He posted homophobic abuse as part of a larger harassment campaign.

                              It’s unfortunate that GitHub hid all of his existing code (n.b. you should mirror all of your dependencies, because this is probably what GitHub does by default when a site admin clicks “Yes, this violates the rules”), but a temp ban seems perfectly reasonable in response to this.

                            1. 7

                              Haven’t seen a single post here about that.

                              So I guess my current set of filters already does the job? :)

                              1. 6

                                Haven’t seen any without any filters.

                                1. 5

                                  There’s only been one, and it was very bad. It was heavily flagged and I removed it.

                                  1. 0

                                    I don’t want to be too critical, but I consider that a devastating indictment of the site and its readership. I was considering posting my resource list, but held back because I wasn’t quite sure whether it was on topic.

                                    1. 11

                                      The topic is more important than we can do justice to. The first story was uninformed scaremongering; the second announced a cure. They were both obviously bullshit, but neither mods nor readers have the medical, epidemiological, or public policy expertise to evaluate everything people post to avoid doing more harm than good. Recognizing our limitations is not a failure.

                                      1. 0

                                        Fair enough. By “indictment” (which I realize is a strong word), I express disappointment that the community can’t come up with anything better than that. There’s plenty about the topic that should be of interest to broadly curious people, including a bunch of raw data to analyze and visualizations that might be useful.

                                        Is it ok if I post my resource list and do my best to be a good presence in a discussion thread on it? I’d like to think we can do better.

                                        1. 4

                                          Realistically, what is the intersection between “coronavirus” and “computing”?

                                          1. 2

                                            Both start with ‘co’?

                                            1. 1

                                              A few examples: the wirvsvirus hackathon. A covid data cleaner. The helpwithcovid initiative.

                                              But I understand the desire for a covid-free space. It’s just not where my energy is right now.

                                            2. 3

                                              Fair enough. By “indictment” (which I realize is a strong word), I express disappointment that the community can’t come up with anything better than that.

                                              The smart and thoughtful posters all knew it was off-topic.

                                    1. 6

                                      I do not fully understand they did not just update ifconfig(8) – random IRC rumors say there was a failed attempt due to ifconfig(8)’s convoluted code-base.

                                      ^ That seems like the “real reason”.

                                      1. 10

                                        The reason is that ifconfig maintains bugs. The Linux kernel is irrelevant. If ifconfig would change its output format, many scripts around the world would break.

                                        1. 3

                                          The reasons seem connected, though. If maintaining known bugs weren’t the policy, then ifconfig could have been rewritten.

                                          1. 4

                                            It can still be rewritten and use the new interfaces.

                                            1. 1

                                              So the real title should be: “ifconfig maintains bugs: The real reason ifconfig on Linux is deprecated”.

                                              (Also, there are ways of transitioning over to new APIs; you could release an ifconfig2 or whatever with new behavior, or add a flag for a new structured output that might be more pleasant to parse anyhow.)

                                          1. 8

                                            What do you think GitHub (and Microsoft) have to gain from purchasing the money pit that is npm?

                                            1. 19

                                              Controlling and being able to influence a piece of infrastructure critical to their other smash hit, TypeScript.

                                              1. 2

                                                That makes sense to me. They have an investment in Typescript and an unstable npm makes it riskier.

                                              2. 13

                                                Making Node.js cheaper and more reliable drives up demand for cloud servers.

                                                1. 7

                                                  Brand awareness? github will be the first thing new JS developers get into contact with now, and they will never use anything else anymore.

                                                  1. 6
                                                    1. Developers, developers, developers.
                                                    2. ???
                                                    3. Profit.

                                                    Having npm, GitHub, TypeScript and VSCode, Microsoft now owns large chunk of tooling used by huge group of developers. I’m not sure what the step 2 is, but probably Azure.

                                                    1. 2

                                                      Control and user-exposure to their services and products. Creating convenience for users is going to gear them towards using more services that the company provides, which in turn can make them more money.

                                                    1. 3

                                                      The buried lede: Rust’s std::borrow::Cow is faster than the old C++ copy-on-write string class because it doesn’t require atomic ops.

                                                      1. 6

                                                        I like the notifications page, but the blue dickbar you get when clicking a notification is too tall and not very useful. I love “mark as unread” (and should investigate “save”), but “back to notifications” is silly (duplicates the bell — also who doesn’t open each notification in a new tab?!), “unsubscribe” duplicates the issue sidebar and “done” I do not understand at all — the notification is already marked read by visiting the issue…

                                                        1. 2

                                                          That, at least, can be easily removed. I’ve already added it to my remove-fixed-headers uBlock Origin list.

                                                          1. 2

                                                            Pressing done (or the tick on the notifications page) removes it from the list of notifications. Just visiting it only seems to grey it out.

                                                            1. 1

                                                              Yeah, I don’t like the fixed header either. They have a feedback link on the notifications page and I’d encourage you to send this.

                                                            1. 1

                                                              I wholeheartedly agree with the first comment on that article, the one that starts out

                                                              This is rather useless information for two primary reasons; 1) it provides a good case study for how to make “fake” accounts less detectable, and 2) it is biased in a way that will produce many false positives of “real” accounts that are not fake at all

                                                              Some of my favorite twitter accounts (or accounts on non-twitter blog sites) are deliberately anonymous or pseudoanonymous, whose avatars deliberately betray no real information about them. I’ve actually considered using a GAN-generated face that I particularly liked as an avatar for myself in some contexts.

                                                              1. 3

                                                                Some of my favorite twitter accounts (or accounts on non-twitter blog sites) are deliberately anonymous or pseudoanonymous

                                                                This Twitter bio is not just a pseudonymous handle. It is engaging in a false act of commitment; by using a legal-looking name and a photo-looking face, it tries to make it look like the Twitter account owner is using their irreplaceable offline identity as collateral, when the account is actually a burner that they could replace at any time. It also encourages Twitter users who see it to use their own “IRL” names and bios, out of (false) reciprocity.

                                                                With “normal” online handle, like @ThirdMan__ that someone else brought up on the OP, prospective followers know that the account they’re following is pseudonymous. The dynamic isn’t dishonest.

                                                                1. 3

                                                                  I think any one piece of evidence isn’t sufficient to rule out false positives, but everything together, the GAN and the tweet volume and the fake credential and the tweet times? Pretty good evidence it’s the real deal.

                                                                1. 2

                                                                  I’m not sure this is cruel. To paraphrase an orangsite comment: Imagine what would have happened automatically if this message hadn’t been sent. This is arguably the best outcome.

                                                                  1. 2

                                                                    The thing probably should’ve sent a different email. Less “GO LIONS!” chearleading would’ve been nice.

                                                                    (the nasty trick is making sure you don’t accidentally send the “Sorry for your loss” email when nobody’s actually dead)

                                                                  1. 7

                                                                    By paying, you get a number of assurances you don’t from a random project you find on GitHub—for example guaranteed updates, more consistent APIs, and a company you can contact when things inevitably go wrong.

                                                                    If you are using open source software, you have an assurance that you can keep using and updating it yourself even if the original authors with they could erase the project from existence.

                                                                    The myth of better support for paid projects… I’ve seen enough products and services get discontinued, provide horrendous APIs, and come with completely useless support.

                                                                    It looks like the post author’s company aims to provide great support to customers, but it’s not that common. Most of the time if things actually break, you are on your own.

                                                                    1. 1

                                                                      Why not both?

                                                                      My day job has a contract with one of our clients that grants them unlimited use of all the code we develop for them, while we simultaneously have unlimited use of all the code we develop for them (it’s not technically F/OSS, but it’s equivalent by your “they cannot erase the project from existence” criteria). They also pay us.

                                                                    1. 17

                                                                      I’ve weighed in on this before. In my experience, things on lobste.rs that get both heavy upvotes and heavy downvotes tend to be on topics that both upvoters and downvoters regard as important. For example, they are often on diversity issues. The voting expresses people’s opinions on whether conversations around those issues should be allowed to happen. Applying a hotness modifier would privilege downvotes over upvotes, allowing a minority of people on the site to silence a majority.

                                                                      I have seen this done, in practice, in other forums. Its effect has been to reduce the quality of discussion by penalizing controversy - however necessary the controversy might be. In fact, I actually campaigned to stop this practice on a communication platform internal to Google, where it was very clear that the formula had been chosen specifically to silence labor organization efforts. The company’s upper management even disseminated talking points about how it would be better this way, because we could all stop caring about ethics and focus on shiny toys. (That’s my summary, not their words…)

                                                                      That campaign was unsuccessful, but here on lobste.rs we can do better - right?

                                                                      1. 10

                                                                        How’d that work with the Darmore thing?

                                                                        The putative reason for allowing controversial stuff is to “let the minority speak”…and then there was the time recently where in the wee hours of the morning you deleted a submission about a fork of TempleOS over the author’s Github avatar since it referenced Nazis. Somehow that minority didn’t make the cut–and you were more than happy to let a minority of users who brought in concerns over the tackiness of the avatar overrule the majority of users (seriously, it was like 2-3:1) who just upvoted a neat fork of TempleOS.

                                                                        In the case of RMS deathball, we had a massive ugly trashfire of stories for a week that just sat on the front page and harmed the community. All that happened was users got drawn into grumpy lines and proceeded to antagonize each other. That’s what controversial gets you–and while that is the bread and butter of various political extremist subgroups, for the rest of us it is a problem.

                                                                        The failure mode of boosting downvotes is that you let people hasten the slide of controversial stuff.

                                                                        The failure mode of not so doing so is abiding shitflinging that hurts the community.

                                                                        Edit: just to be absolutely crystal clear here, we as Lobsters have demonstrated repeatedly that our aptitude for productively discussing technology with civility in no way extends outside of that domain.

                                                                        We aren’t going to have wizened discussion about controversial things where we all take turns litigating the factual details of the case and being enlightened by different perspectives and worldviews, we are going to devolve into bickering over the evil feminists and Nazis and capitalists and whatever else. The most straightforward way around this is just to remove those controversial things.

                                                                        The motte-and-bailey people want to pull here is justifying discussion of “controversial” submissions like rants about Go or whatever, but the real effect will be felt with culture war articles submitted under the guise of technology because “technology is inherently political”.

                                                                        1. 4

                                                                          We aren’t going to have wizened discussion about controversial things where we all take turns litigating the factual details of the case and being enlightened by different perspectives and worldviews, we are going to devolve into bickering over the evil feminists and Nazis and capitalists and whatever else.

                                                                          I’ve seen your comments improve drastically, taking conscious steps to avoid attacking people. Are you saying that others should be denied that same opportunity to discuss and grow and learn from each other?

                                                                          The only way people learn and grow is through communication with people with whom they disagree. Sometimes they discover they’re right, sometimes they discover they’re wrong, and sometimes they discover that they’re both right and wrong in a fascinating mixture of self-discovery and improvement. I love that stuff. I want it around. I want people to have that opportunity.

                                                                          The most straightforward way around this is just to remove those controversial things.

                                                                          Or, you could click “Hide”. That seems way more straightforward to me.

                                                                          1. 3

                                                                            I thank you for your points. I had been hoping I’d find time to write up my thoughts on them and reply, but unfortunately I don’t think that’s realistic. I do think that when there’s overt fighting for the sake of fighting, the moderation team does a decent job of shutting that down; however, as a member of the moderation team, it isn’t really for me to decide whether we’ve done a good job or not.

                                                                          2. 5

                                                                            Good points. I’ll add that…

                                                                            “Applying a hotness modifier would privilege downvotes over upvotes, allowing a minority of people on the site to silence a majority. I have seen this done, in practice, in other forums.”

                                                                            …people already do that here to the degree they can. They’ve been clear they’ll take it further to keep the front page free of (thing they don’t like). It will definitely happen as you predicted.

                                                                            What I don’t know is if it will escalate from there with back and forth among the two, main groups penalizing each others’ submissions.

                                                                            1. 4

                                                                              I think this is a fair critique. My suspicion is that most “controversial” pieces aren’t actually high-quality and the ones that are high-quality do much better. But I’d have to think of a database query to check this for certain.

                                                                              1. 4

                                                                                This is exactly right.

                                                                                For some reason, people have yet to learn to disagree with each other. They take things personally, get angry and refuse to entertain the idea that they might be wrong.

                                                                                The solution is to help people to be better. Not to shut down the platform that enable their argument, nor to privilege downvote over upvote.

                                                                                BTW, even if we could not stop people getting mad over people not agreeing with their ideology, the fact of the matter is that the argument itself is useful. Two sides present their best arguments, and for every angry person there are 10 more silently reading both sides and updating their world views.

                                                                                If people care to spend their time clicking to vote, and to spend their time typing a response, they clearly care about the subject at discussion. And your response to that is to just make it so that the more people care, the less the subject is exposed? Shouldn’t it be the other way around?

                                                                                And no, I don’t need you to tell me what stories I should or should not be able to see.

                                                                                We should encourage discussion, and moderation should be used to maintain civility, to maximise the benefit of a conversation and minimise the downside.

                                                                                1. 1

                                                                                  There is no world in which two sides presenting their best arguments about the Holocaust is going to generate more good than harm to our community.

                                                                                  There is no world in which two sides in a subthread arguing about how to count trans people for demographic purposes in tech benefits our community.

                                                                                  There is no world in which closely parsing RMS’ remarks about various forms of consent and rape and Epstein and the media lab creates positive feelings about our community.

                                                                                  I used to be right there with you on “oh gee maybe these smart people will be able to have nuanced and productive discussions about topics that have non-technical aspects”…and then I ran repeatedly into lobsters that just couldn’t be reasoned with or who had to be shrill about everything.

                                                                                  From a practical point of view, kicking everybody out of the pub is both a fair and reasonable way to maintain decorum.

                                                                                  1. 3

                                                                                    There is no world in which two sides presenting their best arguments about the Holocaust is going to generate more good than harm to our community.

                                                                                    About the holocaust? How can one argue about an event?

                                                                                    There is no world in which two sides in a subthread arguing about how to count trans people for demographic purposes in tech benefits our community.

                                                                                    I would say don’t count any people for demographic purposes at all.

                                                                                    There is no world in which closely parsing RMS’ remarks about various forms of consent and rape and Epstein and the media lab creates positive feelings about our community.

                                                                                    Discussions about difficult things have value even if you don’t feel good doing it. Doctors don’t look at a gaping wound because it’s pleasant, but because they needs to know what to do to fix it. So even if this statement were true, it wouldn’t negate the need for discussion.

                                                                                    and then I ran repeatedly into lobsters that just couldn’t be reasoned with or who had to be shrill about everything.

                                                                                    If somebody cannot be reasoned with, then nobody should be allowed to voice their reason? Is that right?

                                                                                    From a practical point of view, kicking everybody out of the pub is both a fair and reasonable way to maintain decorum.

                                                                                    Decorum’s purpose is to enable social engagement. So removing social engagement to maintain decorum is cart-b4-horsing.

                                                                                    1. 1

                                                                                      I would say don’t count any people for demographic purposes at all.

                                                                                      Please don’t chase red herrings.

                                                                                      Discussions about difficult things have value even if you don’t feel good doing it. Doctors don’t look at a gaping wound because it’s pleasant, but because they needs to know what to do to fix it. So even if this statement were true, it wouldn’t negate the need for discussion.

                                                                                      Doctors don’t just look at unpleasant things for entertainment. They look at them because they have the power and the knowledge to do something about it.

                                                                                      1. 4

                                                                                        Doctors don’t just look at unpleasant things for entertainment. They look at them because they have the power and the knowledge to do something about it.

                                                                                        And we don’t?

                                                                                2. 3

                                                                                  And there is that “hide” button that @hwayne (and anyone else who feels the same) is welcome to use to hide the stories that so offend them. It was designed explicitly for that purpose. Don’t like the comments or story? Click “hide”. It’s not hard. There’s no need to penalize other people for enjoying a lively conversation.

                                                                                  1. 1

                                                                                    Under this process the story just won’t be on the frontpage as long. You’re not being penalized. You can still comment and get notifications that people are replying to you. It’s more inconvenient for everybody else to be expected to click hide on a story that’s attracting a lot of flamewars.

                                                                                    1. 1

                                                                                      Under this process the story just won’t be on the frontpage as long.

                                                                                      That would be the problem.

                                                                                      It’s more inconvenient for everybody else to be expected to click hide

                                                                                      That’s an interesting framing, and one that I reject. You have no idea how many people will find a thread or story bothersome or interesting, nor do you speak for the entire community. The “hide” button was created for exactly this reason, so use it, as I’m doing on this submission. Some other people might find it interesting, and they can choose to upvote instead.

                                                                                  2. 3

                                                                                    Absolutely agree of the danger of a small minority “burying” uncomfortable content in the graveyard of page 2.

                                                                                    1. 3

                                                                                      These are good points and I appreciate you bringing them up. I have a “conspiracy” that I can’t personally confirm but might be worth adding to the thought experiment to the people who have access to this information. I suspect this same group of people uses the lack of weighting to upvote brigade and create a scenario where the minority is already silencing the majority, essentially I would bet that the same people are the ones only contributing upvotes to those specific articles or topics and nothing else. It would be interesting to see if the same group upvotes anything else. Additionally, I would be curious to see the % of upvotes that come from a invite branch directly in that equation.

                                                                                    1. 14

                                                                                      I find it funny that most of these big tech companies claim they’re all in on going environmentally friendly, but yet you’re forced to throw a perfectly good piece of hardware into the trash after a few years. E-wasting doesn’t count because I feel most people don’t do this and e-wasting is arguably a joke. Most of your e-wasted stuff ends up on a boat to a developing nation where its ripped apart by hand and the toxic chemicals get into the local water supply.

                                                                                      1. 3

                                                                                        Consider a plausible alternative:

                                                                                        Assume that a big vendor builds its hardware thick/strong enough to last for ten years physically. Say a phone with thicker, stronger glass in front, a battery design sized for longevity, a strong case made of thick metal, and a stock of spare parts large enough that even the average customer uses the device for ten years, the demand for repairs is 95% likely to be met. Assume it sells millions, like the real devices in the real world. Assume further that most buyers replace it after two or three years anyway, perhaps because some new apps ask for newer, faster CPUs or more RAM/storage. How much glass, metal, chemicals did the vendor waste on building longevity?

                                                                                        It’s not obvious to me that catering to the people who want longevity is a net win over today’s state.

                                                                                        1. 4

                                                                                          What you are describing for a substantial part of this post is a rugged device, which is an entirely different class. You don’t need a strong metal case and a thick glass to keep a device safe that sits on the couch for most of the time.

                                                                                          No one disagrees that when someone sits on it, it’s a tradeoff to make whether it breaks or not.

                                                                                          The post is talking about software longevity, which is much easier to create.

                                                                                          1. 2

                                                                                            Actually, what I had in mind was a phone rugged enough to survive in a pocket for years without being bent out of shape or destroyed by a keyring, and with a battery designed to be charged n thousand times over many years instead of being designed for quick charging and maximum initial capacity.

                                                                                            Are phones carried around in pockets a parficularly rugged class of device? I think not.

                                                                                            EDIT: Wait, are you suggesting that manufacturers should provide software updates well after the end of a device’s expected physical lifetime?

                                                                                            1. 4

                                                                                              No, I’m suggesting that manufacturers should not block people from providing their own software updates.

                                                                                              1. 1

                                                                                                I think you mean “should not bootlock their devices”, right?

                                                                                                As I understand it (from idling in the LineageOS irc channel) the big problem of devices like the one in the blog post is that the hardware is buggy and there’s no documentation, not even a sensible git commit log for the kernel source. MediaTek in particular has a rotten reputation among LineageOS contributors. Some/many devices are also bootlocked and that could be a big problem, but in a way it isn’t. The comparable devices that aren’t bootlocked, or for which security bugs are well known, don’t have a lot of LineageOS ports, see?

                                                                                                Whether you’re killed by two bullets or three doesn’t make much difference, you’re just as dead.

                                                                                                You could of course demand documentation, sensible driver code and an open booter. That at least makes it simple to spot unsuitable vendors.

                                                                                              2. 1

                                                                                                My old dumbphone (a Sony Ericsson w710i) is still alive and kicking after almost 15 years. I’ve dropped it countless times, I carry it in the same pocket as my keys. Battery life is still pretty good (I charge it once a week or so). I would definitely consider it “rugged”.

                                                                                                1. 1

                                                                                                  Phone hardware tech took a giant step back in reliability with the advent of glass fronted touchscreens (don’t @ me). Older Nokias and Ericsson phones were really durable.

                                                                                            2. 3

                                                                                              Assume further that most buyers replace it after two or three years anyway, perhaps because some new apps ask for newer, faster CPUs or more RAM/storage.

                                                                                              I don’t think that’s a given. Games consoles come to mind - developers are able to wring more and more out of the same hardware over its lifespan. There’s lots of room for creativity given that kind of constraint, and I’d love to see it happen in mobile development.

                                                                                              1. 3

                                                                                                No doubt a global recession will facilitate this…

                                                                                                Consoles aren’t really analogous. The console makers often make decent amount of money from each game sold - the hardware is a loss leader - so it makes sense to provide games for as long as possible for each console generation.

                                                                                                Phone/tablet hardware makers (apart from Apple) don’t make much money after the initial sale.

                                                                                                1. 4

                                                                                                  Consoles aren’t really analogous. The console makers often make decent amount of money from each game sold - the hardware is a loss leader - so it makes sense to provide games for as long as possible for each console generation.

                                                                                                  They are - kind of. And they are a good example how long term stability yields improvements through giving people the possibility to gain experience.

                                                                                                  The price of the platform[1] is roughly stable and the sturdiness of the platform is a major part of marketing and success. They just selected their item margin to be negative. Still, they are constantly being changed internally.

                                                                                                  Apple is a good example on the high end: their margins after sale aren’t that high and they struggle to sell monthly services. They are actively moving to improve that. Google has also made the model work for them: they get fees from vendors for certification and have vendors build the hardware platform from them.

                                                                                                  One could say that consoles are a prime example of someone looking at the problem an making their business work early!

                                                                                                  [1]: For those interested, there’s a good interview on the background of the XBox 360 with their German marketing manager, sadly in German: https://www.stayforever.de/2019/12/xbox-360/. Just as an example: he makes the interesting point that consoles built out of standard components can’t drop in price over their lifespan as components need to be constantly changed - they will just not be fabricated anymore. That’s also the reason why HD sizes get bigger over the lifecycles: the vendors just don’t sell smaller ones anymore.

                                                                                                  1. 1

                                                                                                    Thanks a lot of expanding on this. Very interesting.

                                                                                                    FWIW I’m a satisfied Xbox user and I really appreciate how easy it is to acquire older games at good prices without having to hunt around for used items[1]

                                                                                                    [1] and yes I know this is probably bad for resale and for people owning physical media but it’s so damn convenient!

                                                                                                2. 2

                                                                                                  Of course it’s not a given. The question is how often it would happen, and whether the percentage would be such that the resource waste would be larger than the waste due to the actual short lifecycles.

                                                                                                  1. 1

                                                                                                    Games consoles come to mind - developers are able to wring more and more out of the same hardware over its lifespan.

                                                                                                    The problem is that developers aren’t targeting a ten year old device, they’re targeting at most two year old devices. As long as only a tiny portion of their target market is using old devices, this won’t change. In the console case, the developer could motivate the extra optimization work with the knowledge that all their users would see the benefit since they’re all using known hardware.

                                                                                                    It’d help if OS vendors would support devices for longer periods, of course. I think we’ll need to give them some slack for the initial period of mobile device growth, since device capabilities grew enormously year to year, but today I don’t it’s unreasonable to require OS updates for ten years.

                                                                                                    1. 1

                                                                                                      The problem is even worse then this: You don’t even have to look for old devices. Lower end devices are already in the range where you are targeting a spec from 5 years ago.

                                                                                                      Apple got this a little in check by reminding developers that the devices get beefier for more multi-tasking, not for one application taking more space. I still run around with an iPhone SE and have absolutely not performance issues - I just have to use less background services over an X. So developers in that ecosystem are already used to supporting at least 5 year old devices.

                                                                                                      But this problem is really hard if you want to enter the lower end market: Firefox OS for some parts tanked because it was mainly targeting cheap devices, a device class that well-paid developers would never use. For that reason, the reference devices were also much beefier then the deploy target, which lead to a very unusable ecosystem.

                                                                                                      There’s a huge underserved market untapped because serving the top end pays well enough.

                                                                                                      1. 1

                                                                                                        Yeah, I was imagining a world where mobile devices have a 10-year lifespan and 10-year release frequency to match. I’m guessing batteries are the main thing holding that back at the moment (edit: or they could just be replaceable).

                                                                                                  2. 3

                                                                                                    People can simply not use the device.

                                                                                                    The correct way to vote with your wallet when nobody makes an item that has the attribute you want (longevity) is to not buy any more. Instead, what most people do is buy a new item, and complain on the internet.

                                                                                                    Many times I have read and heard “watch what people do, not what they say”. Corporations do.

                                                                                                    As long as consoomers continue to consoom, companies will continue to produce.

                                                                                                    1. 1

                                                                                                      but yet you’re forced to throw a perfectly good piece of hardware into the trash after a few years

                                                                                                      at what point is it the ethical thing to do to force “perfectly good piece”s of hardware into the trash if not doing so compromises the security of how many “even better” devices. Is there a threshold? Is it based on the amount of securable but kept insecure devices? Is it based on the difficulty of the exploit? How do you measure that?

                                                                                                      I would argue that if supporting a device causes other devices to be less protected against attacks, then that initial device is not “perfectly good”, but is in-fact broken and needs to be fixed or replaced.

                                                                                                      While some attacks on TLS 1.1 are still very theoretical, we know that nation states probably have the means to break it at this point and if you keep supporting TLS < 1.2, then by the nature of downgrading attacks, you’re putting every device at risk, even if it would support later TLS versions.

                                                                                                      1. 23

                                                                                                        at what point is it the ethical thing to do to force “perfectly good piece”s of hardware into the trash if not doing so compromises the security of how many “even better” devices. Is there a threshold?

                                                                                                        The tablet in question is capable of running a present-day TLS stack. It doesn’t even really need ported; we’re taking about ARMv6 at worst, and raspbian already has a TLS stack working on that architecture. It just needs a release to be zipped up, signed, and distributed.

                                                                                                        This really has little to do with TLS, and nothing up do with the website operators. They’re following best practice to ensure that rogue ISPs don’t modify their page in transit. I blame the OEM, and partly blame Google for tying TLS stack updates to the OEM.

                                                                                                        1. 1

                                                                                                          And you blame the customer, right? I assume the customer bought a tablet without even trying to choose the vendor with the longest support lifecycle. The blog post doesn’t say “I picked the vendor with the longest support lifecycle.”

                                                                                                          EDIT: If that sounds unfriendly, that’s because my phone is from the vendor with the longest support lifecycle, and it’s not long enough for my taste, and I think that if more customers would care about the support lifecycle at the time of purchase then more vendors would promise two years and mine would promise four. Complaining years later is futile, just empty words. The time of purchase is when you can vote with your wallet.

                                                                                                          1. 3

                                                                                                            my phone is from the vendor with the longest support lifecycle, and it’s not long enough for my taste

                                                                                                            Jolla still provides SailfishOS updates for its original Jolla phone which was released about 6 years and a half ago, so you probably didn’t choose the vendor with the longest support lifecycle :).

                                                                                                            1. 1

                                                                                                              I don’t recall seeing any Jolla phones at the time (around September 2018).

                                                                                                            2. 2

                                                                                                              The post addresses this and points out that even if they wanted, they couldn’t modernise/service the device themselves. That is independent of the support lifecycle.

                                                                                                              1. 2

                                                                                                                In that case the question to ask at purchase time is whether they could modernise or service the device themselves, and the posting doesn’t say “I was careful to buy a tablet with an unlocked bootloader and no MediaTek SoC” either.

                                                                                                                1. 2

                                                                                                                  As suppliers rarely document their intended service period, this decision is hard to make. And this is essentially “blame the problem on the customer”.

                                                                                                                  1. 1

                                                                                                                    I didn’t have much problem finding a phone vendor with a documented period, and reports from third parties that “my” vendor’s period was the longest I could expect to find.

                                                                                                                    I suspect OP didn’t even bother to try, then complained about a lack of success.

                                                                                                          2. 3

                                                                                                            That’s a bad argument. Maybe some years ago it could have been decided that looking forward, TLS stacks should be easily upgradable. Maybe our whole OS design is flawed if we have to throw away heaps of just 2-3 year old devices if they can’t be reused. Oh wait, does anyone throw away a PC because they won’t get any updates to their OS? No, no one does.

                                                                                                            Maybe Android was a bad idea.

                                                                                                        1. 1

                                                                                                          The simplest way to craft a URN might be to simply use a cryptographic hash of the contents of the page, for example: urn:791f0de3cfffc6ec7a0aacda2b147839. This method doesn’t meet the criteria of the web community though, as it wasn’t really possible to figure out who to ask to turn that hash into a piece of real content.

                                                                                                          The URN format was ultimately finalized in 1997, and has essentially never been used since.

                                                                                                          Nice job completely snubbing the magnet uri, which solves the resolution problem (with the “address tracker” link) and is actually used sometimes.

                                                                                                          It still doesn’t solve the job of deciding whether two differing blobs of bytes are actually the same document (it has a search mechanism in the form of kt parameters, but I’m not sure how widely-implemented they are, and in any case it’s just punting to the application to hook a search engine), but it still has the advantage of being actually implemented, used, and of such a weird format that a lot of apps don’t even recognize magnets as being valid URIs.

                                                                                                          1. 3

                                                                                                            Honest question, why would you use a nvim in a GUI which functions like the nvim TUI?

                                                                                                            1. 12

                                                                                                              Reasons I do:

                                                                                                              • Ligature support
                                                                                                              • Animated cursor
                                                                                                              • Faster performance
                                                                                                              • Possibility of future graphical features such as blurred floating windows, frameless window, etc

                                                                                                              Reasons I’ve heard from other users:

                                                                                                              • Identical cross platform experience

                                                                                                              Terminal is great for some things, but these days I use neovim as my terminal emulator, so I guess I’d ask it the other way around. Why use TUI when you can have a terminal inside of neovim?

                                                                                                              1. 0

                                                                                                                Reasons I do:

                                                                                                                • Ligature support

                                                                                                                Notice that many terminals support fonts with ligatures. You can see a handy table of terminals on the FiraCode documentation: https://github.com/tonsky/FiraCode In particular, konsole, qterminal, Windows Terminal, kitty, iTerm, have full ligature support.

                                                                                                                • Animated cursor

                                                                                                                What do you mean exactly by that? the blinking of the cursor? I prefer non-blinking cursors but surely all terminals support blinking cursor.

                                                                                                                • Faster performance

                                                                                                                I seriously doubt that the terminal inside the editor will be faster than a native terminal. Do you have benchmarks for that? Anyhow, terminal performance is very rarely an issue nowadays.

                                                                                                                • Possibility of future graphical features such as blurred floating windows, frameless window, etc

                                                                                                                What are “blurred floating windows” and why would you want such an horrific thing?

                                                                                                                1. 7
                                                                                                                  • Ligature Support

                                                                                                                  On windows the only terminal that supports ligatures with any semblance of performance is the Windows Terminal which is a new app that has issues of it’s own and doesn’t have mouse pass through at all. Maybe I’ve missed others?

                                                                                                                  • Animated Cursor

                                                                                                                  The gui supports a smear effect on the cursor which helps the user track where the cursor jumps. I find in my usage that I lose track of the cursor in some cases. The readme has a good example of it. This helps with that.

                                                                                                                  • Faster Performance

                                                                                                                  The combination of ligature support and good performance is very difficult to get right. In my experience on windows, terminal emulation is very slow. This isn’t

                                                                                                                  • Blurred Floating Windows

                                                                                                                  Floating windows are a feature inside of Neovim which lets windows appear on top of other windows. Neovim also supports some amount of fake transparency of the background so that characters behind show dimly in the front. This effect is fun and interesting, but a gui should be able to blur the background of these floating windows so that the text is less distracting but the effect is still visible.

                                                                                                                  As mentioned in the other comment, you are being unnecessarily mean.

                                                                                                                  1. 6

                                                                                                                    Your tone is a bit dismissive. You could express your points more kindly.

                                                                                                                    As for performance, terminal latency is still kinda bad for many. See the benchmarks from danluu and others. I don’t think there’s any particular reason to believe that a neovim GUI should have worse performance than a terminal. They do similar jobs.

                                                                                                                    If you look at the readme, you will see what they meant by animated cursor.

                                                                                                                    1. 1

                                                                                                                      Having “full ligature support” on a feature list and actually doing it are very different things. Last I checked (june 2019ish) windows terminal, no Linux terminal i can find, and iterm don’t do ZWJ emoji sequences according to font rules (hacker cat comes to mind but there’s more) or various non-emoji double-width characters right. The only one I know that does (at least as far as my IRC usage and dadaist fish_prompt is concerned) is mintty/putty, and it’s unfortunately slow.

                                                                                                                      1. 1

                                                                                                                        cannot speak about windows, but I’m a happy user of FiraCode on linux terminals (qterminal and kitty), and ligatures have been working since a few years ago (when I first heard about them).

                                                                                                                    2. 1

                                                                                                                      Ligature support and animated cursors are good reasons, but is the GUI faster than e.g. Alacritty, which is GPU accelerated? Also, many terminals can have blurry backgrounds, frameless windows, etc. Identical cross platform experience is also a good reason if it works consistently cross platform.

                                                                                                                      Terminal is great for some things, but these days I use neovim as my terminal emulator, so I guess I’d ask it the other way around. Why use TUI when you can have a terminal inside of neovim

                                                                                                                      I also run terminals inside of Neovim, but it’s far from a tmux replacement. That’s why I use the TUI, to I can use it with tmux.

                                                                                                                      1. 9

                                                                                                                        I don’t know exactly how nvim’s embedding api works, but in principle it should be easier to achieve high performance with a purpose-built editor frontend than a terminal. Reason being that with vt100 all you have is a character buffer, so redrawing only dirty sections requires extra work and increases coupling. But in principle there’s no reason why one would have to perform better than the other, and alacritty has had a lot more work done on it.

                                                                                                                        1. 5

                                                                                                                          Terminals cannot do blurry backgrounds for the floating windows inside of neovim. I think in the end, it comes down to preference. tmux isn’t an option today on windows, so for me the neovim terminal emulation is miles further than anything else I easily have available.

                                                                                                                          Perf wise, its not nearly as good as alacritty yet, but we are working on it, and as mentioned above, alacritty doesn’t support ligatures which is where a lot of the perf cost exists today.

                                                                                                                          1. 3

                                                                                                                            How is tmux not an option on windows? I use tmux in mintty a ton

                                                                                                                            1. 1

                                                                                                                              Gotta use cygwin for that. I’m not a fan, but if you are into that, tmux works great :)

                                                                                                                              1. 1

                                                                                                                                There’s a WSL port (full disclosure, I haven’t tried it) https://github.com/mintty/wsltty

                                                                                                                            2. 1

                                                                                                                              Fair point, I switched to Linux completely, so I kinda forgot about Windows. But yeah, especially on Windows it’d be nice to have this Neovim GUI.

                                                                                                                        2. 6

                                                                                                                          The terminal literally emulates a decades old hardware design. Using that as a platform is a silly default.

                                                                                                                          1. 1

                                                                                                                            Your cells emulate a billion-year-old hardware design. Please, update to a non-silly platform.

                                                                                                                            1. 11

                                                                                                                              Oh, man. Just tell me how.

                                                                                                                            2. 1

                                                                                                                              The terminal is just too convenient to not use as a platform.

                                                                                                                              1. 6

                                                                                                                                The concept isn’t the implementation. One can imagine a text oriented user interface without multiple decades of legacy requirements.

                                                                                                                                1. 1

                                                                                                                                  Hmm, could you expand on how you’d envision that in a bit more detail? Because I’m unsure I completely understand.

                                                                                                                                  1. 3

                                                                                                                                    One could reconsider/omit:

                                                                                                                                    • The entire termcap/terminfo infrastructure.

                                                                                                                                    • The limitation of the vt100 and friends as a medium (strict cell boundaries, no graphics, everything like DBCS/UTF-8 being a graft)

                                                                                                                                    • The raw bytestream nature, using a more structured protocol, which could enable everything from low bandwidth form entry (the 5250/3270 reality) or rich objects in your CLI (think anything from Mathematica to PowerShell)

                                                                                                                                    1. 2

                                                                                                                                      The entire termcap/terminfo infrastructure.

                                                                                                                                      I’m unfamiliar with this infrastructure, what does it do and why is it bad?

                                                                                                                                      The limitation of the vt100 and friends as a medium (strict cell boundaries, no graphics, everything like DBCS/UTF-8 being a graft)

                                                                                                                                      Fair point, having the option to have these things would be a very welcome addition.

                                                                                                                                      The raw bytestream nature, using a more structured protocol, which could enable everything from low bandwidth form entry (the 5250/3270 reality) or rich objects in your CLI (think anything from Mathematica to PowerShell)

                                                                                                                                      Well, if everything would work using that protocol / interface it’d be nice, but raw bytestreams seem to be the ultimate backwards compatible “protocol”, if you could call it such. Having these battle-tested tools which are still usable and easily extensible is quite a boon. The cost of turning over to another system with a more strict protocol doesn’t seem worth the benefits to me personally.

                                                                                                                                      Maybe if there’d be awk-like tools which could parse raw bytestreams to these objects? If this was simple enough, it could provide the same kind of backwards compatibility and extensibility.

                                                                                                                                      1. 5

                                                                                                                                        Well, if everything would work using that protocol / interface it’d be nice, but raw bytestreams seem to be the ultimate backwards compatible “protocol”, if you could call it such.

                                                                                                                                        This is the part of the discussion that really annoys me, because it’s so misleading.

                                                                                                                                        You can just dump arbitrary bytes on a terminal, if you don’t mind it switching into an unpredictable mode, or even crashing. But in reality, there is a protocol made up of the ANSI escape sequences and your codepage (hopefully UTF-8).

                                                                                                                                        Well-designed CLI apps, like vim, will escape these streams just like web apps escape tag characters, for readability purposes, but more importantly to prevent clickjacking.

                                                                                                                                        There are also potential vulnerabilities on the input side, too. For example, what happens if your clipboard contains an ESC and you paste it into vim?

                                                                                                                                        1. 1

                                                                                                                                          I get your point, but that doesn’t take away that its backwards compatibility is unmatched. But rebuilding everything from scratch every x years takes a lot of effort which, most of us, are not willing to put in I reckon.

                                                                                                                                    2. 1
                                                                                                                            1. 7

                                                                                                                              Great write-up.

                                                                                                                              static linking makes binaries easy to deploy

                                                                                                                              I always wonder why Go gets the fame for this as if it’s the only language that can do this. You can statically link a C or C++ program. It’s not the default, but you can. There’s definitely something to be said for good defaults and how they encourage behaviour, but I’m still puzzled as to how Go managed to get this particular slice of the marketing pie.

                                                                                                                              when you make something simple, you move complexity elsewhere

                                                                                                                              This is a very good point, and one I’ve made before. Whatever logic your program needs to do is still complicated. Making the language simple just makes user code have to do more of the work. There’s a sweet spot, but that lies on different points in the spectrum for different people. Haskell is a step too far for me, and I like Haskell.

                                                                                                                              1. 12

                                                                                                                                You can statically link a C or C++ program. It’s not the default, but you can.

                                                                                                                                Defaults matter, especially in cases where you want to use others’ libraries, because there’s a decent chance that the non-default configuration doesn’t work. For example, glibc doesn’t support static linking at all, and more than a few other libraries only work with glibc.

                                                                                                                                1. 4

                                                                                                                                  Defaults matter

                                                                                                                                  I agree, which is why I mentioned how good defaults encourage good behaviour.

                                                                                                                                  1. 4

                                                                                                                                    I agree that defaults matter. That’s why I don’t use Go. The fact that print still exists, but prints to stderr is craptastic.

                                                                                                                                    Imagine if you asked for a knife to chop things for a salad, and someone handed over a simple kitchen knife. As you start to slice the tomato, you realize something is terribly wrong. You feel an edge blunter than a butter knife. You turn around to your friend confused, and they smack their forehead and go “ohhhhh, for a tomato! Hold on.” And they wander off to another room and bring back a chef’s block with a nearly identical set of actually sharp knives. “You just have to go get these from the pantry when you want actual sharp knives. We don’t keep them in the kitchen, for obvious reasons.”

                                                                                                                                    As a noob to the language, I was tinkering with some code. At one point, flipping between python and Go, I put a print() statement in Go. I then spent the next couple of minutes confused about why the next program in the pipe couldn’t see the output from my Go.

                                                                                                                                    For those that have never used Go or are just starting out: you need to import “fmt”, and then use fmt.Print. Yes, it’s in all the tutorials. Yes, you will likely still beans it up and use print() by accident, especially if you come from other languages. No, there aren’t any warnings when you do this and then go run or go build. Go just does something different for the concept of “print” and “println” in silence. I don’t need that kind “tee hee, GOTCHA!” in my life.

                                                                                                                                  2. 11

                                                                                                                                    I always wonder why Go gets the fame for this as if it’s the only language that can do this. You can statically link a C or C++ program. It’s not the default, but you can. There’s definitely something to be said for good defaults and how they encourage behaviour, but I’m still puzzled as to how Go managed to get this particular slice of the marketing pie.

                                                                                                                                    My theory is that it’s because Ruby, Python, and Node lowered the bar so tremendously on this that anything else is seen as a huge leap forward.

                                                                                                                                    1. 4

                                                                                                                                      and the c/c++ toolchains are not exactly easy to handle. i won’t even try to build something static that wasn’t intended to. that’s why many things which are distributed as binary use linker magic and ship their own set of libs.

                                                                                                                                    2. 2

                                                                                                                                      You can statically link C and C++, yes.

                                                                                                                                      But with Go you can also cross-compile that static executable with zero effort to multiple platforms.

                                                                                                                                      1. 2

                                                                                                                                        What does Cross compilation have anything to do with static linking or what I said?

                                                                                                                                    1. 5

                                                                                                                                      You can’t write functions with a receiver in a different package, so even though interfaces are ‘duck typed’ they can’t be implemented for upstream types making them much less useful.

                                                                                                                                      am i mistaken or does embedding the upstream type this, but in reverse? the composition is often overlooked in go, while it is one of the best things. not being allowed to fiddle around in other packages is a good restriction as this is a symptom for other problems.

                                                                                                                                      1. 4

                                                                                                                                        Yes, embedding types is one way to solve this in Go. Rust and Go are very different in this regard.

                                                                                                                                        In Rust, it’s common to extend a type with additional functionality using traits so you don’t need to convert between the types. In Go this isn’t possible. See this for an example. The basic AsyncRead provides low level methods and AsyncReadExt provides utility functions. It means that if someone else implements AsyncRead for a type, they can use any of the AsyncReadExt methods on it (provided AsyncReadExt is imported). Something like that just isn’t easily possible in Go to the same level because it’s only possible in Rust due to generics.

                                                                                                                                        1. 2

                                                                                                                                          if you extend a type, can your extension affect what the original code was doing? Part of the motivation for Go’s typing system is that it’s designed to avoid the fragile base class problem. As someone with little Rust experience, it’s not clear how extending types in Rust avoid a fragile base class scenario.

                                                                                                                                          1. 2

                                                                                                                                            The original code is unaffected. The alternative implementation is only available to code that uses the implemented trait and Rust doesn’t allow conflicting method names within the same scope, IIRC, even if they’re for two different traits on the same type.

                                                                                                                                            1. 1

                                                                                                                                              You can. But when you try to call such a method, if it is otherwise ambiguous, then Rust will yield a compiler error. In that case, you have to use UFCS (“universal function call syntax”) to explicitly disambiguate: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a602c67af78a73308808e9a45a51ead4

                                                                                                                                              One could argue Rust programs could suffer from the fragile base class problem via default method impls on traits. But it’s not something I’ve experienced much (if at all) in practice. Rust doesn’t have inheritance, so you don’t really wind up with complex inheritance hierarchies where this sort of complexity is difficult to manage.

                                                                                                                                              1. 1

                                                                                                                                                I’ve seen it happen with extension libraries like itertools that want to add functionality that makes sense in the base trait. It’s always possible to avoid it by using UFCS, but at that point you already lost method chaining and might as well use a free function.

                                                                                                                                                https://github.com/rust-lang/rust/issues/48919

                                                                                                                                            2. 2

                                                                                                                                              No, because traits are only available to use if they’re imported. So you’re not actually modifying the actual type, but extending it.

                                                                                                                                            3. 2

                                                                                                                                              I don’t know rust, but isn’t that kind of having io.Reader in go and other types which take io.Reader implementations and implement other functionality on top of that? Like bufio.Reader?

                                                                                                                                              1. 1

                                                                                                                                                Wrapping a type to implement an interface is somewhat similar. But in Rust, you do not have to write a wrapper to implement traits. E.g. have a method to reverse code points of a String you can just define a trait and implement it directly for String:

                                                                                                                                                trait ReverseCodepoints {
                                                                                                                                                  fn reverse_codepoints(&mut self);
                                                                                                                                                }
                                                                                                                                                
                                                                                                                                                impl ReverseCodepoints for String {
                                                                                                                                                  fn reverse_codepoints(&mut self) {
                                                                                                                                                    // Implementation.
                                                                                                                                                  }
                                                                                                                                                }
                                                                                                                                                

                                                                                                                                                After that you could just call somestring.reverse_codepoints() when the trait is in scope. It’s often more convenient than wrapping, because you do not have to wrap/unwrap depending on the methods you need (or write delegation methods).

                                                                                                                                                That said, there are some limitations in that the orphan rules have to be satisfied. Very roughly, this means that the implementation should be defined in the same crate as the trait or as the type the trait is implemented for. Otherwise, two different implementations could be defined for the same type. If you cannot satisfy the orphan rules (e.g. because the type and trait come from another trait), you do need a wrapper type.

                                                                                                                                                1. 2

                                                                                                                                                  This seems dangerous, since now users of the original type may not realize it has suddenly grown new talents.

                                                                                                                                                  1. 2

                                                                                                                                                    It actually doesn’t, because the function is not associated with the type. It’s associated with the pair of (type, trait).

                                                                                                                                                    You have to import the trait ReverseCodepoints before you can call it.

                                                                                                                                                    1. 1

                                                                                                                                                      Or, worse yet, that existing talents may have been redefined. (Is that possible?)

                                                                                                                                                      1. 2

                                                                                                                                                        Nope - and even if you could override an impl, the orphan rule would stop you overriding impls you don’t own.

                                                                                                                                                        1. 1

                                                                                                                                                          👍 Good to hear.

                                                                                                                                                    2. 1

                                                                                                                                                      thanks for the explanation!

                                                                                                                                                      It’s often more convenient than wrapping, because you do not have to wrap/unwrap depending on the methods you need (or write delegation methods).

                                                                                                                                                      usually the wrapped versions tend to be used from there on (at least the way i use them ;), so that’s not really an issue for me. i like the verbosity of go, which may be a bit unusual, but i like that things are written down explicitly.

                                                                                                                                                    3. 1

                                                                                                                                                      I had forgotten about interfaces somehow. Yes, sort of. But you’re limited to wrapping stuff one level at a time and you have to actually make new wrapper types.

                                                                                                                                                      1. 1

                                                                                                                                                        i kind-of like that in go i have to add new types for new functionality, but i see why traits may be good (without having written rust yet..)