1. 11

    I love criticizing C++; it’s become one of my favorite languages, but its flaws are extremely apparent. This “fqa” lists a lot of actual valid criticisms, but many of them are at best outdated, and many have probably never been correct.

    Here’s a few criticisms I agree wholeheartedly with:

    • The grammar is incredibly complex.
    • The compilation model, complex grammar, and lack of compile-time encapsulation make build times incredibly slow.
    • The type system is complex (which isn’t an issue in itself, a powerful type system is great, but error messages usually show insanely long type names).
    • There’s a lot of duplicate facilities; lots from C which are mostly-superseded by newer C++ features, and lots from new C++ features replacing old C++ features (scoped_guard replacing lock_guard, etc).
    • And more; C++ is far, far from perfect.

    Here’s some of the stuff that’s just wrong or outdated though:

    • The FQA keeps implying that garbage collection isn’t less efficient than C++‘s RAII. In many cases, it’s probably almost true, but in a lot of places, GC pauses just aren’t acceptable. Also, most of my interaction with Go over the last few months has been related to fighting the GC.
    • Saying that “C++ manual memory management is inherited from C without changes” couldn’t be further from the truth. Granted, in the past it might have been true that people wrote C++ like C but with new/delete instead of malloc/free, but in anything resembling modern C++ code, you never need to use raw new/delete in practice. Thinking of ownership, and expressing it using the type system, turns out to be a really powerful paradigm for managing memory.
    • The “No high-level built-in types” point is outdated. You can, in fact, write std::vector myvec{1, 2, 3} or std::map<std::string, int> vec{{"a", 1}, {"b", 2}, {"c", 3}}; these days.
    • A lot of the gripes about unmanaged languages in general are way less relevant now that we have great tools like the address sanitizer (and valgrind, although valgrind isn’t always practical given the extreme runtime performance hit).
    • The “defective operator overloading” point seems wrong. You have to return your results “by value”, but that “value” could be a struct with only a pointer and a destructor (which is what you get by returning a unique_ptr, and essentially what you get by returning a std::string). Nobody actually makes the “code copy massive temporary objects and hope to have them optimized out by our friend the clever compiler”. (Operator overloading-based string concatenation has its own set of issues, but not related to a lack of GC.)
    1. 4

      Saying that “C++ manual memory management is inherited from C without changes” couldn’t be further from the truth. Granted, in the past it might have been true that people wrote C++ like C but with new/delete instead of malloc/free, but in anything resembling modern C++ code, you never need to use raw new/delete in practice. Thinking of ownership, and expressing it using the type system, turns out to be a really powerful paradigm for managing memory.

      The problem is that C++ has no single model for memory management. It has multiple models, meaning you have to think hard thoughts about what happens when objects allocated different ways contain and refer to each other. This is part of C++’s greater lack of conceptual unity.

      1. 1

        You’re probably right in many situations, but it doesn’t match my personal experience of the language. In all code bases I’ve worked on, the assumption is that the destructor frees all resources owned by the object. That, combined with actually thinking about how your system’s ownership works, and utilities like unique_ptr, turns out to be really powerful.

        I don’t think I’ve ever written a large C program where I haven’t had to debug memory leaks, but I still haven’t written a C++ program with a memory leak (and I would’ve known, because I always run my C or C++ programs with -fsanitize=address and/or valgrind while developing or testing).

        Note that when I say “the destructor frees all resources owned by the object”, I don’t mean that I have personally written destructors which free resources. Sure, that’s occasionally necessary, but in the vast majority of cases, my classes’ heap-allocated memory is managed by std::unique_ptr, std::vector, std::vector<std::unique_ptr>, or other RAII-style types, and I don’t have to even define a destructor.

    1. 38

      I sent the link to this post, via DM only, to three of the admins with a short note. Not 10, not 100, not a random project: three of the admins of a project in which I am already a participant.

      Within 60 seconds of linking these users to my own webpage, Discord deleted my account.

      No third-party service should be in a position to be deciding for you what your group membership should be allowed to communicate with each other.

      According to the message, people flagged your DMs. That’s not really “censorship”, that’s removing a member considered disruptive by the community. Frankly, I’d do the same if random strangers started DMing me with “this service sucks, you should use something else”.

      Regardless of whatever merit your points against Discord may have, it seems you don’t realize just how disruptive your “advocacy” is perceived by many. Going around telling other people what they “should” do is what people mean with “Open Source entitlement” and quite literally why people get burnt out by being an Open Source maintainer.

      I strongly urge you to reconsider your approach. It will benefit everyone, including yourself since it will be much more effective. It’s a win-win.

      free software-adjacent teams and groups, such as hackerspaces, art camps, and other DIY undertakings should always question falling by default onto the “buy” side of “build vs. buy”. DIY or die! Run your own!

      Are you doing to do the legwork and front the server costs, too? “DIY” isn’t about telling what other people should do, it’s about … doing it yourself.

      If I was unhappy with the communication platform of a project, I’d compile a list of advantages switching would have and offer to help and/or pay. I don’t want to gatekeep “DIY” here, but in my view that’s the “true” DIY way.

      1. 12

        According to the message, people flagged your DMs. That’s not really “censorship”, that’s removing a member considered disruptive by the community. Frankly, I’d do the same if random strangers started DMing me with “this service sucks, you should use something else”.

        Nothing in that email from Discord says people flagged my DMs. I’m also not a random stranger—I am an active participant in that project. I didn’t disrupt anyone or anything.

        If you read the suspension message carefully, it claims that my account violated the ToS—it did not. It was not the result of messages being flagged. They are using the term “the Discord community” as a stand in for Discord’s automated spam detection, which no-questions-asked censors young/new Tor-created accounts that send three similar messages containing the same link in a short period of time.

        Regardless, it’s still censorship when Alice tries to privately message Bob and Mallory decides “Bob isn’t allowed to see this message” and prevents it from reaching its destination, leaving Bob in the dark. That’s pretty much the dictionary definition of censorship. It’s my opinion that Alice and Bob should seriously reconsider their choice of association with Mallory in that instance.

        Regardless of whatever merit your points against Discord may have, it seems you don’t realize just how disruptive your “advocacy” is perceived by many. Going around telling other people what they “should” do is what people mean with “Open Source entitlement” and quite literally why people get burnt out by being an Open Source maintainer.

        I think perhaps the first line of my post was garbled in transmission. I’m not telling anyone to do anything.

        I’m telling people what they should not do: that is, don’t discriminate against people who insist on privacy.

        Choosing to use Discord does that, so people who don’t want to discriminate should not choose to use Discord.

        I’m also offering them alternatives that don’t discriminate against those people, so that they can make better choices if they decide that they don’t want to be the kinds of projects that discriminate against segments of their userbase.

        I feel like it’s a little bit of a stretch to go from “please don’t discriminate against and exclude me and others like me from participating”, which is basically the message in my post, to “open source entitlement”.

        Are you doing to do the legwork and front the server costs, too?

        I mention on the page that the server costs for such things are on the order of $5 per month for most teams.

        I’d compile a list of advantages switching would have and offer to help and/or pay

        There is an explicit offer of expert help at the bottom of the post, including my direct email address and telephone number, and it has been sitting there on the page since before you left your comment. :)

        I have also donated approximately 5-6 years worth of server hosting expenses, anonymously and in cash, to a local nonprofit I am attempting to convince to switch away from Discord, and have offered to personally manage and document 100% of their migration for free—time for which I would bill a theoretical customer in the mid to high five figures.

        1. 36

          Although I’ve been working as a programmer now for many, many years, prior to that I studied, and received a degree in, philosophy.

          The chair of my department was a Kant scholar, and taught many of the courses in ethics and moral philosophy, and there was a saying he was fond of, to the effect that there are two great traps, or errors, in moral philosophy, which are easy to fall into and difficult to climb back out of. The first trap is concluding that there is no correct moral system. The second trap is concluding that there is, and that you have found it.

          You appear to have fallen into the second trap, and this has had a negative impact on your interactions with other people. For example, prior to falling into the trap, you likely would have recognized that sending unsolicited messages to multiple people promoting your blog post is behavior that those people – and probably most neutral observers – would consider spamming. After falling into the trap, you are unable to see this. After all, you are bringing them the truth and the light and the good word! You are like Moses, descending from the mountain bearing the commandments: how could it be incorrect to share such an important message with others? Surely it must be the other people who are at fault if they react negatively.

          My suggestion to you would be to spend some time working on trying to see this situation from the perspectives of other people, rather than only from your own perspective. To help with that, perhaps consider Kant’s categorical imperative, and consider what the world would be like if your approach were to be made universal. Would you enjoy living in such a world, constantly being bombarded by others’ unsolicited manifestos, constantly being ordered by others to stop doing things they consider immoral, and, if you objected, being told that you are the one who is acting wrongly? I do not think you would find such a world to be pleasant, nor would you find it moral. Think on the lesson that example offers.

          1. 10

            I’m reasonably sure that I just did read an unsolicited manifesto on morals, when I read your post. It is all too easy to stand on a soapbox and become morally superior to others. And if Moses did exist, and if he really did receive instructions from Jehovah, then we must keep in mind that immediately upon coming down from the mountain, he had a fight with his brother over morals and ethics. (We must also keep in mind that evidence suggests that Moses is mythical and that the Exodus did not really happen. It is all too easy to draw moral lessons from myths.)

            On Freenode, if I attempt to privately message somebody, and they are not interested in receiving private messages from me, then I am not instantly banned upon my attempt, but instead notified that the recipient has caller ID enabled and will not be receiving my message.

            In a world where it is universally recognized that Discord is actively interfering with and shaping its user base, perhaps people would not use Discord as often. And that’s all that’s really been asked for.

            Finally, on morality, let us not forget Pirsig. Pirsig morality is the fact that atoms obey the laws of chemistry. It is the Kochen-Specker theorem and the Free Will Theorem. Pirsig said that humans are morally free to do what they want/will/desire, but that humans are inherently not as moral as the ideas which they espouse. At the low level, there are few degrees of freedom, but they are clear and easy to see; when we get up to the level of humans and ideas, there are so many degrees of freedom that the possible moral actions of humans become a continuous spectral palette of moral positions. The typical moral action of a human is to think, and in thinking, be acted upon by ideas, in order to create an emotional context for spurring physical actions.

            Why do I mention Pirsig? Because of this Pirsig quote (from memory):

            It is more moral to kill a man than an idea.

            On one hand, Discord is moral in their choice to be heavy-handed on reputation and moderation, and even moral in their choice to deliberately delegate moderation so as to make each Discord “server” a small fiefdom ruled by jealous gamer overlords. On the other hand, the author, myself, and others are moral in our choice to speak out against and criticize Discord’s design and actions. I think that we value the idea of not living in a police state and not having our mail read, and this idea contrasts sharply and precisely with what Discord’s tools and staff appear to be doing here.

            1. 16

              In a world where it is universally recognized that Discord is actively interfering with and shaping its user base, perhaps people would not use Discord as often. And that’s all that’s really been asked for.

              OP has admitted now that what actually happened was connecting via a service designed to hide the origin of traffic, and immediately firing off multiple DMs containing links to different users. I would actively refuse to use any service that didn’t at least treat that as highly suspect – the odds of that behavior indicating a spambot are ludicrously high.

              Unless you and OP truly believe that it is deeply and reprehensibly morally evil – so evil that you yourself suggest homicide as a preferable alternative – to have systems in place which automatically detect and act on patterns of behavior that are overwhelmingly like to be spam, I’m not sure there’s even a case left to make here. All that’s really left of OP’s argument is a set of desired stances for Free software projects, which would inevitably exclude certain segments of the population (but, notably, not the segment OP belongs to, which apparently makes it acceptable).

              1. 1

                desired stances for Free software projects, which would inevitably exclude certain segments of the population

                Which segments do those desired stances exclude? Are you saying that the communication systems that adhere to these desired stances are inherently user-hostile compared to proprietary, more restrictive systems like Discord?

                1. 1

                  Some of the proposed alternatives (specifically IRC) are much less user-friendly than Discord.

                  To get a feature like chat persistance, the user will have to either

                  • set up a bouncer (usually requires access to a server)
                  • use WeeChat/Glowing-Bear (ditto)
                  • pay for IRCCloud
              2. 7

                I’m reasonably sure that I just did read an unsolicited manifesto on morals, when I read your post.

                Maybe I’m picking nits… but I do believe I’d consider clicking through to a discussion thread about whether a tool is acceptable for those who value freedom and privacy tantamount to soliciting a manifesto on morals.

                “X is not acceptable for free software” is something that makes me expect that some moralizing and probably at least one manifesto lies on the other side of a link, anyway.

              3. 5

                For example, prior to falling into the trap, you likely would have recognized that sending unsolicited messages to multiple people promoting your blog post is behavior that those people – and probably most neutral observers – would consider spamming.

                Well, it turns out I have an existing relationship with these people. I wasn’t spamming anyone.

                The people to whom I sent the messages never had an opportunity to object to them. They didn’t flag them. They didn’t even see them. Discord’s software decided that because I was a new user, and I was connecting via tor, and I sent the same link to three different people within five minutes of signing in, I must be a spammer and be silenced.

                That’s called censorship.

                Regardless, this is a red herring. The main issue is that choosing to use Discord is exclusionary and discriminatory, regardless of whether they censor messages or not.

                1. 33

                  Discord’s software decided that because I was a new user, and I was connecting via tor, and I sent the same link to three different people within five minutes of signing in, I must be a spammer and be silenced.

                  That seems like a perfectly reasonable conclusion for their software to draw.

                  1. 25

                    That’s called censorship.

                    It really, really isn’t.

                    1. 1

                      It absolutely is. Most censorship is not government censorship. It’s also not universally bad: for example, we self-censor to avoid being unkind to others.

                      1. 15

                        If your working definition of censorship is so broad as to encompass anti-spam measures like rate limit violations, then let me suggest that it is not a useful definition in this conversation.

                        1. 2

                          On the contrary, the fact that legitimate anti-spam measures can be used to block the legitimate sending of messages by people seeking to keep their physical and network location private means that the definition of censorship should definitely include anti-spam measures.

                          1. 7

                            Let me make my point in a different way:

                            because I was a new user, and I was connecting via tor, and I sent the same link to three different people within five minutes of signing in, I must be a spammer

                            This isn’t “legitimate sending of messages” — it is actually spamming.

                            1. 3

                              I don’t think these measures “are being used to block legit sending of messages”, rather, these algorithms block you because your behaviour is virtually indistinguishable from someone sending illicit and abusive messages. Lots of legit email is being blocked by spam filters because the sender lacks DKIM and Reverse DNS, but it’s simply because people not having those is a very sure sign that someone is spamming so you block them without wasting additional CPU on it.

                              If your behaviour is identical to abusive behaviour then I don’t see why you get a free pass for your behaviour relating to a “righteous cause” like free software.

                      2. 10

                        Seems like their spam detection algos are pretty good. Spam detection and prevention (actual spam, not false flags) is one of the shortcomings of IRC and other “anonymous” platforms.

                        1. 0

                          If they were pretty good, they would not get such an obvious false positive.

                          The point was that you should use tools that do not give third parties the ability to read your private messages at all.

                          1. 7

                            So, I don’t like when foss communities use discord (or slack for that matter) either. However, what you’re describing - creating a new account via tor and then immediately sending the same message with a link to three people - sounds like exactly what most spammers I’ve seen will do. What makes you say it’s an obvious false positive (from the perspective of spam detection software)?

                    2. 13

                      Are you doing to do the legwork and front the server costs, too?

                      I mention on the page that the server costs for such things are on the order of $5 per month for most teams.

                      I help run a hackerspace. It has about 75 members and they are all volunteers. We do not have the money for real employees, we do not have on-call support, and it is not uncommon for people to get busy with Real Life Stuff and just disappear for a month or three at a time. If the floor gets swept, it’s because someone decided to pick up a broom and help out.

                      At a guess, members are about 30% professional techies of various types (engineers, academics, technicians, mostly in non-computer fields), about 40% interesting but non-tech people (that hippie who makes cool laser cut art, the cosplay guy who builds a full Iron Man suit, etc), and the rest are interested amateurs who just like playing with different stuff. There are a grand total of three people there who I would actually trust to run a server people rely on, I’m one of them, and I go there to get away from that shit. We can and do run several servers, but they’re all things like an internal NAS or shop IoT system that are toys to play around with and not essential services. We have a VPS that runs our website and a couple other mission critical things, but only a few people have access to it and working with it is not much fun so usually we don’t touch it.

                      Chat is an essential communication medium for this place. There was a fire on our block last year and chat was how we notified people and coordinated stuff. For chat we use Slack. Slack is free, it never breaks, and if it does break we don’t have to fix it. It has an interface a child can set up and use, the client never breaks either, and it takes a new member who isn’t a computer guru about 2 minutes to set up an account.

                      I would love to be able to point people at a Matrix server instead, but last I checked it can’t do all the things Slack can and all the clients I tried were buggy, slow, incomplete, or otherwise unpleasant to use – though this was a year or two ago now, maybe it’s better now. That was the time at which we looked at various chat services and chose Slack though. If we ran a server ourselves, we would need to have someone responsible for babysitting it. I don’t see any commercial services we can buy Matrix hosting from, and a custom managed services setup would probably run $hundreds/month. And even then, we’d have to redo a dozen channels, a couple bots, Google Calendar integration, and get 75 people to switch chat programs.

                      Maybe we can do this someday. Maybe even someday soon. But the costs are far greater than the $5/month for hosting.

                      1. 2

                        I believe Slack can be used easily via Tor, and does not demand a phone number to join a group, so users who need privacy of their personal data (IP/location) would not be excluded from participating in your group.

                        The risk of logged DMs remains, but that is a smaller risk. Discord is much more censorship-heavy.

                        Look into Mattermost and a hidden service.

                        1. 6

                          Slack includes your email address in the profile, forcibly.

                          1. 1

                            You can generate new emails that are not linked to anybody’s account. The article wasn’t about don’t use slack after all, just how it’s not as preferred.

                            1. 2

                              And how many users will do that? If privacy preservation is important to you and you want to be a trustable service provider, you can’t have any situation of “the user accidentally omitted that”. Especially as the user must be pre-informed of that behaviour and have the ability to draw this conclusion before using it.

                              Also, I’m replying to a comment on Slack, so I don’t know what the point about the article is.

                      2. 7

                        I have also donated approximately 5-6 years worth of server hosting expenses, anonymously and in cash, to a local nonprofit I am attempting to convince to switch away from Discord, and have offered to personally manage and document 100% of their migration for free—time for which I would bill a theoretical customer in the mid to high five figures.

                        From the view of a well-managed nonprofit, this reads as: if that person goes away or changes their view on things, there’s the risk of mid high five figures costs.

                        1. 3

                          Discord is not yet a profitable company with a sustainable revenue model.

                          GP has those risks presently, PLUS privacy/discrimination/censorship issues for all of GP’s users.

                          GP says it’s a volunteer organization. Then you say that someone volunteering to do the work is a risk.

                          Running communications tools is about 20-40 hours per year. Can management not extract redundant commitments from reliable members to serve as someone’s understudy in the case of disaster?

                          1. 3

                            GP says it’s a volunteer organization. Then you say that someone volunteering to do the work is a risk.

                            Is the mission of this organisation running a chat service? If not, even in a volunteer organisation, the prime goal is that volunteers can work on the mission.

                            Running communications tools is about 20-40 hours per year. Can management not extract redundant commitments from reliable members to serve as someone’s understudy in the case of disaster?

                            20-40 hours for a skilled person, especially if you have security standards. Finding someone to keep this server safe and secure and is on-call if it breaks is hard.

                            There’s a reasons why even collectives that focus on making communication their mission, like system.li shut down their service on major demonstrations to inform people that they cannot be trusted to not be compromised on some level.

                    1. 7

                      Please don’t use JavaFX, Swing, Tk, FLTK — anything without Wayland support. Just don’t.

                      I would prefer GTK 3 (or even the very exciting WIP 4.x branch of GTK, which brings GPU rendering to all the classic widgets we know and love, unlike Qt which created a whole new world (QML) for this) but here’s some more options:

                      wxWidgets, libui, Eto are there for abstracting over native toolkits. (btw, since you mentioned IDE-like things, this Eto project uses various native code editor components)

                      If you go with the web route, there are better ways to do it than Electron. web-view uses GTK/Cocoa native WebKit and EdgeHTML on Windows — tiny executables without dragging a whole Chromium copy around, automatic Wayland support (due to GTK), etc. Tauri is a higher-level thingy around web-view.

                      1. 8

                        Please don’t use […] anything without Wayland support. Just don’t.

                        I have no interest in supporting wayland. And for people who want to use it, xwayland is good-enough.

                        Someone else mentioned libui is not feature-complete yet. Eto is interesting, I will take a look at it.

                        1. 1

                          xwayland is good-enough

                          No. Most importantly it does not support HiDPI. It’s legacy cruft, I usually keep it off. I’d like to eventually get rid of all X11 libraries on my system completely.

                          1. 2

                            You’re free to do that, of course. But X11 is not ‘legacy’. It’s a standard across a wide range of Unix-like systems. It’s not going anywhere any time soon. Wayland still doesn’t have a standardised way to do basic desktop things like take screenshots.

                            1. 2
                              1. -1

                                That’s very nice for Android phones but they have nothing to do with desktop systems.

                                1. 3

                                  I think you will find plenty of folk use or will use an ARM SBC for a desktop system.

                              2. 2

                                I don’t think the question of “Is X11 legacy cruft?” is interesting; it is what it is, and it’ll stay with us for a while. However, the problems with XWayland are very real. It doesn’t support HiDPI, input is sometimes wonky, features which expect there to be one X server used by all clients don’t work, etc.

                                Wayland desktops have protocols for most things, they’re mostly at feature parity with X11. You’re right that many of those protocols aren’t standard though, which sucks. There’s a lot of protocols which aren’t standard but still implemented by every serious Wayland desktop - except for Gnome.

                                Gnome usually just implement their own completely different protocols, and Gnome is one of the biggest obstacles to Wayland adoption imo. Lots of Wayland software either works only on Gnome, or on everything other than Gnome.

                        1. 31

                          One thing that is not specified is the language choice. E.g. if the language is Java, you are probably limited to JavaFX, SWT, AWT, or Swing.

                          But generally speaking: Qt. Has matured over 2.5 decades. Has a reasonable look & feel on macOS and Windows, is native to Linux (at least KDE). Has a large set of traditional widgets. Has a GUI builder (Qt Designer) where you can just drag and drop widgets. You can generate a class from the Qt Designer .ui files. The Qt with C++ learning curve is quite steep if you don’t know C++, but there are two awesome Python bindings (PyQt and PySide). The Python bindings also have the benefit that they integrate with things like matplotlib (which has a Qt backend). In contrast to all web solutions, Qt applications can be lean.

                          Background: I have used both Gtk+ and Qt for applications. I prefer Qt by a large margin, it’s better in almost every aspect: better widgets, better documentation, more logical, better look & feel in Windows and macOS. The big thing that Gtk+ has going for it is that it has bindings for more languages (since Gtk+ is written in C, it is easier to bind). So, for Rust applications I use Gtk+.

                          I absolutely hate Electron/web apps. But you should probably consider it, given the amount of documentation and the size of the communities.

                          1. 3

                            Totally agree about Qt. Qt also comes with networking and core library with regexp, etc. support.

                            1. 1

                              One thing that is not specified is the language choice. E.g. if the language is Java, you are probably limited to JavaFX, SWT, AWT, or Swing

                              Like I said in the title, I don’t care that much about language, I just want the best gui creation experience.

                              1. 1

                                Isn’t the licensing around Qt super complex though? It might work if OP is making a FOSS desktop app, but for any other situation I’d be extremely worried about licensing stuff.

                                1. 2

                                  Complex and constantly shifting, as they keep trying new (often shady-seeming) ways to monetise.

                                  1. 1

                                    If you’re doing it for money you might be in a position to pay for a licence (and get the less-buggy edition to boot).

                                  2. 0

                                    what about cairo?

                                    1. 4

                                      Isn’t that more of a graphics primitive library (can draw shapes, curves, etc.) than a gui library?

                                      1. 1

                                        Yes, it’s just an immediate-mode API to draw things on a surface. It is an excellent base on which to build a gui library, but there’s a lot of work between those two places.

                                  1. 10

                                    This sadly feels like C++ will be bound by the part of the industry that just wants to live on legacy forever. So we’ll probably need to sacrifice C++ to them and use something new, if we want a modern C++.

                                    1. 7

                                      There are only two kinds of languages: the ones people complain about and the ones nobody uses.

                                      -Bjarne Stroustrup

                                      The commitment to backwards compatibility is one of the major reasons why C++ has gained such high adoption in industry. C++ is certainly not my favorite language, but being able to compile and run code from two or three decades ago without modification is massively important for infrastructure development, and few languages have demonstrated the same compatibility guarantees seen in C++.

                                      1. 4

                                        That Bjarne’s quote is annoying. It is obviously true (almost tautological), but completely sidesteps whether the complaints are valid or not.

                                        Backwards compatibility with problems of the past was already a hard constraint for C++98, and now there’s 20 more years of C++ additions to be backwards-compatible with.

                                      2. 6

                                        d and rust are both solid options for a modern c++ if you don’t need the backward compatibility. as others have noted, legacy support is one of the major selling points of c++; there is no reason for them to give that up.

                                        1. 4

                                          Explain please. Why do you think that? I only see new tools to use but my projects are my own.

                                          1. 6

                                            It’s regarding the non-breaking of the API and rather deprecation of std::regex etc. They’re not breaking it because apparently the industry will fork it otherwise. So we’re stuck with some bad decisions like forever.

                                            1. 2

                                              because apparently the industry will fork it otherwise

                                              Don’t they already fork it? Almost every C++ project seems to have some reimplementation of part of the standard library.

                                              1. 1

                                                There’s a really big difference between forking the standard (whatwg-style) and avoiding a few of the features of the standard library in favor of your own alternative implementations.

                                                1. 2

                                                  I very much doubt you’d see an industry fork. The companies with sufficient interest in C++ and the massive resources required to develop compilers are probably the ones pushing C++ forward.

                                                  What you would be more likely to see is some companies that just stop upgrading and stick with the latest release which doesn’t break compatibility.

                                                  If you did see any non-standard developments to said release, I expect they would be minor and not widely distributed. Those who are resistant to change are unlikely to be making big changes, and until relatively recently C++ has had very little in the way of a community that might coordinate a fork.

                                          2. 4

                                            Legacy code is code that’s worth keeping running. A significant part of C++’s value is in compatibility with that code.

                                            Causing an incompatibility that would be at the kind of distance from C++ that Python 3 was from Python 2 just isn’t worth it. If compatibility constaints are loosened more, Rust already exists.

                                            1. 3

                                              Legacy code is code that’s worth keeping running.

                                              Sure. The question is whether we have to keep punishing newly written code and new programmers (who weren’t even alive when C++’s poor decisions were made) with it.

                                              1. 2

                                                A language called “C++” but incompatible with the C++ that existing code bases are written in wouldn’t solve problems for new programmers working on those code bases. That is, you can’t change a language spec and fundamentally alter design decisions that existing code already was built on.

                                                Constraints on newly-written code depend in how the new code intermingles with old code. New code interleaved tightly into existing C++ code is constained by existing C++. For code that doesn’t interact with C++ at all or interacts with C++ through a sufficiently identifiable interface doesn’t have to be in a language called “C++”.

                                            2. 3

                                              Agreed. I believe that this kind of “modern C++” is Rust; there just has to be a way to keep C++ experts and their design mentality away from core development. Otherwise Rust will end up like C++.

                                              1. 3

                                                I’d disagree with a characterization that Rust is a modernized C++. I believe there are things in Rust that the people building C++ would love to have (epochs for example are a hot topic in that thread), but I don’t think it’s the language they would build if they could get out the chisel and compatibility break away not only ABI but maybe even syntactic decisions and more. Despite the lack of commitment so far to measly ABI breaks, with some of what’s seemingly in the pipeline really just transforming a lot of the day-to-day of working with C++, maybe all you’d need to end up with a “modern C++” is sort of a, uh “C+”. My personal choice for trimming to create a C+? Kill preprocessor directives with fire!

                                                1. 1

                                                  I could have said more precisely:

                                                  Rust is what C++ developers need. It’s not necessarily what they want.

                                                2. 1

                                                  …there just has to be a way to keep C++ experts and their design mentality away from core development. Otherwise Rust will end up like C++.

                                                  This comment makes me a bit sad. I understand the point that @soc is making, but I don’t think that the Rust community should ever be built on a foundation of keeping people out. The C++ community certainly struggles with a culture of complexity, but there is a lot that the C++ community can bring to the Rust community and vice versa.

                                                  1. 2

                                                    That and a lot of Rust’s core team are C++ experts already.

                                                    1. 1

                                                      Every language is built around a set of values that result in a self-selection process for potential adopters:

                                                      • The language has bad documentation? Keeps out people who think documentation is important. (See Scala.)
                                                      • The language keeps adding features? Keeps out people who think that adding more features does not improve the language. (See C++, C#, JavaScript, Typescript, Swift, Rust, …)
                                                      • Etc. etc.

                                                      For instance point number 2 – I have decided that Rust 1.13 is roughly the max language size I’m willing to deal with when writing libraries.

                                                      I have subsequently skipped all newer Rust versions and the features that were added in those versions. I can’t really “un-adopt” Rust, but I think I’m pretty far removed from usage that Rust devs would consider “mainstream”.

                                                1. 10

                                                  It’s interesting to me how — apart from the usual fanboys — I still haven’t seen any unequivocally positive feedback about Mac OS Catalina.

                                                  To be honest, we see these blog posts and criticism with every release of macOS (since Snow Leopard). They also confirm my experience – every macOS release is buggy, often terribly buggy, for the first 3-6 months. Usually most bugs start getting fixed in the second half of the cycle and once the next release comes out, the old release is pretty ok.

                                                  For one thing, it shows that the yearly feature dump approach, which primarily serve to hype up the keynotes, does not work. They should either go back to 2-3 year cycles like before Snow Leopard or switch to some rolling release, possibly with a perpetual beta for people who don’t mind things to crash and burn.

                                                  1. 6

                                                    I strongly agree that yearly the “feature drop” releases aren’t working out well for quality. Seems to be getting worse, in my personal experience, as the number of platforms (ios, watchos, tvos, macos) has grown.

                                                    1. 2

                                                      Indeed. And since they don’t have a dedicated macOS team anymore (which wend hand in hand with the platform expansion). So, after the feature drop, fixing the fallout on iOS has their highest priority and macOS tickets are probably deprioritized in favor of iOS tickets.

                                                      1. 1

                                                        This is the correct business decision for Apple.

                                                        It wouldn’t surprise me to learn that the Mac hardware and software is a net loss for the bottom line, and is only kept for reasons of prestige.

                                                        1. 5

                                                          I think that’s BS. There’s a ton of companies making a profit off of laptops and desktops, most of them with way lower prices and lower margins that Apple. Granted, Apple probably invests more into their software and hardware than most, but they also made 7 billion dollars on the Mac alone in Q4 2019 according to https://www.statista.com/statistics/263428/apples-revenue-from-macintosh-computers-since-first-quarter-2006/. If you’re not turning a profit from 5-7 billion per quarter, something is seriously wrong.

                                                          1. 2

                                                            Throwing more personnel at dev teams, which is I assume what you implied by suggesting they dump more money on the problem, frequently doesn’t pay off short term. In fact, the opposite is usually true in the short term — this goes all the way back to Brooks. It takes time to train new people, more people increases communication overhead (combinatorial edge complexity?), and so on.

                                                            They probably just need to slow the heck down a bit with the release cycle.

                                                            1. 1

                                                              I’ll have to take your word on it regarding how much profit they made as that link is paywalled for me.

                                                              But in the end, it’s not how much money they made last year. It’s about how much money they’re expecting to make in 5 to 10 years off the Mac and macOS.

                                                              I suspect analysts are more clear-eyed/cold-blooded with regards to the long-term prospects of macOS. If Apple were to devote a larger percentage of its resources towards a stagnant or declining product segment, this could lead to bad reports from them.

                                                              1. 2

                                                                I think the problem is that even though the Mac is probably hugely profitable comparable to other desktop/laptop lines, the iPhone market (+ associated products, such as Apple Watch, Airpods, iPad) has become so large compared to the Mac, it’s barely a blip on their radar. Added to that are C-level executives that use nothing but iPhones and iPads and somehow believe that the iPad (as it is) can replace desktops and laptops.

                                                                The best thing that could happen to the Mac is a spin-off into a company that cares (it could even be a subsidiary of Apple, like Clarisworks).

                                                    1. 3

                                                      Seems like emails received in response to a post complaining about a thing (anything really), would be rather self-selecting biased, as a statistical group.

                                                      1. 5

                                                        There are bugs, but it feels like people are mostly upset about the non-bug things, and particularly dropping support for 32-bit apps.

                                                        Which I guess feels a bit like history repeating itself? They went through this once already with the architecture switch: Tiger through Leopard had Rosetta installed and on by default, then Snow Leopard had it but available but not by default, then Lion dropped it completely. This time around, High Sierra started the warnings about 32-bit compatibility going away, Mojave stepped them up, and finally Catalina dropped support.

                                                        In both cases there were apps whose developers had either long ago ceased all ongoing maintenance/folded up, or who explicitly said their plan for porting after the cutoff was “never”. Which hurts if you were critically dependent on something in that category, but A) if you’re critically dependent on an unmaintained application you have bigger problems, and B) it’s not like Apple’s known for committing to backwards compatibility.

                                                        1. 2

                                                          It’s not the presence of “i agree”-emails that’s really interesting, but the absence of emails which disagree. If Catalina actually made the computing lives of some people better, you’d expect them to send in emails which say that.

                                                          It’s also really scary to learn that many people apparently have Time Machine failing.

                                                          1. 3

                                                            I’m not sure even that correlation is appropriate to draw, due to the aforementioned self-selection bias, as well as non-response bias.

                                                            I think the most that could be said, in a statistical/sampling sense, is that “the author is clearly not alone in having issues (sometimes extremely serious data loss ones!!) with Catalina”.

                                                        1. 8

                                                          I think Minetest is a really cool project. I love the openness, both in terms of being open source and its friendliness to mods and custom servers.

                                                          I also wish Minetest focused more on game feel. There are extremely few particle, no view bobbing, almost no visual effect when breaking a block other than it disappearing, no vignette effect, almost nothing that’s not technically “necessary”. It feels a lot like a game designed by programmers, with little to no involvement from game designers, and I think a little focus on those areas could make it feel way better to play.

                                                          1. 1

                                                            I find that perspective very interesting. When I enjoyed Minecraft it was primarily before the hunger system was introduced, back when it felt more like a toy than a game. It was more like digital Lego.

                                                            1. 5

                                                              He’s not talking about game play, it’s game feel. The pop sound when a block is mined has been in Minecraft since the very beginning (or at least when I started around alpha 0.7). This video explains it well: https://www.youtube.com/watch?v=Fy0aCDmgnxg

                                                              1. 2

                                                                It’s still very much ‘digital lego’ / construction toy in the quite-popular ‘creative mode’. The ‘survival’ mode is where you get hunger, hostile monsters, etc.

                                                                1. 1

                                                                  Survival was creative but you still had restrictions and as they say, restrictions breed creativity.

                                                              2. 1

                                                                well, many of those features can be added via modifications. I usually play on servers, thought (specifically, Pandorabox).

                                                              1. 109

                                                                Thanks for your efforts!

                                                                After four links, a domain can’t have a majority of its stories submitted from a single user.

                                                                As a datapoint, I currently can’t submit stories from my domain as I’ve submitted 14 (9 by others). I’m probably biased, but most stories have been reasonably well received so I’d consider that a loss.

                                                                1. 46

                                                                  A simple tweak to this rule: bumping against the ceiling makes new submissions from that domain require mod approval. If posts are consistently well-received, mods can whitelist that (UserName, Domain) pair?

                                                                  1. 9

                                                                    I like this idea! If this is too much moderation overhead, maybe users with sufficiently high karma could see this queue and add approvals?

                                                                    1. 11

                                                                      Maybe. I dunno. I just threw it out there, but concerns around mod overreach and cabals of power-users are as old as time.

                                                                      Tying site privileges to karma creates all sorts of Goodhart’s-law-shaped problems.

                                                                      1. 3

                                                                        Yeah, but maybe the same trust system that lobsters already has would work here: namely, a mod can delegate this queue to a user they trust? It’s all highly transparent anyway so abuse could be punished?

                                                                        1. 2

                                                                          A hidden, secondary confidence score that is calculated based on outcomes that are subjectively chosen is where pushcx may be heading with this in due time. Putting a number to it might be a good idea.

                                                                    2. 37

                                                                      As a datapoint, you are not alone. I wrote:

                                                                      in the meantime bumping up against this limit posts a note to moderators so if it goes wrong we’ll see problems

                                                                      This definitely went wrong.

                                                                      My apologies to those inconvenienced by it, there’s a lot more false positives than I recognized. We’ve had a couple suggestions on how to reduce the error rate like only looking at the last N months or skipping it if any of the domain’s stories have done especially well (better than average or median?). I especially appreciate the folks writing and tweaking queries to try to build up our understanding, and I expect there’s probably some novel angle to separate noise from signal that we’ll think of in the next few days.

                                                                      1. 10

                                                                        There’s a “homepage” link in the profile. Perhaps the limit could be increased for your declared domain, (possibly, only if it’s unique across users?)

                                                                        1. 4

                                                                          This is a good idea, but what if the user is submitting from two blogs? For example, their personal blog and the blog of a project (perhaps a project the user contributes to) that the Lobsters community might be interested in.

                                                                          1. 8

                                                                            We have an authored by checkmark, that might work?

                                                                            1. 2

                                                                              How many people are doing that? I think it may be acceptable collateral damage.

                                                                              1. 1

                                                                                Aren’t hats available for that purpose?

                                                                                1. 2

                                                                                  Hats can’t be attached to posts… yet? Also, hats are generally used more for speaking on behalf/with significant involvement for more major projects, less associating sites to users. I suppose it can be changed…

                                                                                  1. 1

                                                                                    To clarify, are you suggesting that hats be used as a signal for increasing the (proposed) limit as to how many times a user can submit stories from a particular domain?

                                                                                    1. 1

                                                                                      No, but to have people make it clear that they are posting personal or project related. A separate limit per hat would be an idea yes for the post limit.

                                                                              2. 2

                                                                                Perhaps rate limiting posts rather than an absolute limit (or some combination of trust - whatever that means, account lifespan, etc to generate a score/threshold coupled with rate limits).

                                                                              3. 35

                                                                                Yes, this rule doesn’t really make sense to me. Users who write good stories will most likely be punished in this category.

                                                                                1. 25

                                                                                  yes, I came to the comment section to ask specifically how to handle posting entries for our own blog posts. I enjoy blogging and this is one of the few places I share my blog posts. Don’t how to handle this now.

                                                                                  1. 5

                                                                                    So, it is mostly me posting my own stories as can be seen in https://lobste.rs/domain/andregarzia.com

                                                                                    1. 4

                                                                                      Yeah. I don’t blog about stuff as much as I should and lobsters is one of the good signal to noise places I’d wanna share with.

                                                                                    2. 17

                                                                                      Looking at @arp242 submissions, they look relevant and interesting, so I agree it seems to be a problem with the new algorithm. It will reduce the amount of interesting niche content - precisely what Lobste.rs should be about.

                                                                                      I’m probably in the same boat as @arp242 as I submit posts from my domain. One of my submissions is a book announcement with 26 upvotes, and the other five are Elm and Postgres posts and projects, which are neither low-effort nor frequent (this is over two years). I agree with @akkartik’s comment that the timeframe needs to be taken into account too.

                                                                                      I was going to suggest that the problem could be addressed by checking whether the user submitted other sites or participated in discussions, with an additional check for community approval in the form of a certain number of upvotes across submissions/comments. However, after looking at @UV’s comment history I see that they would have still gamed that, primarily because it’s still easy to get upvoted low-effort comments here.

                                                                                      1. 16

                                                                                        Same boat. On the other hand, maybe this will motivate me to start digging through your archives to find interesting things, because I can’t rely on you just posting them here for me ;)

                                                                                        1. 11

                                                                                          Yeah, it’s a hard choice. I like to think that my own stories, at least as of the past couple of years, are a reasonable fit for this community, and at my current rate of about one post per year I don’t feel like I’m spamming down the site. At the same time, we’ve all seen those account which just post blogspam article after blogspam article from the same domain.

                                                                                          Maybe these measures are necessary, but I consider it a good thing that people like yourself, and drew devault, and other people who write in-depth about technology topics they’re genuinely interested in, are able to post their stories here.

                                                                                          Besides, this restriction would mostly affect real users who have the community’ best interests at heart, right? If I was a marketing shill and wanted eyeballs I can show content advertising to, I could just create a new account every fourth article, right?

                                                                                          1. 8

                                                                                            If I was a marketing shill and wanted eyeballs I can show content advertising to, I could just create a new account every fourth article, right?

                                                                                            I think we’re actually good in that case! You’d have to invite the alt account, making what you’re doing SUPER obvious. And then we’d bad the entire domain, so you’d never get links from lobsters ever again :D

                                                                                            1. 3

                                                                                              I sat down at my laptop after work to respond to this because, yes: I was aware of the perverse incentive, but at least it’s pretty darn obvious and it reveals bad intentions. And I was distracted from finishing this comment to investigate and confirm that, yes, this happened.

                                                                                              1. 2

                                                                                                Why was this user banned? The user submitted 3 things, all of which are relevant and on topic? One of the github links is pretty low quality, but again, not off topic.

                                                                                                Or, maybe the things I want to see no longer align with the site…

                                                                                                1. 2

                                                                                                  They were a sockpuppet of vermaden, not a person. I left the three on-topic stories that he submitted as cover for a link promoting his blog.

                                                                                                  1. 2

                                                                                                    Thanks for the explanation!

                                                                                                    So, if that’s provably the case that the account was a sock puppet, ban vermaden?

                                                                                                    But, how is having multiple accounts any different than asking “joe rando” to post on my behalf, which I did today (it happened to be posted by someone I actually know, but only after I asked)?

                                                                                                    I’m going to start following the hashtag on twitter “#promotemeonlobsters” and submit links that appear to be on topic, that don’t appear to be spam to me.

                                                                                                    If I get enough people also do this, there will be a wide variety of potential submitters to these stories, making this silly change irrelevant. Additionally, cannot exactly ban submissions found in that stream, since I can plausibly deny I found it there, and not directly from the source by happenstance.

                                                                                                    OR, you could stage same domain posters, showing them to a random sampling of users until they reach some upvote threshold (say 3?), at which point everyone can see them. While you’re at it, perhaps this should be the way all posts start out…

                                                                                                    1. 2

                                                                                                      I thought about banning vermaden for the sockpuppeting, but I don’t read him as a badly intentioned content marketer, I read him as overly enthusiastic about FreeBSD. And if he’s clever enough to find bugs and foolish enough to not realize I’m paying a lot of personal attention to him while he does it, I’d rather let him continue a bit to catch other bugs/misdesigns.

                                                                                                      1. 1

                                                                                                        I’ve reread your comment multiple times now, am taken aback, and instead of replying how I really feel about it, I’m going to :eyeroll: and leave it be.

                                                                                            2. 8

                                                                                              Want to second this.

                                                                                              It feels like a rule that will punish personal blogs. I’ve been posting stories from my personal blog here before, I’m not sure if there are stories from my blog others posted. I think they match the content people expect here (mostly infosec related) and I don’t think that’s abuse, some of them got well received.

                                                                                              If I’d post on medium etc. I wouldn’t have that problem.

                                                                                              1. 5

                                                                                                It could be time bounded, or tested against multiple time ranges?

                                                                                                For instance, user cannot post from a domain if more than half of stories in the last 6 months are from them.

                                                                                                Or combine that with the original: a user cannot post a domain if they are more than half of all time posts AND they posted more than half within the last 6 months. That way if you could be the majority of all time, but not the majority of recent posts, or vice versa, and still be allowed to post for a certain domain.

                                                                                                And “the last 6 months” could be 3 months, could be 1 year, or what-have-you.

                                                                                                1. 3

                                                                                                  I agree. The four link thing is kinda messed up. I write essays every couple of weeks or so, all about making better tech. I’ve spent some time making sure there’s no ads, no email lists, no sales at all on these links. I can’t make them any more innocuous, and I use the comments and feedback from here to learn more and (hopefully) write better stuff.

                                                                                                  It doesn’t make sense that I can’t keep doing this. Perhaps the four link rule would work better when the domains were already high traffic sites? You don’t wanna kill the mom and pop grocery stores simply because you don’t like the new WalMart moving into town.

                                                                                                1. 4

                                                                                                  Hahahaha, you need to use a command line utility to generate json to tell your init system how to mount your home directory? This is insanity and I’m glad I’m not using a SystemD/Linux distribution.

                                                                                                  1. 25

                                                                                                    No, you don’t tell your init system how to mount your home directory. You tell systemd-homed, a separate daemon, how to mount your home directory. PID 1 isn’t involved.

                                                                                                    1. 3

                                                                                                      whew. I actually thought this was going to be merged into the main systemd codebase and would run as PID1 :D

                                                                                                      1. 7

                                                                                                        IIRC SystemD is a fleet of processes to avoid growing the amount of risky stuff in PID1.

                                                                                                        1. 5

                                                                                                          A monolith divided into too many processes is still a monolith.

                                                                                                          Schrodinger’s systemd: systemd is both just a better init replacement and the infrastructure of an entirely new OS, as is required in any given context to avoid criticism.

                                                                                                          1. 4

                                                                                                            Don’t get me wrong: there’s good reasons to criticise systemd.

                                                                                                            However, the people who volunteer their time to maintain distros have largely decided it solves problems they have.

                                                                                                            It’s definitely not ‘just a better init replacement’. It’s huge. However, there’s quite a few things that get criticised which are perfectly sensible.

                                                                                                            For instance:

                                                                                                            • Using JSON, a serialization format with multiple mature parsers, instead of inventing one.
                                                                                                            • Using multiple processes to reduce the surface area of PID 1 (no, it’s not perfect. Yes, it is better than jamming stuff into PID1).
                                                                                                          2. 6

                                                                                                            Whoa, don’t go spoiling the systemd hate with facts! If it’s not exactly the same as 4.2BSD on my VAX 11/750 then it must be un-unixy.

                                                                                                            1. 6

                                                                                                              Last time I checked /bin/systemd was about 2.5M, which still seems pretty large to me. More importantly, splitting systemd in separate processes is mostly an unimportant implementation detail; a lot of depends on each other and isn’t crash-resistent at all. Even restarting dbus will completely crash systemd, which is “fun” when your dbus no longer works correctly for some non-systemd related service and you think systemctl dbus restart is safe. It’s not and will crash your logind resulting in an irrecoverably broken system requiring a reboot 😐

                                                                                                              So, if we want to be flippant about it, then “ackchyually it’s not PID 1” is just an easy way to deflect criticism without actually having to engage in what the other person said.

                                                                                                              1. 4

                                                                                                                Even restarting dbus will completely crash systemd, which is “fun” when your dbus no longer works correctly for some non-systemd related service and you think systemctl dbus restart is safe. It’s not and will crash your logind resulting in an irrecoverably broken system requiring a reboot 😐

                                                                                                                I ran systemctl restart dbus on my machine for fun. systemd exists gracefully and kills all processes. Looking at the journal vim and spotify segfaulted (coredumpd picked them both up). Back at tty and able to log back into the system. The only process that really didn’t like this was NetworkManager which didn’t start after the login.

                                                                                                                I’m not too confident any of this hold true unless this is an experience from years ago and the situation has improved.

                                                                                                                1. 5

                                                                                                                  I don’t have access to a systemd system right now, but this was last year on my Arch Linux machine. It might depend on your configuration/version and whatnot, but a quick internet search reveals I’m hardly the first person with this issue (e.g., many more). One of the downsides of systemd is that it works fairly well when it works, but is really complex and hard to debug when it doesn’t.

                                                                                                                  Having all your programs crash is also not exactly great behaviour IMHO, but better than forcing a reboot.

                                                                                                                  1. 2

                                                                                                                    It might depend on your configuration/version and whatnot, but a quick internet search reveals I’m hardly the first person with this issue (e.g., many more).

                                                                                                                    People writing “It crashes” on stack overflow with no logs tells me they have the same behavior as I’m experiencing. Logs would prove otherwise, but I doubt that is the case.

                                                                                                                    Having all your programs crash is also not exactly great behaviour IMHO, but better than forcing a reboot.

                                                                                                                    Just two out of a lot. I assume enabling lingering would leave more of them untouched, but probably in a broken state when dbus is restarted.

                                                                                                                    1. 2

                                                                                                                      First search result: https://bugzilla.redhat.com/show_bug.cgi?id=1623651

                                                                                                                      I thought there was some GitHub issue for it too, but can’t find that right now. Either way, it still crashed for me last year, so…

                                                                                                                      Just two out of a lot.

                                                                                                                      Wait, you said that “systemd exists gracefully and kills all processes”?

                                                                                                                      1. 2

                                                                                                                        First search result: https://bugzilla.redhat.com/show_bug.cgi?id=1623651 I thought there was some GitHub issue for it too, but can’t find that right now. Either way, it still crashed for me last year, so…

                                                                                                                        Nice bug, but systemd is still not crashing. Restarting dbus is going to be wonkey and there will be bugs as there is no nice way of handling this.

                                                                                                                        Wait, you said that “systemd exists gracefully and kills all processes”?

                                                                                                                        Yes. Killing processes does in no way imply they crash. Sending SIGKILL should be handled by the process, after all.

                                                                                                                        1. 4

                                                                                                                          Oh c’mon, this is being pedantic to the point that it’s difficult to take in good faith. If restarting a system daemon stops all your processes then it’s a crash for all intents and purposes. Replying with “yeah but it doesn’t segfault” just comes off as trying to “win” an argument.

                                                                                                                          And this is why people get so frustrated and angry with systemd, because far too often they’re being told it’s “not a problem”. Well, having all my apps being stopped is a problem, segfault or not. I still had all my apps stopped and potentially lost my work. It’s also not something that seems to happen with other init systems, so for all intents and purposes this is a systemd problem.

                                                                                                                          1. 2

                                                                                                                            Oh c’mon, this is being pedantic to the point that it’s difficult to take in good faith.If restarting a system daemon stops all your processes then it’s a crash for all intents and purposes.

                                                                                                                            I think it’s more of what you expect when you claim “systemd crashes when you restart dbus”. I’m genuinely expecting poor handling, but all I see is systemd doing what it’s suppose to be doing. systemd killing your processes when you log out is expected behavior unless you enable lingering after all.

                                                                                                                            Replying with “yeah but it doesn’t segfault” just comes off as trying to “win” an argument.

                                                                                                                            Well yes. You are claiming restarting dbus results in a “irrecoverably broken system requiring a reboot”. But I have yet to see anything like that.

                                                                                                                            It’s also not something that seems to happen with other init systems, so for all intents and purposes this is a systemd problem.

                                                                                                                            You’d see this behavior with any software that depends on a central message bus. dbus handover was never proper even before the systemd merge, and It’s hard to see how this would change. The issue you linked above also echos notes the limitations you have when restarting debus.

                                                                                                                            1. 2

                                                                                                                              systemd killing your processes when you log out is not normal or expected behaviour and when it was introduced there was a lot of criticism of systemd. tmux shouldn’t need systemd-specific code to say ‘hey dont kill me when he logs out’.

                                                                                                                              Well yes. You are claiming restarting dbus results in a “irrecoverably broken system requiring a reboot”. But I have yet to see anything like that.

                                                                                                                              Because that was his experience.

                                                                                                                              You’d see this behavior with any software that depends on a central message bus.

                                                                                                                              Restarting dbus shouldn’t kill any processes, even those that use dbus. It’s a message bus. Restarting it should just queue up messages.

                                                                                                                              1. 2

                                                                                                                                systemd killing your processes when you log out is not normal or expected behaviour and when it was introduced there was a lot of criticism of systemd. tmux shouldn’t need systemd-specific code to say ‘hey dont kill me when he logs out’.

                                                                                                                                Feel free to disagree about expected functionality and what you personally think is correct behavior. It’s documented and there are options to turn off these features.

                                                                                                                                Because that was his experience.

                                                                                                                                Yes, and he is free to share his experience. But the claim is that systemd “isn’t crash-resistent at all” and that it “will crash your logind resulting in an irrecoverably broken system requiring a reboot”, which is what I’m unable to replicate. I have a hard time believing this is true unless there is more to the issue.

                                                                                                                                Restarting dbus shouldn’t kill any processes, even those that use dbus. It’s a message bus. Restarting it should just queue up messages.

                                                                                                                                I’m confused. The previous linked bugreport is an issue because there is a timeout on the socket connection. How would you queue up the messages if the dbus socket is not accepting them regardless?

                                                                                                                                1. 1

                                                                                                                                  Feel free to disagree about expected functionality and what you personally think is correct behavior. It’s documented and there are options to turn off these features.

                                                                                                                                  I know what is correct behaviour because it’s been correct behaviour for decades. systemd is, as usual, wrong and broken.

                                                                                                                                  It shouldn’t need to be turned off. It should need to be turned on. Breaking loads of programs and forcing them to write systemd-specific code because of the personal preferences of one systemd developer is complete madness.

                                                                                                                                  I have a hard time believing this is true unless there is more to the issue.

                                                                                                                                  There are thousands of cases of serious bugs in systemd, why are you surprised by this one?

                                                                                                                                  I’m confused. The previous linked bugreport is an issue because there is a timeout on the socket connection. How would you queue up the messages if the dbus socket is not accepting them regardless?

                                                                                                                                  By designing dbus differently in the first place. Obviously if dbus is down you should queue up messages to be sent when it comes back up.

                                                                                                                  2. 3

                                                                                                                    I ran systemctl restart dbus on my machine for fun. systemd exists gracefully and kills all processes.

                                                                                                                    Killing all my processes because I want to restart dbus is not ‘graceful’ in my book.

                                                                                                          3. 4

                                                                                                            Doesn’t mean it won’t become mandatory to run after a short while, like pretty much every other “stop worrying, it will always be optional” feature.

                                                                                                            1. 5

                                                                                                              Sure, that may happen, and it might be a valid criticism. You could also criticize how, even though everything is in separate processes, there are so many interdependencies through nonstandard DBus APIs and whatever that the systemd is too monolithic. Or you may criticize them for reimplementing existing tools and pushing the new versions before the bugs have been ironed out. Or for deprecating C API calls and asking projects to instead use a DBus interface.

                                                                                                              My position is that systemd overall probably is a good thing, but if you’re going to criticize it, that criticism better be based in fact. There’s enough bad crititique of systemd out there already.

                                                                                                              1. 3

                                                                                                                systemd is uniquely held immune from criticism. Any reasonable criticism of systemd has to be couched in a lot of meaningless phrasing so as to avoid being seen as being too negative. If you’re too negative about systemd (which is badly written and badly designed in every way I know that software can be badly written and badly designed, which is not an exaggeration) then you get downvoted as a ‘troll’ even if your criticisms are entirely valid.

                                                                                                          4. 1

                                                                                                            They have adressed this: this is generally an issue with the base CLIs not supporting JSON manipulation and generation and they didn’t want people to hand-write it. systemd is at a place where accidentally breaking the configuration file syntactically may make your system not boot.

                                                                                                            They still wanted to use a generally and widely supported format.

                                                                                                            1. 1

                                                                                                              There’s already a generally and widely supported format: /etc/passwd, which specifies where my home directory is perfectly well already.

                                                                                                              1. 2

                                                                                                                That’s not the point. The OP was complaining that they ship JSON tooling, which is a reasonable second-order decision after deciding to use JSON as a format.

                                                                                                                /etc/passwd is still a custom format, where even syntactical validation is not available as a standalone tool. I’ve spent a couple of years using and training puppet/chef and mistakes when generating/parsing /etc/passwd and similar files for providers is a very nice way to experience the bolted on mess that Unix is. Validating even just the correctness of such formats basically equates to “generate it, see if the system still works”.

                                                                                                                1. 1

                                                                                                                  The complaint was about the use of JSON in the first place. The need to have code to deal with a format is obviously a necessary consequence of the poor decision to use the format in the first place.

                                                                                                                  The point is not the format of /etc/passed but that the world already has a mechanism for specifying home directory location. This entire mechanism is just yet another example of systemd reinventing the wheel because it has the social power to do basically anything it likes due to its monopoly on init across almost every distro.

                                                                                                                  This feature cream is what we warned would happen if systemd were adopted almost everywhere, but did anyone listen? Of course not.

                                                                                                                  1. 2

                                                                                                                    The point of homed is to fundamentally change the integration of home directories into the operating system (and thus make them easily to migrate without changes to the base system), so /etc/passwd is a bad mechanism for that.

                                                                                                                    That has been sufficiently addressed by the systemd team.

                                                                                                                    Who’s the “we” you are speaking of, by the way. systemd adoption indicates there’s a substantial “they”.

                                                                                                                    1. 1

                                                                                                                      That has been sufficiently addressed by the systemd team.

                                                                                                                      No, it has been stated outright by the systemd team. It hasn’t been justified properly at all. Nowhere have they addressed why it “needs” to be done this way, what the alternatives are, how it could be done in a less disruptive way, any issues with doing it other ways, or any of that, because they’ve realised over time they don’t NEED to justify their actions. They maintain software that is now tightly integrated into every major Linux distribution that they can do whatever they want and people just have to accept it unless they want to fork it and maintain the now-massive codebase that is systemd.

                                                                                                                      Who’s the “we” you are speaking of, by the way. systemd adoption indicates there’s a substantial “they”.

                                                                                                                      The thousands and thousands of people that pointed out the inevitable issues with systemd when it was being adopted by major Linux distributions as their init systems, but who were ignored and called ‘trolls spreading FUD’.

                                                                                                          1. 30

                                                                                                            And after discovering late in the interview process that Apple has a blanket ban on all programming related hobby projects:

                                                                                                            Ask any potential new employer about their side project policy early on

                                                                                                            Wow. I cannot even fathom working under such conditions.

                                                                                                            1. 15

                                                                                                              Yeah, my view is that my employer owns my time when I’m at work, I own my time when I’m not at work. As long as I don’t use their intellectual property and don’t secretly work for a competitor, they have no influence on what I do off work.

                                                                                                              Luckily, I’m in the extremely privileged position that I can afford to pick between jobs based on that criteria. I have gotten unreasonable clauses removed from contracts because I have the legitimate option to not take a job I’m offered. Many people aren’t in that situation.

                                                                                                              1. 10

                                                                                                                The author explained the rationale in a comment on the HN thread. I, too, couldn’t imagine working in such an environment; the whole point of employment imo is to be able to support myself enough to work on side projects.

                                                                                                                1. 9

                                                                                                                  Note that clauses like this are illegal in some countries. For instance, in France, exclusivity clauses cannot cover unpaid work (and they become void for a year if you create a company).

                                                                                                                  This does not cancel loyalty clauses and non-competes, but those are strictly regulated as well, and I think Apple’s “we can work on anything without you knowing” would not be applicable.

                                                                                                                  1. 3

                                                                                                                    I don’t go for it personally, but for some people ‘impact’ is one of their biggest motivations.

                                                                                                                    The sheer number of units shipped makes apple an attractive place to work if that’s one of your motivators.

                                                                                                                    1. 1

                                                                                                                      Don’t believe everything you read on the internet. This is category untrue.

                                                                                                                    1. 4

                                                                                                                      My gut feeling tells me it’s mostly due to the fact that a hash value of an int is the int itself, so there’s no time wasted on hashing.

                                                                                                                      Oh wow I hope not. Is this actually true in CPython?

                                                                                                                      1. 6

                                                                                                                        This is the most sensible implementation as you want to avoid collisions in a hash table. It isn’t supposed to bear any cryptographic properties if that’s your concern. Here’s more: https://github.com/python/cpython/blob/master/Objects/dictobject.c#L134

                                                                                                                        1. 5

                                                                                                                          It’s not the most sensible implementation, because simple key patterns cause collisions that never resolve, even when resizing the hashtable. The comment you linked specifically mentions this pathology, and the numerous ways it destroys performance.

                                                                                                                          The rest of the comment describes how CPython mitigates the issue by adding weak integer hashing to its collision probing. At first I thought integer keys were never hashed at any point, hence my surprise.

                                                                                                                          From the comments it sounds like sequential integer dict keys are somehow common in Python, which I don’t understand. But I don’t write much Python.

                                                                                                                          1. 6

                                                                                                                            From the comments it sounds like sequential integer dict keys are somehow common in Python, which I don’t understand. But I don’t write much Python.

                                                                                                                            While you can have a dict with keys of any hashable type – and a single dict may have keys of many types – the most common case, so overwhelmingly more common that it’s almost not even worth thinking about other cases, is a dict whose keys are all strings. This is because, sooner or later, basically everything in Python is backed by a dict. Every namespace is backed by a dict with string keys (the names defined in that namespace). Every object is backed by a dict with string keys (the names of the object’s attributes and methods). Keyword arguments to functions/methods? Yup, dict. In comparisons of languages by their “one big idea”, Python is sometimes described as having its big idea be “what if everything was a string-keyed hash table”?

                                                                                                                            Anyway. This is so common that Python goes out of its way to have special-case optimized implementations for the case of a dict whose keys are all strings (and for what it’s worth, in CPython as of Python 3.4, str is hashed using SipHash-2-4).

                                                                                                                            As to hashing of numeric types, it’s a bit more complicated than “ints hash to themselves”. Here’s what the Python documentation has to say. For the specific case of int, you can think of it as reducing to hash(n) == hash(n % sys.hash_info.modulus), where in CPython sys.hash_info.modulus is 2^61 - 1 on systems with 64-bit long and 2^31 - 1 on systems with 32-bit long.

                                                                                                                            While I don’t have a way of being certain, I suspect the linked comment’s note that the hashing of int is “important” has to do with the importance of real-world int key values being unlikely to collide with the hashes of other common real-world key types.

                                                                                                                            1. 1

                                                                                                                              In comparisons of languages by their “one big idea”, Python is sometimes described as having its big idea be “what if everything was a string-keyed hash table”?

                                                                                                                              I’ve always thought of PHP’s “one big idea” as “What if everything is an array” where array means PHP’s strange half-dict half-list interface that funnily enough Python is now one small step closer to.

                                                                                                                          2. 1

                                                                                                                            Avoiding collisions isn’t as important as using up a larger % of the spots before you need allocate and move things, I believe.

                                                                                                                            1. 3

                                                                                                                              Aren’t those the same thing? Less collisions implies you can go longer without expanding.

                                                                                                                              1. 1

                                                                                                                                It depends on the exact implementation, but in my understanding, not exactly; you also want a good distribution between your buckets, even if there are patterns / non-random distributions in the actual encountered keys. It might waste space rather than time, but it’s still not great.

                                                                                                                                1. 3

                                                                                                                                  Python’s hash table isn’t implemented as an array-of-buckets. It’s a single contiguous array into which you insert a new element at the position determined by the hash of its key, and if that position is occupied you try the next one in a pseudo random order. Same with lookups: you try entries in succession until you find the one that equals (it’s usually the first one). And this is why the number of free spots and the probability of collisions are directly related.

                                                                                                                          3. 2

                                                                                                                            it is:

                                                                                                                            Python 3.7.6 (default, Dec 21 2019, 11:56:31)
                                                                                                                            [Clang 10.0.1 (clang-1001.0.46.4)] on darwin
                                                                                                                            Type "help", "copyright", "credits" or "license" for more information.
                                                                                                                            >>> hash(2)
                                                                                                                            2
                                                                                                                            >>> hash(37)
                                                                                                                            37
                                                                                                                            >>> hash(892474)
                                                                                                                            892474
                                                                                                                            
                                                                                                                            1. 8

                                                                                                                              Almost! hash(-1) returns -2.

                                                                                                                              Python 3.8.1 (default, Jan  8 2020, 23:09:20)
                                                                                                                              [GCC 9.2.0] on linux
                                                                                                                              Type "help", "copyright", "credits" or "license" for more information.
                                                                                                                              >>> hash(-1)
                                                                                                                              -2
                                                                                                                              >>> hash(-2)
                                                                                                                              -2
                                                                                                                              >>> hash(-3)
                                                                                                                              -3
                                                                                                                              
                                                                                                                              1. 4

                                                                                                                                wat

                                                                                                                                do you happen to know why?

                                                                                                                                1. 7

                                                                                                                                  Ah, it’s because the C API function uses -1 as an error code. It goes deeper than that too:

                                                                                                                                  In [1]: class yolo:
                                                                                                                                     ...:     def __hash__(self):
                                                                                                                                     ...:         return -1
                                                                                                                                     ...:
                                                                                                                                  
                                                                                                                                  In [2]: y = yolo()
                                                                                                                                  
                                                                                                                                  In [3]: hash(y)
                                                                                                                                  Out[3]: -2
                                                                                                                                  
                                                                                                                              2. 2

                                                                                                                                I’ve heard that this is a somewhat common way to implement hashing for ints, but I don’t understand why it’s a good idea. Isn’t hash collisions terrible for hash tables? And isn’t a somewhat common key pattern “some number with some low bits masked”? And wouldn’t that be a pathological case for a hash table which grows with a factor of 2?

                                                                                                                                Are hash table implementations which does hash(x) = x somehow better at handling collisions than most hash tables, or do they just hope that the ints people want to put in their tables have high entropy in the lower bits?

                                                                                                                                1. 3

                                                                                                                                  IIRC there is some sort of random salt added to it and it goes through some internal hash for the actual hash table, since there was a DoS attack by abusing worst case scenario over HTTP requests.

                                                                                                                              3. 2

                                                                                                                                Why would that be a problem?

                                                                                                                              1. 7

                                                                                                                                In some languages, you can turn the GC off in the fast path or tell it when to collect garbage. That might have solved this problem. Does Go lack that feature?

                                                                                                                                1. 3

                                                                                                                                  You can’t disable it I think, but you can tell go to run a GC (with runtime.GC()). If you don’t create a lot of garbage, and find an opportune time to collect garbage not too infrequently, you shouldn’t see unwanted GCs.

                                                                                                                                  However, in a server situation, when do you have the opportunity to pause to collect garbage? It’s not like you can just say, “collect if the user hasn’t interacted for some seconds”; the service is probably always busy.

                                                                                                                                  1. 5

                                                                                                                                    Literally the first result for “golang disable gc” on either DDG or google indicates that turning the GC off is as simple as setting an environment variable, and that it can be manually invoked.

                                                                                                                                    I’d wager writing a post based on a guess took longer than finding out would have.

                                                                                                                                    1. 3

                                                                                                                                      Oh, that’s very interesting. Running with GOGC=off, manually monitoring the process’ RSS and running a GC only when it gets too high would probably have almost solved Discord’s problems then.

                                                                                                                                      Still, writing services in Rust (or even C++) just to not have to bother with memory management minutia seems like a good idea for services with high performance requirements.

                                                                                                                                      1. 3

                                                                                                                                        Rust and C++ don’t absolve you from dealing with memory management minutia; they obligate it. This might make sense if your application has some critical mass of code that requires careful, explicit memory management, but I would put that threshold somewhere above 90%. The more compelling reason to use Rust or C++ is that you need a mature compiler with lots of optimizations, not the memory management considerations. Of course other requirements (e.g., safety, obscure target architecture, etc) might also prompt you to choose Rust over Go.

                                                                                                                                    2. 2

                                                                                                                                      In a server situation, there’s a few things you might do:

                                                                                                                                      1. No GC at all in the hottest path. Do that one manually.

                                                                                                                                      2. Memory pools or reference counting if they have less performance impact.

                                                                                                                                      3. Activate GC after the hot path of the service call.

                                                                                                                                      4. If there’s ups and downs, do the GC’s on the downs. A load balancer or monitor might even tell it to.

                                                                                                                                      5. If load balancing w/ multiple nodes, create enough downtime periodically to force a GC.

                                                                                                                                      6. If garbage builds slowly, then don’t activate the GC at all. Use a cluster setup, eventually fail-over to another node, and restart the one full of garbage. That flushes out lots of problems for reliability, too.

                                                                                                                                      1. 3

                                                                                                                                        That last one actually sounds eminently sensible if your application really has that characteristic.

                                                                                                                                        Or combine 5 and 6: For each node, when the garbage gets over a threshold, set its health to ‘unhealthy’, wait until connections from the load balancer drain down, run a GC, set health back to healthy.

                                                                                                                                        The other thing which comes to mind is they have a massive LRU cache full of teeny counters: perhaps this would be better as an array of bytes instead of an array of garbage-collected number thingies. Or maybe I’m just thinking like a C programmer still :-P

                                                                                                                                  1. 2

                                                                                                                                    Having spent much of the past couple of days staring at rust compiler output, this is a reminder of how terrible codegen can be and still be “faster” than the alternative.

                                                                                                                                    1. 2

                                                                                                                                      Are you looking at the LLVM IR generated by the rust compiler or the machine code generated by LLVM? I’d expect the IR to look bad but the machine code to look pretty good (assuming reasonable optimization levels); if the machine code looks terrible after LLVM with optimizations enabled, that’s very interesting.

                                                                                                                                      Do you happen to have some examples of terrible generated code?

                                                                                                                                      1. 2

                                                                                                                                        I was looking at x86_64 assembly and then at LLVM IR to try to understand why the asm wasn’t great.

                                                                                                                                        In our code there’s a path that comes down to copying bytes from an iterator into a Vec. The code in question is complex but basically it seems that writing into a mut Vec will never trigger LLVM’s memcpy detector.

                                                                                                                                        So this (where inp: &Vec<u8>) is fast:

                                                                                                                                          let outp: Vec<u8> = inp.iter().copied().collect();
                                                                                                                                        

                                                                                                                                        and this is not:

                                                                                                                                            let mut outp: Vec<u8> = Vec::with_capacity(inp.len());
                                                                                                                                            outp.resize(inp.len(), 0);
                                                                                                                                        
                                                                                                                                            for i in 0..inp.len() {
                                                                                                                                                outp[i] = inp[i]
                                                                                                                                            }
                                                                                                                                        
                                                                                                                                    1. 3

                                                                                                                                      Changing to a BTreeMap instead of a HashMap in the LRU cache to optimize memory usage.

                                                                                                                                      Why would a BTree map use less memory in rust?

                                                                                                                                      1. 3

                                                                                                                                        Hash maps usually try to have a lot of empty slots for performance, while afaik a BTree will usually just have the necessary nodes, right?

                                                                                                                                        1. 1

                                                                                                                                          I think it’s more about access patterns than just size. In a hash map the elements are essentially randomly jumbled about, whereas In a BTreeMap they can be sorted by time. The oldest elements will be closer together in memory and O(1) to find, which are both great news for a LRU cache.

                                                                                                                                          1. 2

                                                                                                                                            They didn’t say BTreeMap is faster, they said BTreeMap uses less memory. In fact, I very much doubt it was faster.

                                                                                                                                            1. 0

                                                                                                                                              I have no trouble believing it was faster for the workload. After all, that was the point of the article.

                                                                                                                                        1. 4

                                                                                                                                          not hashed

                                                                                                                                          If the password needs to be used again later, how will the hash be useful?

                                                                                                                                          1. 4

                                                                                                                                            Raw passwords shouldn’t be needed again. Best practice to keep them salted and hashed, and compare the user’s input to the hash, not a raw password.

                                                                                                                                            1. 6

                                                                                                                                              If the server does the hashing, then the client has to cache the raw password.

                                                                                                                                              1. 4

                                                                                                                                                The blog post isn’t extremely clear, but it’s my understanding that this issue is related to a kind of “remember my password”-type feature; the client remembers your password for you. If that’s the case, the fact that it’s “encrypted, not hashed” is a red herring; when you need to get the plaintext back, you obviously can’t store the password hashed.

                                                                                                                                                The blog post is so full of irrelevant details that it’s hard to figure out what the actual problem is, and the CVE mentioned (CVE-2019-18988) doesn’t seem to be public yet - but the problem certainly isn’t that TeamViewer didn’t store the password hashed, because hashing isn’t applicable here.

                                                                                                                                            1. 1

                                                                                                                                              Bummer. I’m waiting for delivery of a new 16” MBP, and while I’m excited about getting the hardware, being forced into Catalina does not fill me with joy.

                                                                                                                                              1. 1

                                                                                                                                                Don’t worry, Catalina is fine. People get … enthusiastic whenever there’s anything negative about Apple.

                                                                                                                                                1. 0

                                                                                                                                                  Catalina is pretty damn far away from being fine. Your experience might differ of course, but that doesn’t mean much — there’s a multitude of different use cases out there. Just read the article.

                                                                                                                                                2. 1

                                                                                                                                                  I would downgrade to Mojave as soon as I get it.

                                                                                                                                                  1. 1

                                                                                                                                                    I don’t think it’s possible to downgrade to a version of macOS before the version your machine came with?

                                                                                                                                                    1. 0

                                                                                                                                                      Of course it’s possible, I do it literally all the time at work. Every new Mac we buy goes straight back to Mojave. You just need to create a bootable USB stick, erase the drive and reinstall the OS.

                                                                                                                                                1. 2

                                                                                                                                                  The content is good, but man, that website is rough. Just look at this: https://i.imgur.com/VM2c1d5.png - between the huge fixed header and the subscription notification, 65% of the screen is unusable on my iPad. Even after dismissing the notification box, only 2/3 of the screen is text.

                                                                                                                                                  1. 1

                                                                                                                                                    Indeed. I disabled scripts for this website in umatrix and everything became fine at once. :)

                                                                                                                                                    (well, firefox’ reader mode helps too)

                                                                                                                                                  1. 10

                                                                                                                                                    I get what the author is trying to get at with calling it “serverless” and not sure if it’s a good or bad overloading of terms. But, I do think that SQLite is an underappreciated tool for the reasons they described. I wrote the following on Hacker News, but figured I’d add it here to:

                                                                                                                                                    I think a good under-appreciated use case for SQLite is as a build artifact of ETL processes/build processes/data pipelines. Seems like lot of people’s default, understandably, is to use JSON as the output and intermediate results, but if you use SQLite, you’d have all the benefits of SQL (indexes, joins, grouping, ordering, querying logic, and random access) and many of the benefits of JSON files (SQLite DBs are just files that are easy to copy, store, version, etc and don’t require a centralized service).

                                                                                                                                                    I’m not saying ALWAYS use SQLite for these cases, but in the right scenario it can simplify things significantly.

                                                                                                                                                    Another similar use case would be AI/ML models that require a bunch of data to operate (e.g. large random forests). If you store that data in Postgres, Mongo or Redis, it becomes hard to ship your model alongside with updated data sets. If you store the data in memory (e.g. if you just serialize your model after training it), it can be too large to fit in memory. SQLite (or other embedded database, like BerkleyDB) can give the best of both worlds– fast random access, low memory usage, and easy to ship.

                                                                                                                                                    1. 8

                                                                                                                                                      I think SQLIte is great, and an amazing feat of engineering.

                                                                                                                                                      However, I really wish it would just check my types. If the database will happily write a string to my int column, and my language is dynamically typed… well, there’s only the fallible human left to ensure there’s no silent data corruption.

                                                                                                                                                      1. 4

                                                                                                                                                        You can add check constraints using typeof, e.g. check(typeof(col) == 'INTEGER').

                                                                                                                                                        I agree static types are useful and important, but dynamic types are also useful for plenty of things, e.g. using SQLite with unclean data from external sources.

                                                                                                                                                        select typeof(col), count(*) from imported group by 1;
                                                                                                                                                        select col from imported where typeof(col) != 'INTEGER';
                                                                                                                                                        update imported set col = ... where typeof(col) != 'INTEGER';
                                                                                                                                                        
                                                                                                                                                      2. 5

                                                                                                                                                        It seems like the initial documentation might be older than the widespread usage of serveless as “no visible servers for you to manage”.

                                                                                                                                                        I think it would be a bit silly to choose this hill to die on, it is not like the older meaning of serveless has ever caught on in any way or form, nor there’s really a trend on building the sort of thing that could be called the sqlite kind of serveless.

                                                                                                                                                        The text on itself doesn’t mean that the author is choosing to die on this hill, though, maybe it’s just about clarifying a specific piece of documentation

                                                                                                                                                        1. 11

                                                                                                                                                          This page is at least 12 years old, and remains largely unmodified since its creation, except for the second section added 2 years ago. See this archive of the page from 2007. No one is dying on any hill, it was just written long before the term was otherwise used.

                                                                                                                                                          1. 6

                                                                                                                                                            “Serverless” here means literally what it says: the work is done in-process, not in a separate server. This is beyond a trend, it’s the way regular libraries work. ImageMagick is “serverless”. Berkeley DB is “serverless”. OpenGL is “serverless”. Get it?

                                                                                                                                                            The only reason the developer of SQLite calls this out is because most SQL databases are client-server, so someone familiar with MySQL or SQLServer might otherwise be confused.

                                                                                                                                                            (And may I add that I, personally, find the current meaning of “serverless” ridiculous. Just because you don’t have to configure or administer a server doesn’t mean there isn’t one. When I first came across this buzzword a few years ago, I thought the product was P2P until I dug into the docs. But then, a lot of buzzwords are ridiculous and we get used to them.)

                                                                                                                                                          2. 3

                                                                                                                                                            I get what the author is trying to get at with calling it “serverless” and not sure if it’s a good or bad overloading of terms.

                                                                                                                                                            I’m sympathetic to this line of thinking, but in this case “serverless” is an utterly and completely lost cause. It’s beyond any hope of redemption. All use is fair play.

                                                                                                                                                            1. 2

                                                                                                                                                              I think a good under-appreciated use case for SQLite is as a build artifact of ETL processes/build processes/data pipelines.

                                                                                                                                                              ha, I built pretty much exactly that at Etsy years ago. We had an ETL that transformed the output of hadoop jobs into sqlite files that could be queried from the site. It worked because without writers you don’t have any locking problems.

                                                                                                                                                            1. 19

                                                                                                                                                              In my case, it is Rust:

                                                                                                                                                              • Rust is much better at enforcing move semantics. std::move() feels bolted-on by comparison.

                                                                                                                                                              • Rust’s algebraic data types are vastly superior to C++‘s attempts at them (e.g. std::expected<> vs Rust’s Result).

                                                                                                                                                              • Rust also wins around dependencies and ease of building

                                                                                                                                                              • Rust’s warning level is ratcheted up by default. C++ requires -Wall -Weverything to start being sane and prevent silly mistakes.

                                                                                                                                                              • Rust is about even when it comes to build times.

                                                                                                                                                              Right now, the only times I’d reach for C++ are when the cost (ecosystem gaps/organizational inertia/personnel requirements) of using Rust exceeds the perceived cost of C++‘s baggage in the above areas. I’m not anti-C++ by any means. I just enjoy using Rust more at the moment.

                                                                                                                                                              1. 2

                                                                                                                                                                I haven’t written much rust myself, I’m very happy with where C++ is right now (and how it’s evolving). However, I also think that Rust is the best alternative language for what I currently use C++ for. It’s interesting, C++ came out, 40 years ago, with a really nice system for dealing with object lifetimes, avoiding resource leaks and thinking about ownership - and then everyone sort of ignored that aspect for a while, went all crazy with OOP and inheritance and garbage collection but ignored ownership issues and not-main-memory resource leaks.

                                                                                                                                                                It feels like it took 35 years for anyone to notice C++’s great ideas other than the nicer syntax for dealing with vtables.

                                                                                                                                                                1. 5

                                                                                                                                                                  It feels like it took 35 years for anyone to notice C++’s great ideas other than the nicer syntax for dealing with vtables.

                                                                                                                                                                  Absolutely. There are good ideas in there alongside the footguns. The existence of footguns, however, does not invalidate C++. I adore the fact I can write both very high level code as well as very low-level code of several varieties, such as a garbage collector or something that directly interacts with hardware. The time I spent seriously studying C++ continues to serve me well in my career, enabling me to work on high performance code, LLVM, or embedded contexts. It (and C) are languages that are still worth knowing despite Rust being on the uptick.

                                                                                                                                                                  A few things I learned from C++:

                                                                                                                                                                  • Generic programming
                                                                                                                                                                  • RAII
                                                                                                                                                                  • Proper attitude towards exceptions (e.g. that of a last resort)
                                                                                                                                                                  • Needless coupling hurts build times and hinders comprehension
                                                                                                                                                                  • Navigating and using a large language (like C++) requires taste
                                                                                                                                                                2. 1

                                                                                                                                                                  I built multiple hobby projects in Rust, but with enormous executable sizes and heavily mangled symbols it took a lot of time to figure out what was being generated for specific blocks of code. This is the reason I’ve been diving into C over Rust.

                                                                                                                                                                  Rust is much better at enforcing move semantics. std::move() feels bolted-on by comparison.

                                                                                                                                                                  move is bolted on and its usage wonky, even before you get to problems such as using it can prevent copy elision.

                                                                                                                                                                  Rust’s algebraic data types are vastly superior to C++‘s attempts at them (e.g. std::expected<> vs Rust’s Result).

                                                                                                                                                                  I wrote my own version of Rust’s Result with nearly identical usage semantics (even supporting Ok and Error), but doing that took multiple weeks and it has a few sharp corners; I still don’t handle or prohibit char*, char[] and char[n] results correctly yet with deduction guides. There’s another version of Result in the wild, but mine handles void (essentially unit) as an error or value type and probably should release it at some point. Not even with just ADT, the C++ standard library is a consistent problem in general.

                                                                                                                                                                  Rust also wins around dependencies and ease of building

                                                                                                                                                                  For pretty standard crates, yes. I’ve run into cross platform issues multiple time with crates since I have to support Windows for my work. I do enjoy that I can write build files in Rust itself though.

                                                                                                                                                                  Rust’s warning level is ratcheted up by default. C++ requires -Wall -Weverything to start being sane and prevent silly mistakes.

                                                                                                                                                                  Yes, and Rust compile errors tend to be much easier to understand in general. I have well-tuned cmake templates by now, and I build against multiple compilers (clang, gcc and MSVC) in my personal CI (which is impractical for most people), just because sometimes another compiler will give a more clear error description in C++ or catch non-compliance

                                                                                                                                                                  Rust is about even when it comes to build times.

                                                                                                                                                                  I deal with million+ line C++ programs, so I’m curious how Rust performs at that scale, because small projects are one thing, and mega projects are different. I don’t think physical construction (vs logical construction, see Lakos’ book) are as bad in Rust though.

                                                                                                                                                                  1. 4

                                                                                                                                                                    For Rust exe sizes LTO + strip should take overhead down to 200KB. If you want to find an unmangled symbol, #[no_mangle] on fn will help. But if you just want to see if some construct optimizes well, https://rust.godbolt.org is neat.

                                                                                                                                                                    For large projects the wisdom is to split them into many small crates. Cargo recently added a cool -Z timings option that profiles the build and generates neat graphs.