Threads for shapr

  1. 2

    I think a related idea is using colors to show types, as in https://lobste.rs/s/bfo42i/chameleon_tool_make_solving_type_errors

    1. 9

      I guess I’m weird in that I still go to an online store (usually Apple’s) and pay them for music that gets downloaded to my devices. Did that stop being a thing?

      1. 27

        I switched to bandcamp because I get FLAC files and more of the money goes to support the artist.

        1. 17

          I’m curious to see how Epic’s acquisition of Bandcamp will play out with regards to both supporting the artist and DRM-free files.

          1. 12

            Same, except that I would describe myself as nervous rather than curious.

        2. 4

          “still” is interesting. I’ve not yet begun to do that, since most online stores refuse to sell music in a format worth paying for. Sometimes a Bandcamp or an independent will, be most places sell either DRM or lossy compression or both… I mostly just buy CDs if I’m going to pay for it

          1. 2

            Going all the way back to the ripping-mp3s-from-CDs days, I’ve never really been able to notice any difference in quality past a certain bitrate. And it’s not like my ears have gotten magically better in the intervening 20 years, so I largely don’t care whether the music is encoded in the latest shiniest ultra-HD-giga-fidelity audiophile settings.

            1. 1

              Bit late, but most artists get more money from official merch than album sales, physical or not.

              1. 1

                Not sure how that’s relevant, but yes, buying music is a poor way to support artists for sure

          1. 1

            I use a three year old ThinkPad P52 with 128GB of RAM, 6x Xeons and a 4k touchscreen, and 3TB of NVMe drives, with an open slot for a third drive. This system cost me $3500 which I consider a good price for what I got.

            If I were to replace it, I’d get the ThinkPad P15 Gen 2 with 128GB of ECC ram and 8x Xeon, and I’d switch to PCIe 4 NVMe drives.

            1. 3

              I taught a lunch time class at work on this subject. Tagline was “does the CEO still write his own emails?” I think thirty people showed up from product, QA, support, etc It was great fun, and we didn’t answer the question.

              1. 1

                I taught a lunch time class at work on this subject. Tagline was “does the CEO still write his own emails?” I think thirty people showed up from product, QA, support, etc It was great fun, and we didn’t answer the question.

                Wow, it seems an interesting class! You could look for the people that showed up and make your “guess” (“mmh, Jeff from Copywriting was not here, then he must be the writer!). Joking aside, writing style still reveals a lot of information of ourself, and our background.

              1. 12

                As someone who uses Linux audio extensively, I was really excited to see PipeWire gain traction over the past years. I am, however, much less thrilled about WirePlumber being pushed as the canonical PipeWire session manager, essentially turning PipeWire into another brick in the systemd wall.

                1. 1

                  Is there a session manager you prefer?

                  1. 1

                    Perhaps I should rephrase: My problem isn’t with WirePlumber as such (I haven’t tried it yet), but the with the fact that it requires systemd.

                    Are there options any besides WirePlumber and pipewire-media-session? Anything that runs on a runit-based system and allows me to at least somewhat conveniently route audio between applications would do, really.

                    1. 5

                      WirePlumber does not require systemd. For example, in Gentoo, we have WirePlumber being used on both OpenRC and systemd installations. I use it on both.

                      It has supported elogind for a few months - notably around the time the default changed/the push towards WP began, so it’s not like it happened afterwards.

                      I also think that it works without a logind implementation at all.

                      1. 1

                        Ha, I completely missed that. I last tried to set up PipeWire in December and couldn’t get WirePlumber to work on Void. Seems that was right around the time when elogind support was added.

                        Anyway, thanks a lot for this information!

                        Edit: Just added qpwgraph to my setup for easy routing, works like a charm.

                      2. 4

                        Void has wireplumber but no systemd, so…?

                      3. 0

                        Subscribing to learn the answer. I don’t use a session manager at all on my own systems (Void Linux, no systemd) Interested to hear about options.

                    1. 1

                      How much time was spent in each? How do you device when to stop fixing one thing and go in to something else?

                      1. 11

                        It’s not pro, “subscribe to our newsletter” floater is missing.

                        1. 13

                          But it must be a pop-up that appears when you start to read, otherwise you might learn something

                          1. 4

                            Clearly. This doesn’t even appear to be monetized.

                          1. 5

                            What is this about? There’s no link to anything?

                            1. 1

                              put a scale under the coffee pot and measure change over time?

                              1. 4

                                I wonder if there is any relationship with this approach of something like smallcheck? They have a paper, “SmallCheck and Lazy SmallCheck: automatic exhaustive testing for small values” which might be of interest? I’m not very familiar with it though, so I could be off-the mark on this connection.

                                1. 2

                                  I came here to talk about SmallCheck, which was created to do exhaustive checking of inputs. Yes! This is the same thing. There are lots of fun publications in this area, though Rudy Matela wins the trophy with his PhD thesis and many libraries.

                                  Rudy wrote leancheck for intelligent enumerative testing, fitspec to find missing properties or overspecified properties, speculate to discover properties, and extrapolate for finding generalized counter-examples to a property.

                                  But wait, there’s more! If you get as excited about property based testing as I do, you will enjoy this PhD thesis.

                                  1. 1

                                    Anyone know if there’s an equivalent library in Rust?

                                    1. 2

                                      Let me google that for myself: https://github.com/blt/smallcheck

                                  2. 1

                                    It’s related, but not in a fundamental way. Both the post and the paper are about exhaustively enumerating small cases. SmallCheck takes a type-driven approach, while Gen focuses on values (you don’t generate lists and then filter them to be permutations, you just directly generate permutations).

                                    The other paper linked in the discussion, Capturing the Future by Replaying the Past, captures the fundamentals. Gen is essentially what is described in “WARM-UP: REPLAY-BASED NONDETERMINISM”.

                                  1. 5

                                    Consumer systems need ECC RAM as much as servers!

                                    I haven’t used ZFS, is it good for a laptop as well as a server? Should I install ZFS on all my systems?

                                    1. 8

                                      I haven’t used ZFS, is it good for a laptop as well as a server? Should I install ZFS on all my systems?

                                      Generally, the rule of thumb for ZFS is that you should have 1 GiB of RAM per 1 TiB of storage, multiplied by 2-4 if you are turning on deduplication. You can get away with a bit less if the storage is SSD than if it’s spinning rust - ZFS does a lot of buffering to mitigate fragmentation. I’ve not had a laptop that didn’t meet those requirements and the advantage of ZFS on a laptop over anything other than APFS are huge (relative to APFS they’re slightly less large):

                                      • O(1) snapshots, so you’re protected against accidental deletion. There are some nice tools that manage snapshots and let you do the gradual-decay thing. You can also do the NetApp-style thing with snapshots and have them automatically mounted inside the .zfs directory of the filesystem so as a user without the ability to run ZFS commands you can still copy files from a snapshot that you accidentally deleted.
                                      • Fast filesystem creation if you want individual units of checkpointing / restoring or different persistency guarantees (for example, I turn of sync on a filesystem mounted on ~/build so that it lies to my compiler / linker about persistence of data written there - if my machine crashes I may lose data there, but there’s nothing there I can’t recreate by simply blowing away the build and running it again, so I don’t care).
                                      • Delegated administration, so you can do the things above without elevating privilege, but only for the filesystems owned by you.
                                      • Easy backups with zfs send (if your NAS also uses ZFS then replicating your local disk, including snapshots, to the NAS is really easy).
                                      • Per-block checksums so you can detect on-disk corruption (doesn’t help against in-memory corruption, sadly, as this article points out).

                                      I haven’t used anything other than ZFS by choice for over 10 years on everything from a laptop with 20 GiB if disk and 1 GiB of RAM to servers with 512 GiB of RAM and many TiBs of disks. If you’re doing docker / containerd things, there’s a nice ZFS snapshotter that works really nicely with ZFS’s built-in snapshots.

                                      TL;DR: Yes.

                                      1. 3

                                        I stumbled upon this rant by torvalds about ECC and how it fade away in the consumer space. ddr5 will help somewhat, by requiring an on-chip ECC system. Problem is, it’s not helping with the data<->cpu bus and it looks like you will also not get reports in your OS about ECC errors, as you would do with normal ECC.

                                        1. 1

                                          i would also like to know this as Im about to install it on my laptop

                                        1. 1

                                          I very much want to hear about the prolog based auth system. We recently started using such a thing and it’s better than RBAC in so many ways.

                                          Is that system perhaps based on soutei?

                                          1. 1

                                            Bought it, started playing it, really enjoy the first few levels. I may have to break out the pen and paper soon.

                                            1. 2

                                              I just got nix-copy-closure working for the first time, perhaps I’ll try this next.

                                              1. 2

                                                I don’t understand the details, but now I want to build an elisp interpreter in Haskell. Maybe I’ll understand this better then?

                                                1. 7

                                                  I think that humans integrate their tools into their self image, otherwise the comments on this post wouldn’t be angry.

                                                  1. 1

                                                    You’re more likely to see people who are invested X talking about X. The people who don’t care about X aren’t going to be as interested in talking about it.

                                                  1. 3

                                                    I’m still looking for an argument/example for why all this abstraction carries its own weight, in a software-development context.

                                                    1. 3

                                                      Like most software engineering patterns, it exists to facilitate code reuse in a principled way. An abstraction’s utility can be measured along two axes:

                                                      1. Working only within the abstraction, what things can I say?
                                                      2. How many things embody this abstraction?

                                                      Monad is a useful abstraction because it applies to a surprisingly large range of types, while still allowing a broad vocabulary of functions that work over any Monad. It is also hard to understand for these reasons, which is why the most effective teaching method seems to involve finding some vaguely familiar concept (e.g., promises) that happens to be a Monad, using that to give the student a toe-hold, and then asking the student to write Monad instances for a zillion types, letting the instinctive, pattern-matching part of the student’s brain notice the underlying similarities.

                                                      The Monad abstraction in Haskell enables (among other things) a large family of functions (when, unless, forever, etc) that would be control structures in other languages. This is handy because a) we don’t have to petition some language steward to add new ones (contrast: Python’s with statement), and b) we can use our normal programming tools to work with them.

                                                      I can use the Monad abstraction when checking for missing values, to halt my program on the first error, to make an ergonomic database Transaction data type that prohibits non-database I/O, to write deserialisers, to set up eDSLs with great ergonomics, to treat lists as nondeterministic computations, to provide a good interface to software transactional memory, to build up an additional “summary” result in a computation, to pass around additional arguments, and other things I’ve surely forgotten. You could well say (as you said to /u/shapr in a sibling comment) that none of these need the theory of Monads. And they don’t. What the theory of Monads gives you is a useful toolbox to see how they’re all similar, and it’s one that’s usefully expressed only in a few programming languages. A tool like mapM works exactly as well in each of those apparently-diverse cases, and only needed writing once.

                                                      1. 2

                                                        mapM’s functionality is trivial, though, and I expect anything you can do with an arbitrary monad would be equally trivial. In my experience, code reuse is useful when the code carries significant domain knowledge or provides a single point of reference for application details which are subject to change. Abstracting away repeated patterns for the sake of it, or simply for the sake of concision, is often not worth the cognitive load it adds.

                                                      2. 3

                                                        I’m not a haskeller, but I’ve spent a little time with the language. One benefit is that you can write your functions for the success case and the monadic machinery will short circuit if there is a failure. This means that you don’t need to litter you code with checks for nulls or nothings.

                                                        1. 2

                                                          One thing I like is that I can use the same code with a fake in memory database without changing the code itself, just feeding a different value into the monad.

                                                          1. 7

                                                            You don’t need the theory of monads to enable that.

                                                            1. 1

                                                              Using a monad to separate concerns and do easy dependency injection is one of many cases where the monad abstraction carries its weight.

                                                              I agree, you don’t need the theory to do those things with a monad, you just use it.

                                                              1. 3

                                                                I can do those things quite easily in languages which don’t even have the concept of “monad.” The abstractions I use might be representable as monads, but I see no benefit to calling them out as such.

                                                                1. 1

                                                                  Consider Elm. Its designer has banned the word monad from all the documentation. Nevertheless, it has a very consistent and intuitive way of handling all monadic types. How can that be? Because the designer knew they were monads.

                                                                  Most users won’t ever have to declare a monad. They don’t need monad tutorials or even know the word, but the world would be a better place if all language designers did.

                                                            2. 3

                                                              that’s just an interface, isn’t it?

                                                              1. 1

                                                                If you mean an interface as in an API being a pattern of functions and data, then yes. A good interface can make a problem easier to think about and solve.

                                                                1. 2

                                                                  Or an interface as in literally like a Java interface, i.e. a simple everyday programming concept that doesn’t need any theoretical mathematics to understand.

                                                                  1. 3

                                                                    That’s what I was thinking. Jdbc is the ultimate example here. You program only against interfaces and you can swap databases in tests trivially easy. All without reading complex Monad tutorials.

                                                                    1. 1

                                                                      Interface theory is very complex and mathematical. You never see blog sized tutorials about all the theory because it doesn’t fit in a blog. Monads are stupid simple in comparison, which is why there are so many blogs about it. Get over the abstract nonsense words, implement it yourself in 10 lines, then write a blog about how you finally understood it. That’s all there is to it.

                                                                      Designing interface rules for your language is hard to get right even if you know all the theory, cause there are many tradeoffs and you might make the wrong choice for what you’ll want later on. Getting monads wrong is only possible when you refuse to acknowledge you’re dealing with a monad, like JS’s Promises.

                                                                      1. 2

                                                                        Interface theory is very complex and mathematical. You never see blog sized tutorials about all the theory because it doesn’t fit in a blog.

                                                                        I think you never see blogs about it, because - at least Java programmers - learn about them in the very beginning and then use them. They are trivial to understand and use. Java programmers write them every single day and most of them do not have deep type theory backgrounds. I think that is what this thread is about. Pragmatic programmers using something vs. pure functional programmers exchanging complex Monad tutorials.

                                                                        1. 2

                                                                          Exactly, you can use monad-like things without ever learning about monads. You’ll have a better time if the language designer did know monad theory though. Same goes for interfaces.

                                                                          I really don’t want to call monads complex though. That’s what leads to this “monad tutorial fallacy”, it’s always the first mythical hard thing new Haskellers run in to, so when it clicks they must write a tutorial. Haskell has other stuff much more complex, that never gets blog explanations either. I’d say GADTs are at the level of interfaces, and when a new Haskeller reaches those, suddenly they’re pragmatics again. (And then after a year you make it your master thesis and never touch Haskell again lmao.)

                                                            3. 1

                                                              Code reuse

                                                            1. 1

                                                              Is this the beginning of the universal translator?

                                                              1. 11

                                                                I rather like daily stand-up, because I get to brag about what I accomplished yesterday. It’s also usually the only time I interact with teammates from the QA, frontend dev, and UX.

                                                                I do think I’m the lone extrovert on my team, perhaps that’s why I like the stand-up meetings?

                                                                1. 12

                                                                  I rather like daily stand-up, because I get to brag about what I accomplished yesterday

                                                                  I used to feel this way too, but eventually I realized it was a pretty serious anti-pattern. If you feel like you need to spend a bunch of your co-workers’ time just to prove that you haven’t been wasting the past day then it’s probably indicative of deeper-seated trust problems.

                                                                  It’s also usually the only time I interact with teammates from the QA, frontend dev, and UX.

                                                                  This problem on the other hand, I’m more sympathetic to. But you can still schedule social meetings just to catch up with your team; if your team culture makes you feel like every meeting has to be productive all the time, I guess that’s another red flag.

                                                                  1. 7

                                                                    If it helps any, our stand-ups are always less than ten minutes long, but I see your point. I’ll think about it more.

                                                                    1. 3

                                                                      If you feel like you need to spend a bunch of your co-workers’ time just to prove that you haven’t been wasting the past day then it’s probably indicative of deeper-seated trust problems.

                                                                      Isn’t it typical for managers to distrust individual contributors like this? I constantly had to justify why I was employed ever since I left the incubator, with employers ranging from startups to dinosaurs. This is likely SRE-specific, as the pressure was at its least when I was on an all-SRE team, which suggests that the problem is ultimately due to misaligned incentives. Specifically, product managers want services to churn their features, while SREs want services to stabilize.

                                                                      1. 2

                                                                        Yeah, it is typical, and at the same time a huge red flag and and antipattern. Funny how often those things go hand-in-hand in tech companies.

                                                                      2. 2

                                                                        Not quite the bragging or justifying my existence to co-workers, but the one thing I liked about the weekly status meetings that we had on a previous project was that it made me realise that I actually had achieved something that week. We had them on a Wednesday evening and I’d often feel like I’d wasted a week by the end of Tuesday, then spend half an hour on Wednesday afternoon writing down the things I’d done that week for the status meeting and realise that I’d actually done a lot of useful things.

                                                                        I don’t know how common this is but having something that forced me to objectively look at what I’d done over a week was a really useful psychological boost and helped a lot to help counter imposter syndrome.

                                                                      3. 6

                                                                        I’m in between being an extrovert and introvert, and I think stand ups are important. Especially on a distributed team, there are potentially very few chances to get face time with your colleagues. No, your engineers won’t necessarily by default interact with each other. Yes, you should consider other formats besides yesterday/today/blockers.