Threads for memorythought

  1. 1

    The algorithms underpinning services like Google Docs are not designed to support this use case.

    Actually Google Docs has fabulous offline support. You can edit a document on a plane and sync it when you land no problem.

    1. 3

      Right, but the point is about the authoritative copy’s history. Google Docs (and most OT systems like it) is like SVN - the server is the authoritative source of truth. No one but Google can accept your offline changes, and they accept and resolve conflicts on your behalf and update the authoritative copy on the server. As with SVN, you can edit your local checkout files offline, but you can’t commit until you come back online.

      CRDTs are designed to allow for a decentralized model like Git, where peers can pull and push to each other, and equally-valid histories of the document can fork and merge. As with Git, you can edit your local checkout files offline, as well as commit to your local repo, and push to any other repos you have connectivity to. There can still be a central authority peer like eg GitHub, but it’s not required for the system to work.

      1. 1

        Sure, I’m not arguing that. I love CRDTs just pointing out that OT does fine for centralized offline and the example shared is clearly false. Maybe the author ment to say that OT can’t do distributed syncing.

      2. 2

        No, the “offline” they’re talking about is us sitting in a cabin without internet access and being able to use a local wifi router to collaborate on a doc.

        1. 1

          Ah, I didn’t get that interpretation. In that case I agree that Google Docs and OT fall short.

        2. 1

          Does this work with concurrent edits from multiple users who are offline? What if I have multiple devices and I want to share work between them but not with anyone else until I publish?

          1. 1

            Yes, I believe. I didn’t read through all the details of this algorithm, but CRDTs in general support multi-master P2P replication. Any two mutated copies can be merged successfully.

            1. 1

              I was referring to the OT algorithms the GP was talking about 🙂

        1. 8

          See also Y.js, which is another CRDT library in JS that has wide usage. I’ve read about both Automerge and Y.js; my personal assessment is that Y.js has more users (eg Input, a commercial note-taking app that competes with Notion, my employer) and support (offers consulting, advertises bindings for the major JS editor frameworks) than Automerge. For a while the Y.js CRDT also had clear advantages over Automerge, but then Martin landed a big rework and now I expect that they’re roughly on the same performance footing I believe. I’d still need to benchmark them myself before I pick one for my next project.

          Another aspect to keep in mind for these libraries is, can you write your database logic against the CRDT in Rust (or any other non-JS language)? Because CRDT is CPU expensive at scale, I would expect that using Rust or another threaded language that doesn’t die when CPU work happens on the server would eventually be required for a serious scale backend for a CRDT service. Both Yjs and Automerge also have rust port projects in the early stages.

          1. 5

            I’m a maintainer of the Rust port of Automerge. One of the big reasons I’m interested in it is less about performance and more about interoperability. Because Rust has no runtime and C-like FFI it’s possible to build wrappers in other languages which use the Rust codebase for the complicated CRDT parts. E.g this experimental library for python:

            1. 2

              Thank you for your work! I didn’t mean just in the “rust is fast language”. You wrote:

              I’m interested in it is less about performance and more about interoperability.

              To me interoperability is also a performance advantage because I have more freedom to choose an ideal solution when I can run the CRDT algorithm in any process in my cluster, because Rust/C is embeddable.

              An example idea in the scaling solution space that uses Rust would be to add an Automerge column type and operators to Postgres as an extension that uses your library, so that my front-end web server doesn’t need to read the entire document from Postgres and can just pass the diff on to the database directly by writing UPDATE doc SET doc.crdt = automerge(doc.crdt, $update) WHERE = $id.

            2. 2

              Thanks for sharing! I’m trying to figure out what storage/conflict-resolution library to use as the basis of an app that works in three modes: 1) browser-only 2) desktop 3) SaaS. Y.js and automerge are now on the top of my list as generic solutions to my problem.

              1. 2

                Keep in mind that CRDT come with space trade offs, a CRDT storing a text will always use more space than a plain string, and the CRDT’s space usage may grow without bound as it stored history. For local-only or offline-first, this concern is usually not a problem, but if you make a popular-enough SaaS, you’ll need to think about compaction and dropping old histories, as well as transmission costs when syncing data between nodes.

                I think the simplicity of CRDT makes it a better choice than Operational Transform model, especially for 0->1 scale, but I haven’t come up with a backend architecture for scaling big document CRDTs that doesn’t involve one million shards and hand waving at the storage layer.

                1. 1

                  Yeah for sure. History aside from the current “session” is not incredibly important I think.

              2. 1

                Non-JS implementations are also important for native mobile & desktop apps, as well as embedded systems. Not all client-side code is built for web browsers (or for web browsers packaged into a facsimile of an app.)

                1. 1

                  … I would expect that using Rust or another threaded language

                  You don’t need a server in the first place, that’s part of the point of a CRDT; but a side effect is that if you want to have one (say passively making backups) the server can be rather lazy.

                  1. 3

                    You don’t need a server in the first place

                    I think this is a reductive attitude. CRDT enables offline-first authoring and system design, but many use-cases still work best with an online and timely server component.

                    Even for a simple use-case of writing a shopping list on my desktop at home and then viewing that list on my phone at the market, an always-on server node reachable somehow on the public internet is very beneficial to facilitate syncing. Otherwise, I need to make sure my two devices are active on the same network at the same time, and I need to verify they show the same state before I break their connection.

                    1. 1

                      Did you seriously not read everything after the semicolon?

                      1. 2

                        I did, sorry for not including this in my initial response.

                        Laziness is a fine solution at the family-and-friends use-case, and it certainly relaxes some constraints, but at scale you don’t have “down time” you can defer work to and you always need enough CPU cores and storage bandwidth to burn through the sync/backup queue so it doesn’t grow unbounded. All I was trying to say is that having a Rust or C implementation of the CRDT makes the scaling solution space more broad and much less expensive.

                1. 8

                  If your DB exists inside one org - sure. If your DB is shared between multiple orgs and you want to concentrate on tech, not on legal… Maybe time-series database won’t cut it.

                  1. 10

                    What attack, exactly, do you fear that is allowed by giving your partner orgs append-only access to a DB, but is not possibly by giving them append access to your blockchain?

                    I note that the article explicitly addresses the ‘partners who don’t trust each other’ use case.

                    For example, a private ledger allows data to be shared and seen by different parties who do not need to trust each other because of the software’s rules – this could be a bank and a regulator sharing data access to customer trades data. I would argue that such data access could be done via the business logic layer sitting on top of the database layer to provide data to outside parties.

                    1. 7


                      ‘partners who don’t trust each other’

                      is not compatible with this:

                      giving your partner orgs append-only access to a DB

                      Because it requires your partner to trust that you do not do funny stuff on DB yourself. Simplest attack - place a buy before appending a large incoming buy order, and place a sell just after it. Free money. Happens on public blockchains all the time.

                      BTW, this article is a dumpster fire. It is full of false claims, half-truths and just irrelevant bullshit. The guy who wrote it knows his time-series databases and knows almost nothing about blockchain design space.

                      Blocks are added to the blockchain at regular time intervals. For each block of data, there is an associated timestamp.

                      Yes. Trains also arrive at different time points. Is Amtrak a blockchain? How is this even relevant?

                      Data replication: Each node in the blockchain holds the entire history of transactions. If one node is compromised, we rely on the others to provide the full history. Again, this concept has been in effect for decades with traditional databases: if one database fails, we may want another as a backup.

                      False. There are multiple types of nodes. There are chains where history can be truncated - chains with snapshots. Reason for nodes to have the full state is an ability to validate every state transition. Data availability is an important concern, but it is secondary since the need to share some data can be removed with the help of zksnarks / bulletproofs.

                      full history of all individual transactions ordered by time; this is how blockchain nodes work

                      No, this is not how blockchains work. They implement total global ordering of events. But the order is logical, not time based. E.g. both Bitcoin and Ethereum include transactions in the order defined by the fee paid - from txes paying high fees, to txes paying low fees. Total global order of transactions plus deterministic execution equals ability to arrive to the same final state. It has very little to do with time.

                      Blockchains would have multiple parties (i.e., nodes) to agree for a specific transaction. There are consensus algorithms such as Raft and Paxos in traditional databases akin to a voting mechanism.

                      This bit is just lazy. Consensus determines the order of inclusion of transactions. Nothing more.

                      Long 256 format: This is the format of crypto public addresses. At QuestDB we have built a data type that is better than a string to efficiently write and read Long 256 blockchain addresses.

                      Irrelevant. This is a wrong layer. See Tendermint. It provides a total ordering on a set of binary blobs. Binary blobs are untyped, and Tendermint knows nothing about details of business logic of the application it is running.

                    2. 8

                      You are not avoiding any “legal”.

                      This reminds me how a bunch of blockchain peddlers that made their way into a meeting of a municipal IT steering committee, trying to sell their “block-chain based authentication mechanism”. They did not read eIDAS and GDPR (nor the related local laws) did not read the public service information systems law, nor the cybernetic security law and showed that they had zero understanding of the fact, that if public administration screws up proving someone’s identity and that someone is harmed by that, the administration is held liable.

                      It is several times easier to write a contract between couple of parties detailing how you share data and who is responsible for what, adjust your respective privacy policies and use a couple of regular databases than “putting it all onto a blockchain”, potentially being liable for publishing personal information that cannot ever be deleted.

                      And frankly, I am pretty confident writing small-scale contracts myself, without being a lawyer. Continental Law tends to provide mostly sane defaults (to a point it is safe to sign most of the common contracts without any additional clauses apart from the mandatory ones) and since overly unfair contracts are invalid and courts are expected to read into what the signatories meant, you only need lawyers in high-risk situations or once something blows up.

                      And if you need it to scale, just use adhesive contract (terms of service) with one organization acting as a steward. If you need it to be neutral, association is both the simplest of corporations to fund and also the simplest to administer (almost no accounting) providing democratic (one member = one vote) decision-making by default.

                      1. 6

                        How do you realistically prevent a 51% attack though…?

                        1. 8

                          What you decide to do will depend a lot on the specifics of your use-case. You might decide to run your own proof of authority blockchain, or to run some other BFT protocol such as HotStuff. You also might communicate using a public blockchain. However, what you must not do is run your own proof of work blockchain. Your comment correctly identifies one of the reasons why doing so is a bad idea.

                          1. 3


                            1. 4

                              Web of Trust style, ala Proof of Authority, doesn’t actually handle adversarial consensus, only who can publish to the blockchain, so often you’ll see another consensus algorithm underneath that layer, like IBFT, Raft, what-have-you, if you’re concerned with adversaries within the trusted nodes

                              1. 2

                                Thank you, that’s helpful.

                                1. 2

                                  of course! It’s a really interesting space, and there’s lots of nuances to it all. We obviously deal with it a lot at work, more than other folks may in their day to day

                            2. 2

                              Enterprise organisations are also vulnerable to 51% attack. You can buy 51% of the shares, then burn the whole thing to the ground.

                            3. 4

                              Yeah this is my understanding of the value of enterprise blockchains. It’s more about getting diverse organisations to run a database together in an interoperable manner without one of them becoming the “owner” of the database or similar. I’ve never actually worked in such a large organisation so I have no idea if this rings true.

                              1. 4

                                This is generally the case; my company reviews blockchains quite frequently, as well as their installations, and we’ve seen this comment often. Having said that, I haven’t seen as much success from that sort of thing; very often it’s a pilot, and doesn’t go much further than that.

                            1. 9

                              Per Kent Beck: “I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence” (

                              If your unit tests aren’t adding value, don’t write them.

                              1. 4

                                Ten or twenty years from now we’ll likely have a more universal theory of which tests to write, which tests not to write, and how to tell the difference.

                                I don’t see any progress made in the last 12 years. How do you determine the value of a unit test you consider to write?

                                1. 8

                                  There’s research on defect rates, what influences them, where to find them, but most software developers aren’t aware of it. A sample:

                                  • S. M. Olbrich, D. S. Cruzes, and D. I. K. Sjoberg, “Are all code smells harmful? A study of God Classes and Brain Classes in the evolution of three open source systems,” in 2010 IEEE International Conference on Software Maintenance, Timi oara, Romania, Sep. 2010, pp. 1–10, doi: 10.1109/ICSM.2010.5609564.
                                  • P. L. Li, M. Shaw, J. Herbsleb, B. Ray, and P. Santhanam, “Empirical evaluation of defect projection models for widely-deployed production software systems,” in Proceedings of the 12th ACM SIGSOFT twelfth international symposium on Foundations of software engineering - SIGSOFT ’04/FSE-12, Newport Beach, CA, USA, 2004, p. 263, doi: 10.1145/1029894.1029930.
                                  • Paul Luo Li, J. Herbsleb, and M. Shaw, “Forecasting Field Defect Rates Using a Combined Time-Based and Metrics-Based Approach: A Case Study of OpenBSD,” in 16th IEEE International Symposium on Software Reliability Engineering (ISSRE’05), Chicago, IL, USA, 2005, pp. 193–202, doi: 10.1109/ISSRE.2005.19.
                                2. 4

                                  If your unit tests aren’t adding value, don’t write them.

                                  Or throw them away.

                                1. 21

                                  This is why people are interested in CRDTs. Or at least, it’s why I’m interested in CRDTs. There seems to be a lot of activity in this space at the moment. Two projects that come to mind are Automerge/Hypermerge, and OrbitDB. The irritating thing about all of these projects right now is that they pretty much require you to write your application in javascript, which I really don’t want to do. However, I’m contributing to the Rust port of Automerge so hopefully soon we’ll be able to write automerge applications in Rust.

                                  1. 4

                                    This. I’ve been trying to build something on top of SQLite3 to do this as I need it for Rust. All the projects I come across for this type of thing seem to be geared towards NodeJs type applications.

                                    1. 1

                                      I have noticed something very similar, I see a lot of Node.js and JS-in-general projects cropping up such as SSB and OrbitJS. Not sure what that means for the ecosystem, actually.

                                      1. 1

                                        I would say that interactive use is probably the main driver so people have written it in front end-ish languages. I don’t think it means anything about this technology or theory.

                                        1. 1

                                          I would say your assumptions are reasonable. Thanks for sharing.

                                    2. 1

                                      That’s a good new keyword for my research, thanks!

                                    1. 3

                                      I’ve tried to use Dhall for kubernetes before and ran into problems because it was taking hours to just import the kubernetes config files. There’s an issue for it here. I really want it to work though, I currently manage a bunch of services using Helm which is very painful - IMO due to the lack of abstraction it provides and Dhall looks like it would solve that.

                                      1. 2

                                        I put my own instance of it here. It may be faster depending on how your latency is to my server in Montreal.

                                        -- kubernetes.dhall
                                      1. 1

                                        I’m hoping to get a first complete release of a rust implementation of the Automerge library. I’ve mostly completed a simple first pass at it, my next steps are making sure that it interoperates with the javascript implementation correctly, then trying to make it performant.

                                        1. 1

                                          Many people will probably not like what they see in these slides because of their political position. It was very refreshing to see a scientific “formalization” of both ethical approaches.

                                          I see a comparable effect in terms of “equality”. There can be two outcomes: “equal rights” or “equal status”. Many people will claim to support both, but one opposes the other. You can either have equal rights or equal status. To give an example: If you demand a 50% female-quota in leading positions, you are against equal rights as women are then treated differently compared to men. You could weigh both outcomes in some way, but one cannot truly exist while the other prevails.

                                          It would be nice to see more reasonable philosophically weighted debates on these things instead of this constant supercharged reproduction of political dogmas.

                                          1. 12

                                            I wonder what’s “refreshing” in this slide deck to you. I recommend supplementing with the original talk.

                                            The author imagines that racism cannot be unintentional, and that racist stereotypes have “an element of truth”. At the same time, they are unwilling to choose security over convenience, to stop calling heuristics “algorithms”, or to question why we have designed certain systems. This combination leads to a worldview where racism is a cost of doing business.

                                            As an example, the author discusses an algorithm which detects people blinking while a photograph is being taken. “If you can fix it, do that… I certainly can’t make my algorithm detect every single error,” they say. Implicit in this claim are the notions that algorithms are inherently buggy/lossy, that fixing showstopping product issues must be balanced with shipping the product, and most dangerously, that sometimes it’s acceptable to shrug, give up, and have a product with some racist behaviors.

                                            A legal theme in the USA that pervades the author’s critique of procedural fairness is intersectionality, which has become popular for legal arguments in much the same way that set theory has become popular for mathematical work.

                                            During the section about “maximizing profits”, the author takes a sickening tone, reducing people to data for the purpose of optimizing business. They fail to point out the typical humanist and socialist arguments against doing so, but claim to have objectivity; this is a glaring blind spot in their conceptualization of people. Indeed, you can hear it in their tone as they talk about how redlining “is considered…a big harm.” They don’t care whether people are harmed, or whether people are considered harmed; they care only about the numbers in their ethical calculus.

                                            You mention “equal rights”. This seems a wonderful opportunity to remind people what the term means, and to also reinforce why it is prime. Equality of rights ensures that people are treated without bias by The State; the biases of The State’s actions against its people are then assuredly the biases of its officers, and it is The State’s obligation to enforce its own rules against itself. From a highly social action, we gain a highly social institution, and from equality of rights, we gain an existence that is in stark contrast to this corporatized smorgasbord of data.

                                            The section on modelling criminality is not only typical for crime science, but is completely in line with typical research on the subject in terms of its assumptions.

                                            The author’s maths are alright, but the conclusions are quite wrong. Their analysis of base rates misses the base rate fallacy, their correlation between race and crime completely omits the well-known hidden variable of socioeconomic status (“wealth”), and their concept of “mathematically guaranteed bias” ignores statistical significance.

                                            They fail to link to the “impossibility theorem”. There exist overviews of the main result and concepts, but I want to offer my own conclusions here. First, note that the authors of the paper imply repeatedly, e.g. on p1 and p3, that their results generalize from decision-making machines to decision-making panels of people. We may comfortably conclude that the problem is with our expectation that bias can be removed from systems, not with the fact that our biases are encoded into our machines. Another conclusion which stands out is that compressing datasets will cause the compressor to discover spurious correlations; stereotyping, at least in this framework, is caused by attempting to infer data which isn’t present, much like decompressing something lossily-encoded. I would wonder whether this has implications for the fidelity of anonymized datasets; does anonymizing cause spurious correlations to form?

                                            I’m surprised that they waste time doing utilitarian maths and never mention that utilitarian maths leads to utility monsters or The Repugnant Conclusion.

                                            My choice quote:

                                            So, these are cases where there’s significant predictive power in demographic factors. So, your algorithm will actually be more accurate if you include this information, than if you exclude it.

                                            I wonder whether they understand why legislation like the Civil Rights Acts exist. It doesn’t come through in their tone at all; when they talk about the problems of inequality, they don’t discuss systemic racism. They discuss how poor FICO Scores are, but didn’t point out that FICO is a corporate entity like the credit bureaus. No consideration was made for systemic improvements. To the speaker, the banks are an immutable and unchanging wall whose owners always steer it towards profitability by careful management of balance sheets; any harm that they do is inadvertent, “second-order”, a result of tradeoffs made by opaque algorithms and opaque people trying their best to be “fair”.

                                            Their closing “meta-ethical consideration” is probably as good as it can get, given the constraints they’ve placed on themselves. If we can’t challenge the system, then the best that we can do is carefully instrument and document the system so that it can be examined.

                                            1. 4

                                              Thank you for this comment. The slides alone were giving me a weird vibe, but the talk cements that feeling.

                                              Approaching these issues through utilitarianism and formalism feels like completely the wrong approach and borders on scientism. After all, the author works for a lending company, so it’s not surprising he’s trying to paint bias as inevitable.

                                              1. 3

                                                I am incredibly grateful for your detailed dissection of this piece. The piece strikes me as pretty similar to the infamous James Damore memo, at least in its conclusions (trying to justify bigotry by an appeal to science), though the arguments it advances to get there are different. As somebody whose self-declared job as an activist involves figuring out messaging strategy for countering bullshit, I was deeply distressed by these slides because it would be better to have a coherent response ready to go, but I didn’t have time to dissect it in detail since there’s other stuff going on and no proximate need. I’m sure I’ll be referring back to your comment as necessary.

                                                1. 2

                                                  Yes, this article is propaganda. Thank you for covering why much more thoroughly than I was willing to put the effort into doing.

                                                  1. 1

                                                    In the event, I just posted it to /r/SneerClub.

                                                2. 6

                                                  I think that many people may agree with some pieces of what you’re saying, while finding your example to be inaccurate and harmful. I want to point this out so that people can be very thoughtful about whether and how they engage, and in particular so that people can remember to not treat these various separate ideas as if they’re one piece that must be accepted yes/no.

                                                  It’s very easy, when responding to positions that are put forward as if they’re hard truths on contentious issues, to inadvertently accept some piece of a premise without understanding its full context and the harm it causes. People who try to calm things down then sometimes wind up exacerbating harms, instead. I think very highly of users and your critical thinking ability, but I still want to urge care in replies to this thread.

                                                  I’m intentionally not taking a position on the actual topic, at this time, so that I can keep my personal feelings out of this to the extent possible, though that’s never 100%.

                                                  1. 2

                                                    Thank you for your thoughtful answer. If you look closely, I haven’t also taken any position in this regard and just given an example for such a concept.

                                                    Where I should’ve been more clear is that the slides, in the end, actually give an idea on how to “solve” such a problem, namely by considering this process as a constrained optimization problem. If we look at “equal rights” versus “equal status”, it means that you could for instance proclaim “equal rights” as your main goal, but under the constraints of certain structural conditions that could steer processes into a more equally stated outcome. The thing is, if we discuss philosophical ideas, there is little wiggle-room, and a good solution must be found that is in-between both concepts.

                                                  2. 2

                                                    Isn’t your argument failing to do exactly what you praise the article for doing? To quote the last slide:

                                                    formalize your ethical principles as terms in your utility function or as constraints

                                                    Things like “equal rights” and “equal status” seem very poorly defined in this context vs the concepts of proedural and group fairness etc. outlined in the article.

                                                    1. 3

                                                      What I think is important is that the presenter first gives the two “extremes”, namely the goal of utilitarism and the goal of equity (each with their pros and cons), and in the end gives a possible solution to both by applying trade-offs to one goal so the other is at least partially respected.

                                                      That’s what I meant with the following sentence.

                                                      You could weigh both outcomes in some way, but one cannot truly exist while the other prevails.

                                                      From what I understand, “equal rights” mean that any individual has the same rights, regardless of any traits or abilities; “equal status” consequently means that regardless of any traits or abilities there is a “fair” outcome for each individual in such a way that the structures reflect an equal status for all sub-groups. Granted, it is realtively easy to define for men-women, but much harder for other matters.

                                                      Let me bring my point across by limiting ourselves to the men-women-matter for now; I agree that at least equal status is harder to define for other cases: Neither equal status nor equal rights is the golden way.

                                                      Going with equal status would be crazy e.g. for engineering positions where only a minority of graduates are female and an equal status would intensely discriminate against men such that even much more qualified men compared to women wouldn’t get a position. To turn it the other way around, equal status would also discriminate women in female-dominated jobs.

                                                      Going with equal rights only would possibly not bring change to areas that are male- or female-dominated due to structures. People weigh the importance of these structures differently, but sometimes, just equal rights are not enough to bring change that is desired, because there is written law and also societal norms, which are often different. Again, I’m taking no position here, as this is not the point.

                                                      The presenter thus proposes this weighted approach in the end that allows a median that includes both factors. For instance, one could discuss an approach of “equal rights” which also reflects structural changes as constraints to this optimization problem. Or you could regularize the optimization problem with a weighted “status”-term. In the long run, this tends to get complex if you think about it, so these are just thoughts. However, it’s nice to see that it has been formalized like that.

                                                      To give one more example, which is unrelated to the matters of equality discussed above: If you gave a machine the task to solve hunger in Africa, a valid solution in the machine’s sense would be to nuke the entire continent and wipe out all life on it. No humans = no hunger. This is because the machine hasn’t been given proper “constraints” for the solution. The main objective of “minimizing” hunger has to be matched with constraints that are easily forgotten when we, as humans, solve such problems. These constraints are about ethics, sustainability and so forth. The same problem, albeit a bit less dramatic than my example, was presented in the article. To go full circle, the point of the article is to give AI a sense of ethics it understands. We humans have a natural “limit” when it comes to realizing solutions. Big corporations and governments usually are only constrained by the biggest extent of a law and often act unethical. By thinking about laws and the lawmaking process, or just algorithm design, we simultaneously think about problems that affect better lawmaking and also better AI design.

                                                      tl;dr: I may have been a bit short with my wording earlier and I explained it a bit deeper here.

                                                      1. 2

                                                        I see what you’re getting at. As sanxiyn said, “equal rights” and “equal status” do seem to map to procedural and allocative fairness. I’m not sure that I agree that “going with equal status would be crazy”, but oviously there are tradeoffs there and this way of casting the discussion allows you to specifically discuss those tradeoffs, which is nice.

                                                        Thank you for taking the time to explain your thoughts in more depth.

                                                      2. 1

                                                        I think “equal rights” and “equal status” is approximately procedural fairness and group fairness. I think both are wrong thing to focus on, as they result in things like FICO biased against Asians. See my other comment.

                                                    1. 5

                                                      Most interesting thing to me about this is that they don’t seem to place any limit on retention, opting instead to just charge for storage space. Almost every other service provider places limits on retention time which is a showstopper if you’re doing any kind of event sourcing based on Kafka.

                                                      1. 7

                                                        Domain Driven Design by Eric Evans is a classic modeling book, but a hard read. I’ve heard that Domain-Driven Design Quickly by Abel Avram & Floyd Marinescu is a better, shorter version but haven’t read it.

                                                        I got a lot out of Joe Celko’s Data & Databases on database design and, his puzzle books SQL for Smarties and SQL Puzzles and Answers puzzles were so fun and weird they helped me really internalize relational dbs.

                                                        I just started Scott Wlaschin’s book Domain Modeling Made Functional and Debasish Ghosh’s book Functional and Reactive Domain Modeling. I’m only about a chapter into each, so I can’t give a significant opinion yet, but they’re both interesting takes on modeling.

                                                        Jon Bentley’s Programming Pearls books and Writing Efficient Software have lots of the bitpacking kind of stuff you’re getting at in your mention of Stockfish.

                                                        Sandi Metz & Katrina Owen’s book 99 Bottles of OOP breaks down a toy problem in a bunch of different directions and points out where approaches succeed and fail at responding to change or preventing bugs.

                                                        1. 3

                                                          I’m halfway through Scott’s book you mention. It’s really good! It gives me confidence to adopt the naming convention that I instinctively felt was right, when I saw no other comments about naming in pure FP literature or blogs. It’s my first intro to DDD, and it finally makes sense to me now. Not every app will require DDD, but it makes sense for business apps. The downside to adopting the business’s ubiquitous language is that you don’t have much opportunity to do cool stuff with FP concepts, but that’s fine, there is opportunity to use cool ideas in architecture stuff, like an algebra of domain object modifications.

                                                          1. 1

                                                            I just bought and read Domain Modeling Made Functional on the basis of this comment and have found it really illuminating. Despite the name I would say that a lot of the concepts in it will be very applicable even in non functional settings provided the overall architecture is more functional (i.e event based in some sense).

                                                          1. 41

                                                            It’s also developer-friendly because of its excellent wiki.

                                                            I learned Linux doing everything by hand on a Slackware system, then moved to Ubuntu after ~8 years when I realized I’d stopped learning new things. Then a couple years ago I realized I didn’t understand how a bunch of things worked anymore (systemd, pulseaudio, Xorg, more). I looked at various distros and went with Arch because its wiki had helped me almost every time I’d had an issue.

                                                            Speaking of distros, I’m currently learning Nix and NixOS. It’s very nice so far. If I can learn to build packages I’ll probably replace lobsters-ansible with it (the recent issues/PRs/commits tell a tale of my escalating frustration at design limitations). Maybe also my personal laptop: I can experiment first with using nix to try xmonad first because it’s mostly configured by editing + recompiling) and deal with python packaging, which has never worked for me, then move completely to NixOS if that goes well.

                                                            1. 9

                                                              I switched from Mac to NixOS and couldn’t be happier. At work we use Nix for building Haskell projects as well.

                                                              1. 9

                                                                The Arch wiki actually seems to be the only good documentation for using the advanced functionality of newer freedesktop components like pulseaudio, or much older software like Xorg.

                                                                But I’ve noticed it’s documentation for enterprise software like ZFS is usually hot garbage. Not surprising given the community. The recommendations are frequently hokey nonsense: imaginary micro-optimizations or blatantly incorrect feature descriptions.

                                                                What do you find better about nix for making packages than, say, making an rpm or deb? I’ve found those package systems valuable for large scale application deployment. Capistrano has also been nice for smaller scale, with its ability to deploy directly from a repo and roll back deployments with a simple symlink swap. And integration libraries are usually small enough that I’m comfortable just importing the source into my project and customizing them, which relieves so many minor tooling frustrations overall.

                                                                Of course in the end the best deployment system is the one you’ll actually use, so if you’re excited about packaging and deploying with nix, and will thus devote more time and energy to getting it just right, then that’s de facto the best option.

                                                                1. 3

                                                                  What do you find better about nix for making packages than, say, making an rpm or deb?

                                                                  I don’t, yet. The “If I can learn to build packages” sentence links to an issue I’ve filed. I was unable to learn how to do so from the official documentation. I’ve almost exclusively been working in languages (PHP, Python, Ruby, JavaScript) that rpm/deb have not had good support for, prompting those languages to each implement their own package management systems that interface poorly or not at all with system packaging.

                                                                  I’ve used Capistrano, Chef, Puppet, and currently use Ansible for deployment. Capistrano and Ansible at least try to be small and don’t have a pretensions to being something other than an imperative scripting tool, but I’ve seen all of them break servers on deployment, let servers drift out of sync with the config, or fail to be able to produce new deployments that match the existing one. Nix/NixOS/NixOps approach the problem from a different direction; it looks like they started from what the idea of system configuration is instead of scripting the manual steps of maintaining one. Unfortunately nix replicates the misfeature of templating config files and providing its own config file on top of them instead of checking complete config files into a repo. Hopefully this won’t be too bad in practice, though it’s not a good sign that they implemented a programming language.

                                                                  I appreciate your closing sentiment, but I’m not really trying to reach new heights of system configuration. I’m trying to avoid losing time to misconfiguration caused by services that fundamentally misunderstand the problem, leading to booby traps in common usage. I see almost all of my experience with packaging + deployment tools as a loss to be minimized in the hopes that they waste less time than hand-managing the global variables of public mutable state that is a running server.

                                                                  1. 1

                                                                    Hmmm. I don’t think the problems you listed are 100% avoidable with any tool, just easier in some rather than others.

                                                                    I like Puppet and Capistrano well enough. But I also think packaging a Rails application as a pre-built system package is definitely the way to go, with all gems installed and assets compiled at build time. That at least makes the app deployment reproducible, though it does nothing for things like database migrations.

                                                                  2. 1

                                                                    What do you find better about nix for making packages than, say, making an rpm or deb?

                                                                    Let me show you a minimal nix package:

                                                                    pkgs.writeScriptBin "greeter" "echo Hello $1!"

                                                                    Et voila! You have a fine nix package of a utility called greeter that you can let other nix packages depend on, install to your environment as a user or make available in nix-shell. Here’s a function that returns a package:

                                                                    greeting: pkgs.writeScriptBin "greeter" "echo ${greeting} $1!"

                                                                    What you have here is a lambda expression, that accepts something that you can splice into a string and returns a package! Nix packages in nixpkgs are typically functions, and they offer an a great amount of customizability without much effort (for both the author and the user).

                                                                    At work, we build, package and deploy with nix (on the cloud and on premises), and we probably have ~1000 nix packages of our own. Nobody is counting though, since writing packages doesn’t feel like a thing you do with nix. Do you count the number of curly braces in your code, for instance? If you’re used to purely functional programming, nix is very natural and expressive. So much so that you could actually write your application in the language if it’s IO system were designed for it.

                                                                    It also helps a lot that nix can seamlessly be installed on any Linux distro (and macOS) without getting in the way of its host.

                                                                    1. 1

                                                                      If only ZFS from Oracle hadn’t had the licensing compatibility issues it currently has, it would probably have landed in the kernel by now. Subsequently, the usage would have been higher and so would the quality of the community documentation.

                                                                    2. 4

                                                                      If I can learn to build packages I’ll probably replace lobsters-ansible with it

                                                                      Exactly. I don’t have much experience with Nix (none, actually). But in theory it seems like it can be a really nice OS-level replacement for tools like Ansible, SaltStack, etc.

                                                                      1. 1

                                                                        This is exactly what NixOps does! See here.

                                                                        1. 2

                                                                          Thanks for the video. I’ll watch it over the weekend!

                                                                          Curious - are you also running NixOS on your personal machine(s)? I’ve been running Arch for a long time now but considering switching to Nix just because it makes so much more sense. But the Arch documentation and the amount of packages available (if you count the AUR in) is something that’s difficult to leave.

                                                                          1. 1

                                                                            Yes, I’m using it on my personal machine :). I wouldn’t recommend switching to NixOS all at once, what worked for me was to install the Nix package manager, use it for package management and creating development environments, and then only switch once I was fully convinced that NixOS could do everything I wanted from my Ubuntu install. This took me about a year, even with me using it for everything at work. Another approach would be to get a separate laptop and put NixOS on that to see how you like it.

                                                                            1. 1

                                                                              Interesting. I’ll try it out for some time on a VM to get a hang of it. Thanks for the info!

                                                                      2. 3

                                                                        Even as a Ubuntu user, I’ve frequently found the detailed documentation on the Arch wiki really helpful.

                                                                        1. 2

                                                                          I really want to use Nix but I tried installing it last month and it doesn’t seem to have great support for Wayland yet which is a deal breaker for me as I use multiple HiDPI screens and Wayland makes that experience much better. Anyone managed to get Nix working with Wayland?

                                                                          1. 2

                                                                            Arch’s wiki explaining how to do everything piecemeal really seems strange given its philosophy is assuming their users should be able to meaningfully help fix whatever problems cause their system to self-destruct on upgrade. It’s obviously appreciated, but still…confusing, given how many Arch users I’ve met who know nothing about their system except what the wiki’s told them.

                                                                            1. 1

                                                                              I gave up on my nix experiment, too much of it is un- or under-documented. And I’m sorry I derailed this Arch discussion.

                                                                              1. 1

                                                                                I’m happy to help if I can! I’m on the DevOps team at work, where use it extensively, and I did a presentation demonstrating usage at this year. All my Linux laptops run NixOS and I’m very happy with it as an operating system. My configuration lives here.

                                                                                1. 2

                                                                                  Ah, howdy again. I’m working my way through the “pills” documentation to figure out what’s missing from the nix manual. If you have a small, complete example of how to build a single package that’d probably be pretty useful to link from the github issue.

                                                                                  1. 2

                                                                                    I made a small change to the example to get it to build, and I’ve added it as a comment to your issue.