Threads for kaveman

  1.  

    But what’s in it for me? I actually didn’t even know I could do that and now I ask - why would I want to get my packages from there and not via apt? What are the benefits except one more tool and repo?

    1.  

      pkgsrc has quarterly releases.

      1.  

        Not every application, hardware appliance, or even general-purpose server is ideally suited to having a Linux kernel and userland underneath it.

        Docker masquerades as a cross-platform packaging and distribution tool, but what it really provides is a cross-distro abstraction for a subset of modern-ish Linux environments. Windows and Mac hosts only get support by way of a VM managed by Docker or containerd.

        Even more frustrating to me is the fact that Docker actually strengthens the dominance of 2-3 distros (Alpine, Ubuntu, and CoreOS) because they’re the standard base for most other images.

        So: pkgsrc and other “ports” systems are important to keep software running in places other than that very limited set of environments. (I likewise think that Firefox and other non-Chromium browsers are critically important so that “portable applications” don’t just mean, “runs in Electron or a browser tab.”)

        1.  

          Well one of the things is it can be bootstrapable to majority of OSes.

          https://pkgsrc.smartos.org/

          1.  

            The problem is that this is not a use case a great many people have. If you use a linux distro, you already have a package manager. If you use a BSD, it has one too. MacOS has brew (and macports, even nix). Everyone already has all the software they need so it is very hard to make a case for pkgsrc.

            A couple of years aog I got interested and played around with pkgsrc on debian to learn a thing or two. It’s cool that it exists, but it is not really all that new or useful so that people would get excited.

            I believe the reason why there is not much mindshare is that it is perceived as yet another package manager with no immediately obvious value.

            1.  

              pkgsrc is the native package manager on one of the BSDs (used to be 2) and SmartOS. On macOS, it is up there with brew and macports. On Linux, it is useful for distros that do not have their own package managers (Oasis comes to mind). Could be useful even on mainstream distros like Debian when you are stuck on the stable release and you need newer versions. That said, not all packages are up-to-date in pkgsrc but I’m glad it exists and people continue to work on it.

              1.  

                How many users does SmartOS have? It is the niche of the niche of the niche. How many people really care about NetBSD? Very few, it seems.

                pkgsrc is not up there with brew and macports. Everybody and their mom use brew, a few people - including me - use macports and a very few people use nix. I have never met anyone using pkgsrc on a Mac and I have been working in “every dev has a mac company for the last decade”.

                I am not saying pkgsrc is bad, I am saying almost nobody cares b/c there is not much to gain for someone not running NetBSD (or SmartOS) where it is the native package manager.

                1.  

                  Smartos people also provides Binary for MacOS using pkgsrc https://pkgsrc.smartos.org/install-on-macos/

        1. 3

          seems to be in early stages but an interesting development nevertheless.

          1. 1

            Not very early, really, no.

            HAMMER appeared in DragonFly 2.0 in 2008: https://en.wikipedia.org/wiki/HAMMER_(file_system)

            HAMMER2 appeared in DragonFly 3.4 in 2014. It became bootable in DragonFly 5 in 2017, and the default FS in DragonFly 5.2 in 2018. https://en.wikipedia.org/wiki/HAMMER2

            So it’s some 15 years old now. It’s a year older than Btrfs and the same age as ext4.

            V2 is 5 years old and has been the default FS in the OS for the last 7 releases.

            TBH that does not sound like “early stages” to me. YMMV.

            BTW, the reason I’ve been researching this is that I just reviewed DragonFly 6.4: https://www.theregister.com/2023/01/06/dragonfly_bsd_6_4/

            1. 2

              Aha, OK, sorry, I missed the context here. This isn’t on the native OS but on NetBSD. My apologies; I misunderstood.

          1. 8

            Why do you run it? Why not $OtherBSD? What’s the point?

            They don’t actually try to offer any answers to these questions though, and, having played around with different operating systems a fair amount in my life, it is… you know, kinda an important question. You need a pitch you can make, maybe even with some data to back it up. Even among BSD’s, why is NetBSD interesting instead of FreeBSD, OpenBSD, or DragonflyBSD? Apart from “portable to lots of systems that don’t exist anymore”, which is the only actual pitch I’ve heard anyone make for it.

            1. 6

              Well here are some thoughts of NetBSD users why they use it : https://www.unitedbsd.com/d/90-netbsd-users-why-do-you-use-it-over-freebsd-and-openbsd

              1. 5

                You need a pitch you can make

                Or maybe people could just not question other people’s choices?

                1. 3

                  People question partly out of insecurity for their own choices, but partly out of curiosity.

                  Why do you get that brand? is opening the questioner to change their mind about a brand. This question is a confused questioner asking “Ok, so when I need a new box with an OS… why might I choose NetBSD?”

                  1. 1

                    But how am I supposed to judge them on the internet if I do that? /s

                    More helpfully, every technical design is a set of tradeoffs. Those tradeoffs need to be guided by goals. What goals does NetBSD have that guides its design tradeoffs? I question people’s choices because I’m interested in the topic and want to know the answers!

                    1. 2

                      heh :-)

                      As for the design goals, NetBSD is somewhat known for looking for good abstractions. From that, ideas like rump kernel follow naturally.

                  2. 3

                    I maintain several small sites for friends (OJS, Drupal etc.) and IME NetBSD runs much better on low-spec VMs than Debian. I’d often run into MySQL crashes due to low memory which went away after switching to NetBSD. Have a bunch of ARM SBCs and NetBSD runs quite well unlike Debian which is a hit or miss and often one has to pull kernels from random GitHub repos.

                    TBH, FreeBSD is more complete and is arguably the best Linux alternative nowadays but NetBSD is not bad, especially for small servers. pkgsrc has a good selection of packages, updated quarterly. ZFS is stable (not OpenZFS 2 yet, I think). DTrace works (only a subset of providers). Xen is fairly stable (lags Linux), NVMM is the homegrown hypervisor that seems to have found a new home in DragonflyBSD. RUMP and ATF are unique to NetBSD (ok, FreeBSD has ATF ported). Even though many of the features are incomplete there is enough to make it an interesting system to study and work on.

                    Being much smaller, NetBSD is a good base for learning and experimenting. The build system is a key enabler. You just need to checkout the source tree and run build.sh. It takes care of building the cross-compilation toolchain, base system, kernel, and generating a bootable image which can then be run on the hypervisor for testing. See [0] for an example setup.

                    Jan Schaumann teaches a couple of courses that use NetBSD [1, 2]. The “Advanced Programming” course is highly recommended and can be seen as an updated version of Stevens’s classic APUE. However, for kernel development, documentation is not much beyond the man pages and mailing list posts (the kernel internals parts of the handbook are woefully incomplete).

                    Looking forward to 10.0 which is shaping up to be a great release!

                    [0] - https://t.pagef.lt/working-with-the-netbsd-kernel/ [1] - https://stevens.netmeister.org/615/ [2] - https://stevens.netmeister.org/631/

                    1. 1

                      The other problem is: How much do I gain versus what things I have to work around with. I’m probably one of the bigger Linux-on-the-desktop fans in the circles I frequent and still… some things are just better on Windows or OSX. So far, 90% of the time the same things have been even worse on the BSDs. I admit this is probably an end-user point of view and not a developer’s, but still.

                    1. 2

                      Ghuloum’s “An Incremental Approach to Compiler Construction” and Xavier Leroy’s “The ZINC Experiment - An Economical Implementation of the ML Language” are excellent resources right up there with Queinnec’s LiSP. Essentials of Programming Languages is an excellent textbook as well.

                      1. 3

                        Also, Sestoft’s “Programming Language Concepts” covers the basics (using F#). Looks like there is a newer edition as well.

                        The Loko Scheme author has a bunch of interesting posts on his scheme internals (e.g: the runtime value representation).

                        btw @eatonphil, thanks for saving a copy of “One-pass Code Generation in V8”.

                      1. 1

                        There was a tense discussion around the quality of the WireGuard implementation that was merged in 2020. I see that Wireguard support is now part of this beta release, has the situation resolved itself, or is the original author of Wireguard still unhappy with the NetBSD implementation?

                        1. 1

                          Looks like an independent implementation[0] but that was a weird request. To me it read as a cease-and-desist in developer speak. Imagine Lamport asking Paxos implementors to abandon their code because “it was hastily picked up, and not with enough study”. Liked how the NetBSD folks responded.

                          [0] - https://man.netbsd.org/wg.4

                        1. 3

                          I see that the Xen hypervisor has received major work. Where is Xen at nowadays? it doesn’t seem to receive the buzz of Firecracker, Bhyve etc… Is it still good and being used, just not trendy? Or is there some reason why people have moved away from it?

                          1. 1

                            xcp-ng continues to gain popularity.

                          1. 2

                            +1 for APUE, a classic indeed. I liked Advanced UNIX Programming more. Jan Schaumann’s CS631 course is an excellent update. Hanson’s “C Interfaces and Implementations” is a fantastic “How to C book”. “Objective-C Phrasebook” by @david_chisnall was a great read, wish more books are written in that style. Some of my other favourites in no particular order:

                            Stepanov’s Elements of Programming, Valloud’s A Mentoring Course on Smalltalk, Dybvig’s The Scheme Programming Language, Norvig’s Paradigms of AI Programming, Harper’s Programming in Standard ML Mitchell’s Machine Learning

                            Operating Systems: Three Easy Pieces, the book that made me get reading glasses, Gillam’s “Unicode Demystified”, The O’Reilly vi book and “BSD Hacks” are worth revisiting every now and then to pick up a forgotten trick or two.

                            Varghese’s Network Algorithmics, easily one of the best technical books I’ve read. Wish there’s an updated edition.

                            Alex Petrov’s Database Internals, Kleppman’s Designing Data-Intensive Applications

                            Crafting Interpreters, I made the mistake of watching the author draw the book’s diagrams, and now I’m filled with shame every time I draw. I hate you @munificent :)

                            1. 1

                              “Objective-C Phrasebook” by @david_chisnall was a great read, wish more books are written in that style

                              Thanks. I really like the Phasebook model but I definitely wouldn’t consider that book timeless. The first edition predated ARC, the second edition was a minor update for ARC. Objective-C changed quite a bit around that time.

                              1. 2

                                I re-read it a few weeks back when I was checking out GNUstep after a very long time and it seemed like it is still relevant given that GNUstep hasn’t caught up with all the Apple ObjC advancements.

                                1. 1

                                  I believe the only thing that we don’t support is direct methods. I haven’t worked out a very good way of implementing these because they have an annoying interaction with +initialise. On Apple platforms, they call +class before each call, which hits a special fast path in their runtime. We don’t have an equivalent, but possibly should. We actually shipped some things, like blocks, before Apple because they were submitting the code to LLVM at WWDC and we were cutting releases before them.

                                  Unfortunately, AppKit lagged a long way and we never got a UIKit implementation. Part of this was a desire from certain people to reinvent the wheel rather than adding dependencies. I really wanted to take a hard dependency on Cairo, Pango and ICU, but they were too slow on some ancient systems and so we ended up with three different back ends where any given thing worked better in one than the other two, but not consistently. Being a GNU project meant that there was a lot of pressure to keep supporting GCC and it’s runtime, which meant that we couldn’t use modern Objective-C features in the GNUstep codebase and so everything was more work to implement. This was particularly apparent with the lack of Objetive-C++ support, where wrapping a C++ collection let you implement various Objective-C things more efficiently and in less code, but couldn’t be committed to replace the painful GSIMap code, which implemented something like C++ templates with C macros.

                            1. 1

                              Back on GNUstep. Daily-driving it for the last week or so and it has been stable so far. The goal is to obtain a low-churn desktop environment for my machines running Debian and NetBSD. So, maybe update pkgsrc packages which seem to be a bit behind. Probably pickup fixes from NEXTSPACE if possible. Report bugs/glitches encountered so far. The text system needs work :(

                              1. 2

                                This is an interesting resolution to a open source software case. No monetary compensation, even for legal fees. Instead, a disclaimer must be added everywhere mentioning that the products (Houdini 6 and Fat Fritz 2) are derived from open source software and that they are not allowed to distribute them or any other derivatives for a year. Futhermore, they must hire a “Free Software Compliance Officer”.

                                Quite a different result than previous lawsuits I’ve heard about. It seems that the Stockfish authors care more about the recognition and continued sanctity of the license rather than punishing ChessBase.

                                1. 2

                                  indeed, that’s why I posted it here despite not being sure if it was relevant and confirmed by the initial downvote :)

                                  I used to hate the copyleft licenses because of their viral nature but having seen companies leeching the work of open-source developers, I’ve come around to using MPL 2 for libraries and GPL 2 for applications.

                                1. 29

                                  Why Twitter didn’t go down … yet

                                  I was hoping for some insights into the failure modes and timelines to expect from losing so many staff.

                                  This thread https://twitter.com/atax1a/status/1594880931042824192 has some interesting peeks into some of the infrastructure underneath Mesos / Aurora.

                                  1. 12

                                    I also liked this thread a lot: https://twitter.com/mosquitocapital/status/1593541177965678592

                                    And yesterday it was possible to post entire movies (in few-minute snippets) in Twitter, because the copyright enforcement systems were broken.

                                    1. 5

                                      That tweet got deleted. At this point it’s probably better to archive them and post links of that.

                                      1. 11

                                        It wasn’t deleted - there’s an ongoing problem over the last few days where the first tweet of a thread doesn’t load on the thread view page. The original text of the linked tweet is this:

                                        I’ve seen a lot of people asking “why does everyone think Twitter is doomed?”

                                        As an SRE and sysadmin with 10+ years of industry experience, I wanted to write up a few scenarios that are real threats to the integrity of the bird site over the coming weeks.

                                        1. 12

                                          It wasn’t deleted - there’s an ongoing problem over the last few days where the first tweet of a thread doesn’t load on the thread view page.

                                          It’s been a problem over the last few weeks at least. Just refresh the page a few times and you should eventually see the tweet. Rather than the whole site going down at once, I expect these kinds of weird problems will start to appear and degrade Twitter slowly over time. Major props to their former infrastructure engineers/SREs for making the site resilient to the layoffs/firings though!

                                          1. 2

                                            Not only to the infra/SREs but also to the backend engineers. Much of the built-in fault-tolerance of the stack was created by them.

                                        2. 2

                                          https://threadreaderapp.com/thread/1593541177965678592.html

                                          I have this URL archived too, but it seems to still be working.

                                          1. 1

                                            hm, most likely someone would have a mastodon bridge following these accounts RT-ing :-)

                                          2. 2

                                            FWIW, I just tried to get my Twitter archive downloaded and I never received an SMS from the SMS verifier. I switched to verify by email and it went instantly. I also still haven’t received the archive itself. God knows how long that queue is…

                                            1. 2

                                              I think it took about 2 or 3 days for my archive to arrive last week.

                                          3. 2

                                            oh, so they still run mesos? thought everyone had by now switched to k8s…

                                            1. 13

                                              I used to help run a fairly decent sized Mesos cluster – I think at our pre-AWS peak we were around 90-130 physical nodes.

                                              It was great! It was the definition of infrastructure that “just ticked along”. So it got neglected, and people forgot about how to properly manage it. It just kept on keeping on with minimal to almost no oversight for many months while we got distracted with “business priorities”, and we all kinda forgot it was a thing.

                                              Then one day one of our aggregator switches flaked out and all of a sudden our nice cluster ended up partitioned … two, or three ways? It’s been years, so the details are fuzzy, but I do remember

                                              • some stuff that was running still ran – but if you had dependencies on the other end of the partition there was lots of systems failing health checks & trying to get replacements to spin up
                                              • Zookeeper couldn’t establish a quorum and refused to elect a new leader so Mesos master went unavailable, meaning you didn’t get to schedule new jobs
                                              • a whole bunch of business critical batch processes wouldn’t start
                                              • we all ran around like madmen trying to figure out who knew enough about this cluster to fix it

                                              It was a very painful lesson. As someone on one of these twitter threads posted, “asking ‘why hasn’t Twitter gone down yet?’ is like shooting the pilot and then saying they weren’t needed because the plane hasn’t crashed yet”.

                                              1. 8

                                                Twitter is well beyond the scale where k8s is a plausible option.

                                                1. 2

                                                  I wonder what is the largest company that primarily runs on k8s. The biggest I can think of is Target.

                                                  1. 3

                                                    There’s no limit to the size of company that can run on kube if you can run things across multiple clusters. The problem comes if you routinely have clusters get big rather than staying small.

                                                    1. 1

                                                      Alibaba, probably.

                                                      1. 1

                                                        Oh, I didn’t realize that was their main platform.

                                                      2. 1
                                                        1. 2

                                                          I was thinking about that too, but I’m guessing that CFA has a fraction of the traffic of Target (especially this time of year). Love those sandwiches though…

                                                    2. 2

                                                      Had they done so, I bet they’d already be down :D

                                                      1. 1

                                                        I work at a shop with about 1k containers being managed by mesos and it is a breath of fresh air after having been forced to use k8s. There is so much less cognitive overhead to diagnosing operational issues. That said, I think any mesos ecosystem will be only as good as the tooling written around it. Setting up load balancing, for instance . . . just as easy to get wrong as right.

                                                    1. 6

                                                      For something not emulating a tty, http://man.9front.org/1/rio under section “Text windows”.

                                                      1. 6

                                                        tt[0] (2/3 of a tty) is a small, neat implementation of the ideas found in 9term.

                                                        [0] https://github.com/leahneukirchen/tt

                                                        1. 5

                                                          Heh. Came here to say “try Plan 9 for a decades-old implementation of something better than TTY emulation” and found you had beaten me to it :)

                                                          1. 2

                                                            Yeah, that was my instinct, too. You can just simplify and get all that stuff for free, or complexify and attempt to recreate a lot of functionality on your own. For what it’s worth, emacs’ M-x shell with some tweaks can work very similarly to an acme win window. And you get all the cut/paste/edit/hover functionality you have in emacs.

                                                        1. 27

                                                          Author here. Containers always seemed a little magical to me. So I dug into how they work and then built a “container runtime” that only uses the change root sys call (Which has been in UNIX since the 70s).

                                                          This was not only fun, but took a way a bit of the magic, so I could better understand what’s going on when I use real containers.

                                                          Let me know what you think!

                                                          Edit:

                                                          Fun fact: In my first draft of the article, I had this idea that it would be about time travel. If I went back in time, how far back could I still implement something like containers, and so I was focused on just using chroot because it’s so old.

                                                          If people like this type of stuff, I’ll do namespaces next but pick a less inflammatory name like “How X helped me understand containers.”

                                                          1. 6

                                                            Edit (again): Ignore me, I’m old and when I was administering a big freebsd shared hosting platform in 2005 a chrooted jail was a very specific thing (it was a chrooted jail!). It’s clear reading around that the term has taken on broader meaning to just refer to chroot. My apologies to author, this appears to be the accepted use.

                                                            It feels like you might be misunderstanding the term “chrooted jail” which is referring to the combination of the use of chroot with FreeBSDs jail. The reason I mention that is because then in the footnote you mention cgroups offer more protections than chroot, but that’s also the point of jail. Anyway this part confused me 😳

                                                            Edit:

                                                            On the whole I liked the post as a kind of dive into a linux syscall and what you can do with it. However I’m a little bit concerned about simplifying the idea of a container a chroot. When I think of containers I explicitly think of them as a binding between a kind of chroot and some process controls that enforce behavior. Wether that’s BSDs chrooted jails, illumous zones, or linux’s chroot, and cgroups.

                                                            1. 4

                                                              I had the same initial reaction, and I thought that must be wrong, linux does not have jails. Then, I realized, of course, the reason is simply some linux people are not aware of jails at all.

                                                              1. 8

                                                                There are dozens of us!

                                                              2. 2

                                                                Oh, interesting.

                                                                I didn’t see that it’s used to refer to BSD jails, but to using chroot on Linux. Here is an example:

                                                                A chroot jail is a way to isolate a process and its children from the rest of the system. It should only be used for processes that don’t run as root, as root users can break out of the jail very easily.

                                                                The idea is that you create a directory tree where you copy or link in all the system files needed for a process to run. You then use the chroot() system call to change the root directory to be at the base of this new tree and start the process running in that chroot’d environment.

                                                                https://unix.stackexchange.com/questions/105/chroot-jail-what-is-it-and-how-do-i-use-it

                                                                Here is another

                                                                And you can find many explanations that seem to call the changed root a ‘chroot jail’.

                                                                1. 4

                                                                  I updated my first comment, a quick search shows that you are very much using this term how folks expect. Unfortunately I worry this might be a case of getting old.

                                                                  1. 2

                                                                    Oh that makes me very sad. That seems like it has got to be a kind of false appropriation of one communities terminology into another right? 😰

                                                                    1. 3

                                                                      I’m not sure what the exact chronology of FreeBSD jails is, but I was definitely calling chroot environments “chroot jails” in the late 90s/early 00s. So maybe you’re both old and young 😁

                                                                      Edit: neck-and-neck! Looks like they were released in March 2000

                                                                      1. 2

                                                                        Jails landed in FreeBSD in ‘99. The place I was using them I think opened in 2000-2001. Now I don’t believe anything about my own memory. Except that at the least in the circles I was running in a chrooted jail meant something different than being chrooted haha.

                                                                        1. 6

                                                                          https://www.cheswick.com/ches/papers/berferd.pdf This paper was written ~ 1992

                                                                          On 7 January 1991 a cracker, believing he had discovered the famous sendmail DEBUG hole in our Internet gateway machine, attempted to obtain a copy of our password file. I sent him one. For several months we led this cracker on a merry chase in order to trace his location and learn his techniques.

                                                                          This paper is a chronicle of the cracker’s “successes” and disappointments, the bait and traps used to lure and detect him, and the chroot “Jail” we built to watch his activities

                                                                          I would guess (based on no evidence at all) that the name “jail” for the *BSD feature was probably inspired by existing usage. My recollection of the 1990s was that it was fairly common to refer to setting up chroot jails for things like anonymous ftp servers

                                                                          1. 2

                                                                            Nice! So the BSD jail would be have been like “now you can REALLY jail your jail” :-D

                                                                2. 3

                                                                  sailor[0] and captain[1] implement pseudo-containers for NetBSD using chroot.

                                                                  [0] https://gitlab.com/iMil/sailor [1] https://gitlab.com/jusavard/captain/

                                                                  1. 2

                                                                    This is a really cool article, thanks for writing it. Do you have thoughts on newer system calls and how they can be used to improve isolation? I’m thinking of pledge specifically from here but I know there are a ton of others as well.

                                                                    1. 1

                                                                      Thanks! I really don’t know much about pledge, but I think Andreas Kling has some videos on adopting it for Serenity that have been on my to-watch list.

                                                                      https://awesomekling.github.io/pledge-and-unveil-in-SerenityOS/

                                                                    2. 2

                                                                      The difference between chroot and containers was the marketing splash, but that marketing spend could’ve been a dud. The tooling and arguably saner defaults around docker was what sold it. chroot (jails) were the province of the FreeBSD folks (and maybe Solaris) and linux only had chroot with less protections. chroot ended up being known more as a security flaw (due to misuse) than as a feature: https://cwe.mitre.org/data/definitions/243.html but docker, et al have kept enough sane defaults to make container escapes conference talk fodder but not large-scale malicious actor toolkit. Small scale state actors, who knows.

                                                                    1. 4

                                                                      Ok, but all of this is sh, not emacs, right?

                                                                      1. 5

                                                                        it is about emacs letting you compose the functions provided by the utilities, provide ways to trigger (M-x or even a key combination when used often), and provide a presentation of the result.

                                                                        1. 4

                                                                          As an Emacs user, if the feature is well integrated and useful, I’m not too fussy about its implementation.

                                                                          The feature, though using a tiny shell script and command line utility, is surfaced via Emacs M-x. It knows whether to apply functionality to current image buffer or file selection in dired. When I use it, I interact with Emacs.

                                                                          1. 3

                                                                            Or really, perl (exiftool).

                                                                          1. 2

                                                                            Built on top of KJ! KJ is a little known foundational C++ library that is small, readable, and packs a lot of features. The code base is a great resource for learning modern C++.

                                                                            1. 2

                                                                              Surprisingly few distros package xmake. This seem like the next thing to address, to ensure people actually adopt xmake. Xmake has for a long time seemed like the next step in C++ building.

                                                                              1. 2

                                                                                Yes, but I only commit into some aur repositories. I don’t know how to commit to the offical repositories.

                                                                                https://github.com/xmake-io/xmake/issues/941

                                                                                1. 1

                                                                                  The supported toolchain list is impressive. Could very well replace cmake for me. Trying to package it for pkgsrc but the name clashes with Matt Dillon’s xmake (also present in FreeBSD and OpenBSD ports tree). Wish people did a quick scan for potential clashes when naming their projects especially when it has the potential to take off.

                                                                                1. 4

                                                                                  almost all of these storage engines write to files on a filesystem which in turn takes these serialized tree-of-pages and writes them back into a tree-of-blocks on disk. Would be interesting to see these engines run on block devices directly and avoid the intermediate conversion. For example, could zfs’s DMU be used directly without the POSIX layer? There were talks on the mailing list a long time ago but don’t think anything came out of it. The kernel interfaces make it so hard to even experiment though. SPDK looks interesting.

                                                                                  1. 3

                                                                                    Ceph OSDs running the BlueStore backend use RocksDB directly on a raw block device for metadata storage.

                                                                                    Ext4 has extents, long ranges of contiguous blocks of a file, to save on block pointers, avoiding the problem you’re talking about. This only helps for single-file databases, so Postgres is out. However the directory contents of Postgres’ backing storage are almost certainly 100% resident in the filesystem cache, so it’s a non-issue in practice.

                                                                                    1. 1

                                                                                      Embedded databases like BDB and SQLite are most popular on client systems where either you don’t have permission to do block-level I/O, or you don’t want the end user to have to custom partition a disk just to use your app.

                                                                                      SQLite does get used in a lot of embedded systems where there’s no real OS to get in your way, and it has a virtual filesystem interface that allows the client to do the block-level I/O if it wants. But it turns out that doing block-level I/O on flash storage is a real pain if the controller hardware doesn’t have an adapter to take care of stuff like block subdivision and erasing and wear-leveling. And the simple SPI flash interfaces on microcontrollers generally don’t, in my experience.

                                                                                    1. 3

                                                                                      Pleasantly surprised to see a standalone implementation. Was expecting it to tie into an implementation’s runtime compiler, something like polyml’s IDE protocol[0]. Tooling for SML is most welcome.

                                                                                      [0] https://www.polyml.org/documentation/IDEProtocol.html

                                                                                      1. 9

                                                                                        Heh, the only thing I think I need is some variant of ML with rust-level quality of implementation. Specifically, I think I need:

                                                                                        • Functional programming language (as in “programming with values”, not as in “programming with category theory”)
                                                                                        • Aimed at high-level programs (think Java/Go/Swift/Python/Ruby/C#)
                                                                                        • With ruthless focus on human side in the human-computer continuum (so, all ints are big ints, no thinking about stack vs heap, no async in surface-syntax)
                                                                                        • And reasonable concurrency story (either Erlant-style separte heaps, or, if someone invents Send/Sync+borrow checker which is not hard, that)
                                                                                        • With low-overhead implementatin (seamlessly works on all platforms, fast to compile, static binaries)
                                                                                        • And a minimal type-system which strongly encourages low-abstraction code, but still allows implementing JSON serialization in a non-horrible way.

                                                                                        Basically, today I use Rust for everything because it “just works” more than anything else I’ve tried (didn’t’ try Go though), but I really don’t need blazing fastness for eg, my shell scripts. OCaml is in theory what I need, but I find it’s quality of implementation lacking.

                                                                                        1. 4

                                                                                          Reading the list, I was definitely thinking that OCaml almost fits the bill. Its compiler is actually very good (when it comes to emitting correct code, being fast, and having few compiler bugs).

                                                                                          What is lacking is indeed a few “modern” things:

                                                                                          • no standard deriving/serde (where rust clearly shines)
                                                                                          • bigints are not the default (zarith is neat but it’s not as seamless as int)
                                                                                          • the portability/static binary story is lacking.

                                                                                          It’s really sad, because OCaml with some of Go’s tooling qualities would be incredible. Maybe someone will step up and develop the next ML :-).

                                                                                          1. 6

                                                                                            Yeah, OCaml is frustratingly close, but I also have a few gripes with its inner workings:

                                                                                            • objects are redundant
                                                                                            • polymorphic equality/hash/comparison is awkward, which is a sign of a deeper ad-hoc polymorphism issue
                                                                                            • compilation model with a shared global namespace and without explicit DAG of dependencies is pretty horrible (ocamldep is one of the grossest hacks in my book)
                                                                                            • no mature multicore support
                                                                                            1. 2

                                                                                              ocaml objects aren’t any more redundant than any feature in any language that has more than one way to do things. they may not be much used due to cultural/ecosystem choices, but every now and then they are the most ergonomic solution to what i’m trying to do.

                                                                                              the namespace issues are indeed a pain though :( after getting a day job working in python i have been dissatisfied with namespacing in both ruby and ocaml, which are otherwise two of my favourite languages.

                                                                                          2. 1

                                                                                            Seems like any of Haskell/OCaml/Rust/Swift fits this bill depending on your other tastes.

                                                                                            1. 7

                                                                                              Not at all:

                                                                                              • Rust prioritizes machine friendliness over human friendliness, the entire language is basically build around stack/heap distinction
                                                                                              • OCaml suffers from QoI issues (elaborated in a different comment)
                                                                                              • Haskell suffers from different QoI issues (fragmentation due to language pragmas, opaque behavior due to laziness, forces the programmer on the path of programming with categories rather than programming with values, build/packaging issues)

                                                                                              Swift kinda at least is in the right ballpark I think, but there’s a big issue of platform comparability: if I understand correctly, a lot of weight is pulled by MacOS specific foundation library. And it also has quite a bit more complex type system than I think is optimal.

                                                                                              Kotlin is kinda like Swift: great direction, but suffers from JVM platform and from comparability with Java.

                                                                                              1. 2

                                                                                                forces the programmer on the path of programming with categories rather than programming with values

                                                                                                Would you mind elaborating on this distinction? It’s the first time I’ve heard it made.

                                                                                                1. 4

                                                                                                  When people talk about functional programming, two different pictures come to mind.

                                                                                                  One is that of an advanced type-system, with roots in category theory. Keyword here is “monad”. This style of programming focuses on producing highly abstract, high order code, where you not so much do things directly, but rather provide an abstract description of computation in a DSL. Prime examples of this aspect of FP are Haskell and certain corners of Scala ecosystem.

                                                                                                  The different picture is that of non-imperative programming. Basically, everything is an immutable data structure, so every bit of program logic is just a function which takes some value as an input, and produces a different value as an output. Keyword would be “Algebraic Data Type”. This style of programming is direct: the code describes a sequence of transformation steps, it is mostly first-order. Prime examples of this aspect of FP are Clojure and Erlang, to a lesser extent OCaml, and, among more obscure languages, Elm.

                                                                                                  In my personal style I of programming, I’ve found that I really enjoy directness and simplicity, and that I fight overuse of abstraction more often than the lack of it. I am basically a Go programmer in my heart. So, I run towards FP as programming with values, and look skeptically at FP as programming with categories.

                                                                                            2. 1

                                                                                              Doesn’t Erlang/Elixir almost fill the bill. The only place where it lacks a little is 5th point, but:

                                                                                              • With releases where you do not use NIFs you can just compile once, run everywhere (as soon as you have runtime)
                                                                                              • You can build cross-releases with the ERTS included into the release which make the deployment almost self-contained (and with statically linked source ERTS is is self contained)
                                                                                              • There are project like Burrito that make all the above much simpler.
                                                                                              1. 2

                                                                                                Yeah, I think Erlang’s runtime is quite close to what I want. I do need mandatory static types though, as they unlock a lot of automated tooling with strong guarantees of correctness.

                                                                                                1. 7

                                                                                                  There is Gleam by @lpil that may fit your needs.

                                                                                              2. 1

                                                                                                D is kind of that, but somewhat more heavily weighted towards allowing performance optimization. So generally you don’t need to think about stack/heap etc, but you can if you want to. And you need to put in a bit of effort to use it in a pure functional style, but it’s very possible.

                                                                                                1. 1

                                                                                                  “only thing”? you seem to want everything :)

                                                                                                  OCaml comes close… so does F# except for the static binaries. Scala native could be considered too… the runtime seems light but the concurrency story is missing. SML+pony runtime tacked on would be lovely.

                                                                                                  1. 1

                                                                                                    Yes, I do want quite a bunch of things, but I want only the boring things: I don’t need dependent types, give me rather a build system which doesn’t make me cry :)

                                                                                                    SML+pony runtime tacked on would be lovely.

                                                                                                    Yeah, someone here said once “Go should have been SML with channels”, and yes, that’s a good terse approximation to what I want.

                                                                                                    1. 1

                                                                                                      Yeah, someone here said once “Go should have been SML with channels”, and yes, that’s a good terse approximation to what I want.

                                                                                                      “SML with channels” sounds like Erlang to me….

                                                                                                1. 7

                                                                                                  This is honestly the only thing that’s been holding me back from making anything in rust. Now that it’s going into GCC there’s probably going to be a spec and hopefully slower and more stabler development. I don’t know what’s going to come after rust but I can’t find much of a reason to not jump ship from C++ anymore.

                                                                                                  1. 33

                                                                                                    I doubt a new GCC frontend will be the reason a spec emerges. I would expect a spec to result from the needs of the safety and certification industry (and there already are efforts in that direction: https://ferrous-systems.com/blog/ferrocene-language-specification/ ) instead.

                                                                                                    1. 15

                                                                                                      Thanks for highlighting that. We’re well on track to hit the committed release date (we’re in final polish, mainly making sure that the writing can be contributed to).

                                                                                                    2. 6

                                                                                                      hopefully slower and more stabler development

                                                                                                      As per usual, slower and more stable development can be experienced but using the version of rust in your OS instead of whatever bleeding edge version upstream is shipping…

                                                                                                      1. 1

                                                                                                        Unless one of your dependencies starts using new features as soon as possible.

                                                                                                        1. 4

                                                                                                          Which is the exact same problem even when using GCC Rust, so it’s not really a relevant argument.

                                                                                                          1. 4

                                                                                                            Stick with old version of dependency?

                                                                                                            1. 21

                                                                                                              Let’s be honest, Rust uses evergreen policy, the ecosystem and tooling follows it, and fighting it is needless pain.

                                                                                                              I still recommend to update the compiler regularly. HOWEVER, you don’t have to read the release notes. Just ignore whatever they say, and continue writing the code the way you used to. Rust keeps backwards compatibility.

                                                                                                              Also, I’d like to highlight that release cadence has very little to do with speed of language evolution or its stability. Rust features still take years to develop, and they’re just released on the next occasion. This says nothing about the number and scale of changes being developed.

                                                                                                              It’s like complaint that a pizza cut into 16 slices has too many calories, and you’d prefer it cut into 4 slices instead.

                                                                                                              1. 2

                                                                                                                The time it takes to stabilize a feature doesn’t really matter though if there are many many features in the pipeline at all times.

                                                                                                                1. 10

                                                                                                                  Yup, that’s what I’m saying. Number of features in the pipeline is unrelated to release frequency. Rust could have a new stable release every day, and it wouldn’t give it more or less features.

                                                                                                              2. 3

                                                                                                                Do that, and now you’re responsible for doing security back-ports of every dependency. That’s potentially a lot more expensive than tracking newer releases.

                                                                                                                1. 13

                                                                                                                  So then don’t do that and track the newer releases. Life is a series of tradeoffs, pick some.

                                                                                                                  It just seems like a weird sense of entitlement at work here: “I don’t want to use the latest version of the compiler, and I don’t want to use older versions of dependencies because I don’t want to do any work to keep those dependencies secure. Instead I want the entire world to adopt my pace, regardless of what they’d prefer.”

                                                                                                                  1. 1

                                                                                                                    The problem with that view is that it devalues the whole ecosystem. You have two choices:

                                                                                                                    • Pay a cost to keep updating your code because it breaks with newer compilers.
                                                                                                                    • Pay a cost to back-port security fixes because the new version of your dependencies have moved to an incompatible version of the language.

                                                                                                                    If these are the only choices then you have to pick one, but there’s always an implicit third choice:

                                                                                                                    • Pick an ecosystem that values long-term stability.

                                                                                                                    To give a couple of examples from projects that I’ve worked on:

                                                                                                                    FreeBSD maintains very strong binary compatibility guarantees for C code. Kernel modules are expected to work with newer kernels within the same major revision and folks have to add padding to structures if they’re going to want to add fields later on. Userspace libraries in the base system all use symbol versioning, so functions can be deprecated, replaced with compat versions, and then hidden for linking by new programs. The C and C++ standards have both put a lot of effort into backwards compatibility. C++11 did have some syntactic breaks but they were fairly easy to mechanically fix (the main one was introducing user-defined string literals, which meant that you needed to insert spaces between string literals and macros in old code) but generally I can compile 10-20-year old code with the latest libraries and expect it to work. I can still compile C89 code with a C11 compiler. C23 will break C89 code that relies on some K&R features that were deprecated in 1989.

                                                                                                                    Moving away from systems code and towards applications, GNUstep uses Objective-C, which uses late binding by default and (for the last 15 years or so) even extends this to instance variables (fields) in objects, so you don’t even have an ABI break if a library adds a field to a class that you subclass. Apple has been a bit more aggressive about deprecating things in their OpenStep implementation (Cocoa), but there are quite a few projects still around that started in 1988 as NeXTSTEP apps and have gradually evolved to be modern macOS / iOS apps, with a multi-year window to fix the use of features that were removed or redesigned in newer versions of Cocoa. You can still compile a program with XCode today that will run linked against a version of the Cocoa frameworks in an OS release several years old.

                                                                                                                    The entitlement that you mention cuts both ways. If an ecosystem is saying ‘whatever you do, it’s going to be expensive, please come and contribute to the value of this ecosystem by releasing software in it!’ then my reaction will be ‘no thanks, I’ll keep contributing to places that value long-term stability because I want to spend my time adding new features, not playing catch up’.

                                                                                                                    LLVM has the same rapid-code-churn view of the world as Rust and it costs the ecosystem a lot. There are a huge number of interesting features that were implemented on forks and weren’t able to be upstreamed because the codebase has churned so much underneath it that updating was too much work for the authors.

                                                                                                          2. 3

                                                                                                            Corroding codebases! this was my reason too for not switching from C++. Only last week I was thinking of dlang -betterC for my little “system programming” projects. It is now hard not to ignore rust. perhaps after one last attempt at learning ATS.

                                                                                                          1. 1

                                                                                                            I see bellcore… did it use MGR? That was a neat little windowing system with a bunch of interesting ideas.

                                                                                                            1. 1

                                                                                                              There was definitely an X port. I can’t remember if MGR was available or not though I wouldn’t be surprised.

                                                                                                              1. 2

                                                                                                                Coherent got X11 before it got TCP/IP. The X11 programs were compiled to use a library that provided IP over named pipes rather than using the network. I don’t remember there ever being a commercial networking stack for the product from Mark Williams. Someone did successfully add TCP/IP after Mark Williams went out of business. I dimly remember an AT&T MGR port but I could be wrong.

                                                                                                                I wish that the effort that went into making X11 work had been used for TCP/IP networking instead. I believe that X11 would have been easier to port if TCP/IP was available and the delay would have also meant working with a later version of XFree86. XFree86 was improving rapidly at that time so the delay would have meant better quality code all around. It didn’t work out that way for a lot of reasons. The X11 vs networking issue seems like a big blunder but looking back with a realistic eye toward the fog of war reveals that the decision was not controversial at all. It should have been clear that TCP/IP would be a big player in networking between 1993 and 1997 but earlier on it wasn’t obvious that TCP/IP would subsume and replace all other networks.

                                                                                                                The mid ‘90s were a weird time in Unix. There were a handful of sanctioned AT&T Unix OS’s for the i386. I remember SCO, Interactive Unix, and Xenix to mention 3. Bill Jolitz and his wife had just released 386BSD. There was Coherent which, ran on both the 286 and the 386, and wasn’t based on AT&T code. Coherent had been reviewed and vetted as such by Dennis Ritchie. And obviously, Linux had just appeared.

                                                                                                                1. 2

                                                                                                                  Calling out all greybeards, can we get a MGR port to NetBSD, pretty please!?

                                                                                                              2. 1

                                                                                                                MGR

                                                                                                                AFAIK, no.

                                                                                                                There was a 3rd party X server, for X11R5: https://www.autometer.de/unix4fun/coherent/third_party.html

                                                                                                                A relatively recent look at Coherent: https://virtuallyfun.com/wordpress/2017/12/19/coherent-3-0/

                                                                                                                Later the company did its own version – here’s the manual: https://www.nesssoftware.com/home/mwc/doc/coherent/x/pdf/X11.pdf