Threads for wezm

  1. 5

    I built this tool over the weekend and thought I’d share it with you fellow crustaceans. It facilitates generation of RSS feeds from web pages where the elements to extract are selected via CSS selectors. I also wrote a blog post with some of the background and info on how I’m running it on my server.

    1.  

      Any chance someone could set up a community server where you enter a url and it hosts the feed for you? Seems wasteful for everyone to set up their own little servers with just a couple of feeds.

      1. 5

        My original idea was to build a web app but then I’d on the hook for keeping a service running for people and I didn’t want to sign up for that responsibility so I cut the scope. It’s certainly doable though.

    1.  

      I find these dives into Classic macOS fascinating. I didn’t have the technical knowledge I do now when I was a kid using it. So it’s interesting learning about how things worked internally and how they pulled things off like the PPC transition.

      1. 1

        Clipboard history is a game changer! CopyQ is also my go-to tool for this.

        1. 5

          I don’t really care about the framework, but that logo as the top is really cute.

          1. 3

            Everywhere the Deno mascot shows up is extremely cute :) E.g. the ones here and this loading animation.

            1. 2

              If someone makes a package that combines Deno and Go, its mascot will probably cause me to die of cute-overload.

          1. 5

            what about placing your own folder before the built-in path in the $PATH variable… that should prevent the system bundled command from shadowing your own, right?

            1. 10

              what about placing your own folder before the built-in path in the $PATH variable… that should prevent the system bundled command from shadowing your own, right?

              This enforces an order of precedence and prevents shadowing, but that’s not quite sufficient for preventing harm from a namespace collision.

              Here’s a real-world example. I use a program called edbrowse. While it is based on the venerable /bin/ed, it is not a drop-in replacement for that program.

              So about 15 years ago, I made the mistake of symlinking /usr/local/bin/ed to edbrowse, to save some typing. I was using Gentoo at the time. During a package upgrade, my package manager printed a bunch of nonsense. I don’t recall what it was exactly. After looking through ps I found the culprit. The package manager was using an ed script to patch a file. However, my ed wasn’t the one it was expecting…

              The moral of the story is that it’s better to just prevent namespace collisions outright, rather than rely on a precedence order.

              1. 3

                I do this with aliases that shadow system commands. Aliases always come first in interactive shell sessions but are not present when scripting or to other tools on the system. E.g. vimnvim, lsexa, fmtcargo fmt, topzenith, tarbsdtar. If ed was aliased to edbrowse then there would have been no issue.

            1. 1

              A colleague was asking me about fuzzing, perhaps I should send this to them along with the first part.

              Apropos: is there a good discussion of the differences between fuzzing and Property-Based Testing?

              1. 1

                I don’t think I’ve seen one, but in lieu of something more rigorous, here’s my take. It’s a bit of a fuzzy boundary, but property testing usually:

                • Allows building constrained, but richly typed values (maybe via a newtype)
                • Allows shrinking found examples
                • focusses on the relationionship between input and output (even if it’s it “it acts like this simplified model”)
                • Usually starts with random values from a distribution

                Wheras fuzzing:

                • Usually generates plain bytes
                • Doesn’t usually offer shrinking (but I’d be very happy to be wrong about that)
                • Is usually focussed on finding crashes of some kind
                • Sometimes starts from a set of known examples (eg: a jpeg file for an image loader).
                1. 2

                  Doesn’t usually offer shrinking (but I’d be very happy to be wrong about that)

                  Assuming this is the same thing I think libFuzzer does try to do that:

                  -reduce_inputs Try to reduce the size of inputs while preserving their full feature sets; defaults to 1.

                  https://www.llvm.org/docs/LibFuzzer.html

                  1. 2

                    The above maches my experience: usually that’s how the two setups look like.

                    But I want to argue that these are accidental differences – property-based testing and fuzzing is the same technique, if implemented properly. Specifically, it is possible (and rather easy) to get all of:

                    • coverage guided program exploration
                    • by a state-of-the-art fuzzing engines (AFL or libfuzzer)
                    • using highly structured data as an input (eg, the set of WASM programs which pass validation)
                    • with support for shrinking

                    The trick is to take raw bytes from fuzzer and use it as a finite PRNG you feed into property-style well-typed generator. This automatically gives you shrinking – by minimizing input raw bytes, you minimize the output well-typed struct.

                    I don’t know of a good article describing this perspective abstractly. https://fitzgeraldnick.com/2020/08/24/writing-a-test-case-generator.html is a great concrete implementation.

                    And I think the core idea of formulating property-based testing as generated structured outputs from unstructered inputs, getting universal shrinking for free was popularized (and probably invented?) by Python’s hypothesis: https://hypothesis.works/articles/compositional-shrinking/

                    1. 1

                      But I want to argue that these are accidental differences

                      That’s fair. It’s pretty nebulous, really. I feel like the main difference is the perspective, or goals, rather than anything concrete.

                1. 7

                  This all sounds really great, except this bit:

                  And on a related node, recently publish packages can be replaced with gleam publish –replace. This is useful for correcting any mistakes made during the process of releasing a package.

                  Does that mean the content of a particular version of a package can change? (Also I think there’s a typo “recent published packages”?)

                  1. 12

                    This is a feature of Hex (a package manager for all BEAM modules (erlang, elixir, gleam, etc)). The time limits are quite short so there should be very little danger:

                    There are exceptions to the immutability rule, a package can be changed or unpublished within 60 minutes of the package version release or within 24 hours of initial release of the package.

                    https://hex.pm/docs/faq#can-packages-be-removed-from-the-repository

                    1. 4

                      That’s neat !

                      I wish PyPI had this: these kind of small release mistakes can happen very easily.

                      1. 3

                        Ahh ok. The time limits make it a bit less concerning.

                        1. 6

                          Packages also come with checksums so the tooling will identify a change compared to what is expected in the lockfile.

                      2. 1

                        While we’re pointing out typos: s/related node/related note

                      1. 6

                        Got an original iPad mini lying around that stopped getting software updates from Apple long ago. Would love to put it into service somehow, even if only as a low-power ARM server, dashboard, or something. I hope this project continues to make progress.

                        1. 7

                          I found this talk from Compose Conference helpful for understanding bidirectional type checking too.

                          1. 10

                            What’s wrong with tuples?

                            1. 2

                              Seems there is some reasoning in https://github.com/gren-lang/compiler/issues/12 but it doesn’t seem particularly convincing.

                              1. 3

                                IIRC PureScript doesn’t have then either, but uses custom types instead

                                type Tuple2 a b = Tuple2 a b
                                
                                type Tuple3 a b c = Tuple3 a b c
                                

                                I kind of like this approach because it reduces parens to only be used for grouping, reducing the overall syntax variety.

                                1. 2

                                  TypeScript does have tuple types: https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types

                                  Although I’m fairly convinced by the rationale for excluding them.

                            1. 2

                              Nice to see a cross-platform Swift CLI in the wild.

                              1. 2

                                Looking forward to the video.

                                1. 2

                                  Not sure if you meant looking forward to watching the video or for it to be published. If the latter the slide deck links to https://www.youtube.com/watch?v=eNI0wFgBNmY#t=7044s

                                1. 4

                                  Whoa been following this project for a while now but was not aware of this:

                                  Overstreet said that there is already some user-space Rust code in the repository; as soon as Rust support lands in the kernel, he would like to make use of it. [..] Overstreet suggested that those who are waiting be a bit noisier to make it clear that there is demand for it.

                                  1. 5

                                    Experiences like this will prevent me from buying any more devices from PINE64. The hardware has great potential but because it doesn’t receive first-party support it’s always a battle to get something that makes full use of its potential. I wrote about my experience with it when I got mine in 2018. Since then I’ve found it’s an ok headless ARM test device running Arch Linux ARM but I will avoid getting any new PINE64 hardware (having also been sucked in by the pine phone and its keyboard).

                                    1. 7

                                      Honestly after trying several of those boards - odroid c4, rpi 3-4-400, radxa rock pi 4 and couple of pine64 (h64 and rockpro64) I like pine64 the most, it was the easiest to work with even though I’ve used OpenBSD that is not extermely popular. As any other chip rk3399 and others - they have their peculiarity but that comes not from potato vendor but just from lack of a proper standartization (dtb/uefi is a thing but still requires a lot of manual interventions.

                                    1. 5

                                      Podman v4.1 is also our first release to support Docker Compose v2.2.0 and up. Since our v3.0 release over a year ago, Podman has supported Compose v1

                                      Apparently I missed that Podman gained Docker Compose support. Last time I looked this wasn’t well supported and prevented me from switching to it completely. Might have to reinvestigate.

                                      1. 7

                                        Support for profiling multiple java threads has been added.

                                        A what now?

                                        1. 11

                                          Firefox also makes Fenix for Android. Here is some information on profiling Java code for Fenix:

                                          https://wiki.mozilla.org/Performance/Fenix/Profilers_and_Tools

                                          The page even says to not use the Firefox Profiler if you:

                                          Need access to Java threads other than the main thread (issue )

                                          Which I guess is now outdated!

                                          1. 3

                                            TIL that Firefox ships a JDK?

                                            1. 1

                                              Yeah was surprised by that one too. I assume they forget the Script in JavaScript.

                                            1. 7

                                              All I had to do was submit a GDPR data request, wait a few days for the cloud to think and then I got a 3 gigabyte zip file full of everything I’ve ever tweeted. Cool!

                                              In case anyone else is looking to get a copy of their Twitter data you don’t need to submit a GDPR data request. You can request a data export right from your profile: https://help.twitter.com/en/managing-your-account/how-to-download-your-twitter-archive

                                              I do this occasionally so I have a copy of my own tweets that’s easy to ripgrep through to find stuff I liked in the past (as I don’t believe there’s a way to search your likes on Twitter).

                                              1. 2

                                                I would like to do the same thing but out of iPhone Messages app, and without a 3rd party app.

                                              1. 1

                                                Interesting that the about box for this version of TextEdit notes it’s written in Java.

                                                1. 1

                                                  Just curious, but what is Zas Editor itself written in?

                                                  1. 2

                                                    Rust and Swift: source

                                                    1. 1

                                                      Rust for the backend and Swift for the frontend.

                                                    1. 1

                                                      This is a really interesting series and I’m curious to see how it goes for you as I’ve been pondering similar things for a project I’m working on.

                                                      One thing that’s crossed my mind is: the GPL is about allowing people to make changes and distribute those changes. What do you think of a scenario where someone buys your app, makes some changes to suit themselves or a different use case then publishes the code on GitHub, which they’re allowed to do? They don’t even really need to make changes, they could just put the code online for whatever reason.


                                                      There have been recent issues over at Elementary and one of their founders has mental issues, so not the most stable example, but still, an example.

                                                      This seems a little unfair and an unnecessary detail. Elementary has been funding itself for years (at least 7) with this model so any recent events don’t really have an impact.

                                                      1. 2

                                                        What do you think of a scenario where someone buys your app, makes some changes to suit themselves or a different use case then publishes the code on GitHub, which they’re allowed to do? They don’t even really need to make changes, they could just put the code online for whatever reason.

                                                        I’m perfectly fine with that. If I wasn’t, GPL would be a bad licensing choice. My entire GitHub profile is filled with open source, and the plan was to put leafnode there like the rest. But, this is an interesting avenue to explore, both out of curiousity and because it’s different that what I previously did.

                                                        This seems a little unfair and an unnecessary detail.

                                                        Yes, re-reading that part makes it sound way harsher than I intended. Will remove that once I’m near my workstation again.

                                                        1. 2

                                                          What do you think of a scenario where someone buys your app, makes some changes to suit themselves or a different use case then publishes the code on GitHub, which they’re allowed to do? They don’t even really need to make changes, they could just put the code online for whatever reason.

                                                          I’m perfectly fine with that. If I wasn’t, GPL would be a bad licensing choice. My entire GitHub profile is filled with open source, and the plan was to put leafnode there like the rest. But, this is an interesting avenue to explore, both out of curiousity and because it’s different that what I previously did.

                                                          There are two other problems that I’ve seen with folks who try the approach that you’re doing.

                                                          The first is a variant of the innovator’s dilemma. You’re doing the work of creating the thing, and you’re making it a bit harder for folks that don’t pay you to use it. Someone else who packages it has far less work to do than you. There’s nothing stopping someone else from building GPL’d installers and putting instructions somewhere public. They don’t have to spend any of the effort to create the thing in the first place, so they can spend more time on the packaging than you. They can easily produce something easier to install than you can, for the same investment in effort. You’re explicitly framing the sale as the end user paying for you to do the easy thing (packaging), not the difficult thing (writing the code in the first place), so you have to compete with people who do only the easy thing.

                                                          The second problem is if someone extends your code with something under a different but compatible license. For example, if they wrap it in something AGPLv3 (since you didn’t specify a GPL revision, I’m going to assume that you meant the latest version). Their fork is under a more restrictive license, will you want to take their changes? Forking is a fact of life for any open source project but when there’s a paid option then some people will intentionally license their changes under a license that they believe that upstream won’t take so that they’re not releasing work to support a paid product.

                                                          The cases have a lot in common. You’re relying on giving 95% of something away for free and charging people for the remaining 5%. Other people can easily provide that 5% and charge for it, give it away, or give it away in such a way that you’re likely to be unwilling to merge it into your version. In the latter two cases, they can add other things that differentiate their version from yours. What’s your expected strategy here?

                                                          1. 1

                                                            Every libre-non-gratis project sees gratis distribution one way or another. Conversations has several gratis forks, yet the author still makes enough from the official app to keep going. Synergy was the most popular version of their own software for many years. Etc.

                                                            1. 1

                                                              Thanks for mentioning the two. synergy has only an open core left, but I added a section on conversations.im to the page

                                                            2. 1

                                                              Do you have example cases of the scenarios described happening? I already had trouble compiling the list because for sale GPL software is quite rare. I’d love to expand the list. One example has been given in a comment below, another messaging client.

                                                              If people make use of the freedoms the GPL gives them, how is that not a wonderful thing? I do not expect to make a profit, if I a few years the running costs are covered that would be great but I even doubt that that will happen.

                                                              The return value for me if not in the money but in the experience gained. Both with the Qt framework as well as the distribution side. The extra Qt experience has lead to a promotion at work and the appimage / installer part had extended my knowledge which was also directly applicable at work. A few technical challenges gave me more insight in lower level multiplatform threading and concurrency limits with c++, (looking at you, recursive mutexes) which otherwise I wouldn’t have to dive into so deep, so all in all, even without sales I already got a large amount of value back.

                                                              And to be honest, if someone forks my app and changes or extends it, it means it (partly) fills a need they have. Enormously flattering that would be.

                                                            3. 1

                                                              I’m perfectly fine with that. If I wasn’t, GPL would be a bad licensing choice. My entire GitHub profile is filled with open source, and the plan was to put leafnode there like the rest. But, this is an interesting avenue to explore, both out of curiousity and because it’s different that what I previously did.

                                                              Fair enough. I’m curious to see how it works out too. :)

                                                            4. 1

                                                              has mental issues

                                                              Yeah, this feels off-base. Lunduke is not a good-faith arbiter here.