Better HN
topnewbestaskshowjobs
Log inSign up

haradion

41 karma · joined Jul 16, 2022 (4y ago) · 31 submissions

Submissions

comment 1w ago · link · parent

This has not been a good month for the LAMP stack…

comment 9mo ago · link · parent

It doesn't really hurt in practice because it's only one part of the full backup procedure. Deduplicate to save space; re-duplicate the (smaller) backups to separate media for redundancy; scrub regularly for bit rot and rotate your media. A proper backup system requires all but the first of those anyway.

comment 11mo ago · link · parent

If you squint hard enough, this is really a pretty similar idea to Polkit [0] but with a much simpler communication layer.

[0]: https://polkit.pages.freedesktop.org/polkit/

comment 1y ago · link · parent

> All these named reset types could just be two separate reset commands, both pointing to a commit, one resetting the files on disk, one resetting the index.

It sounds to me like you want `git restore -W` and `git restore -S`.

comment 1y ago · link · parent

For the compiler in particular, it's pretty common practice to depend on a recent version. The backward compatibility situation is generally excellent, so the only real challenge is getting the compiler installed. That's generally straightforward with rustup, and Debian/Ubuntu also package several versions (under different package names) that are more recent than the distro's default.

comment 1y ago · link · parent

With the right workspace mapping, you can pull in just part of the depot, which makes the repo size a lot more manageable.

comment 1y ago · link · parent

The Unison programming language is built around that idea: https://www.unison-lang.org/docs/the-big-idea/

comment 1y ago · link · parent

YMMV, naturally, but I've found that some embedded devices have really excellent hardware abstraction layers in Rust that wrap the majority of the device's functionality in an effectively zero-overhead layer. Timers? GPIO? Serial protocols? Interrupts? It's all there.

- https://docs.rs/atsamd-hal/

- https://docs.rs/rp2040-hal/

comment 1y ago · link · parent

> or that third type of schema whose name escapes me

RRELAX NG, perhaps?

comment 1y ago · link · parent

Well, for one thing, classic Outlook's HTML rendering engine (to the extent it's even an "HTML" rendering engine instead of a Word document rendering engine) has some fairly radical divergences from standard HTML/CSS behavior. For those of us who have to generate HTML e-mail for whatever reason, it's distinctly unpleasant.

That might not be enough reason in and of itself to throw out the whole application, but I sure won't miss that one part of Outlook.

comment 2y ago · link · parent

> The logical model is identical for every source control system.

Most source control systems have some common logical concepts (e.g. files and directories), but there's actually significant divergence between their logical models. For instance:

- Classic Perforce (as opposed to Perforce Streams) has a branching model that's very different from Git's; "branches" are basically just directories, and branching/merging is tracked on a per-file basis rather than a per-commit basis. It also tracks revisions by an incrementing ID rather than hashes. - Darcs and Pijul represent the history of a file as an unordered set of patches; a "branch" is basically just a set of patches to apply to the file's initial (empty) state.

All of that is above the physical state, which also differs:

- Perforce servers track files' revision histories in a directory hierarchy that mirrors the repository's file structure rather than building a pseudo-directory hierarchy over a flat object store. - Fossil stores everything in an SQLite database.

> Is that relevant to something?

Yes. You can use a VCS reasonably effectively if you understand its logical model but not its physical storage model. It doesn't work so well the other way around.

comment 2y ago · link · parent

The file contents are logically distinct blobs. Packfiles will aggregate and delta-compress similar blobs, but that's all at a lower level than the logical model.

comment 2y ago · link · parent

Especially with Vue 3, most of the reactive state management you need for all but the largest and most complex of apps is built right into the core. Vuex and Pinia really aren't necessary for most users.

comment 2y ago · link · parent

OpenSSL does provide a callback mechanism to allow for key logging, but the application does have to opt in. IIRC, at least Curl does support it by default.

comment 2y ago · link · parent

I've found MDN and the Rust programming language docs to be pretty solid.

comment 2y ago · link · parent

I've found Nushell (https://www.nushell.sh/) to be really handy for ad-hoc data manipulation (and a decent enough general-purpose shell).

comment 3y ago · link · parent

`git range-diff` can be handy for the reviewer when trying to "recover from" a mid-review force-push.

comment 3y ago · link · parent

I've got both a Metropolitan and a Prera, and I can second (third?) this recommendation. Fantastic pens.

comment 3y ago · link · parent

For the specific use case you're describing, I've found `git worktree` to be very useful.

Overall, at least when it comes to features, I've actually had the opposite experience. That said, I'm one of those people such that you can pry `git rebase` out of my cold, dead hands, so it's that feature specifically that I really miss when I have to work with Perforce.

comment 3y ago · link · parent

Shallow/sparse clones help with some of the pain points there, at least around time to clone and local repo size.

comment 3y ago · link · parent

At least by Wikipedia's chosen sources [0], the attempted assassination of Gov. Boggs was linked, via circumstantial evidence, to Joseph's bodyguard, Porter Rockwell (who, even within the "Mormon" Church, is considered a somewhat controversial figure), but the culprit's true identity isn't exactly a settled question.

[0] https://en.m.wikipedia.org/wiki/Joseph_Smith#cite_note-156

comment 3y ago · link · parent

By mainstream Christian standards, the doctrine is, quite frankly, "heretical", but members of The Church of Jesus Christ of Latter-day Saints (the primary branch of "Mormonism") very much consider themselves Christian, have values that align strongly with many other Christian denominations, place Christ at the center of their doctrine, etc. In my opinion, culturally, we're a lot more Christian than the typical perception would suggest.

That being said, we've got our own offshoot groups that we don't consider "really Mormon", so I get where people are coming from on that question.

comment 3y ago · link · parent

At least for (unlocked) flake sources, you could probably use a branch naming convention instead of a separate database, although that requires your repo to be set up a specific way.

comment 3y ago · link · parent

In my experience, this often indicates a poorly-fitting cut. If your belt naturally sits below your hips, you'll probably want jeans specifically designed for that.

comment 3y ago · link · parent

The same thing applies to any binaries downloaded from their site, so unless you you've got signed binaries (that use an independently obtained/verified chain of trust), trusting the server is your your only option. Even with signed binaries, you're still trusting the entity that holds the signing key.

comment 4y ago · link · parent

Sure, in many cases. Depending on the situation, though, it may be no more hassle than any other USB GPIO device, so it's a decent enough cheap solution if you can't or don't want to use a Pi or a similar SBC.

comment 4y ago · link · parent

A little microcontroller with USB support (I like the Raspberry Pi Pico) can help with your GPIO woes.

comment 4y ago · link · parent

Your experience with NixOS mirrors mine. I got hibernation working with a little fiddling. Suspend-then-hibernate also mostly works but occasionally turns my laptop sleeve into an Easy-Bake oven, so I've started triggering hibernation manually before I put it away. Plasma's touch pad settings help a bit with the extra clicks, but a little extra palm rejection is something I wouldn't complain about. Pretty happy overall, though.

comment 4y ago · link · parent

When you follow the restrictions on stackless coroutines, the coroutine can, as you mentioned, elide stack allocations for the "child" coroutines. If you want to make a call that can't have its stack allocation elided, you explicitly tell the runtime to spawn it as a top-level task.

comment 4y ago · link · parent

> I mean, with "traditional" coroutines, it isn't the "language's runtime" which calls back into my code: it is whatever code completed the event. I get that the important part of this sentence is the interest in "push" vs. "poll", but this concept of the existence of a "language's runtime" is a bit strange to me, as my mental model of a coroutine doesn't involve a "runtime" and certainly doesn't involve an "executor".

Syntactically, many languages represent the operation of calling into the next continuation as a regular return (for green threads) or a regular function call (call/cc), but there's always some degree of runtime magic involved in the generated code. For instance, rather than just incrementing or decrementing the stack pointer, you've got to potentially set it to point into a totally different runtime-allocated stack. In principle, that can probably be implemented as just special-case code generation rather than an actual call into the runtime's routines, but that still leaves the need to clean up the current task's stack after it returns (or does a tail call into another stack), which will be either an explicit runtime call or rely on the runtime's garbage collector.

The real magic, though, isn't so much in the user-written continuations as it is on "async blocking" calls for things like I/O.

> In a more complex scenario, the function A is going to do something mysterious and later get a callback from something -- which you might call a "runtime" but which almost certainly isn't implemented by the "language" -- on some random background thread running an I/O loop, or maybe due to a signal / handler from the operating system, or whatever random mechanism it has in place to run code later (which again: isn't part of the "language") and it will run the continuation it was passed.

This is precisely what Rust's async runtime libraries are. They provide the event loop/callback mechanisms, which are necessary for truly async code. (Otherwise, what is there to wait for?) You can totally write and call an async function in Rust that doesn't use a runtime, but there's no way for it to "asynchronously block"; you'd just poll it and get back, "Yep, I'm done; here's my result."

> This does, likely, result in some heap allocation somewhere in order to type erase the continuation in the general case. However, this seems to only be due to how the asynchronous code has been given a harder challenge of dealing with arbitrarily deep stacks with minimal overhead, while people seem totally OK with synchronous code causing random stack overflows :/. If you are willing to relax that assumption a bit then you can elide that allocation almost every time.

It's not just the depth of the stack; it's that, once you yield, another task may take over the thread's flow control entirely. Let's say that function A spawns a coroutine B without waiting for it to finish. Now let's imagine that B allocates space on the same thread stack that A was using (on top of A's stack frame) and then yields. At the yield point, something (e.g. the runtime) has to say, "OK, B is stuck, so what do we run next on the thread?" Eventually, it's A's turn to finish running, and it returns. If it does this naïvely, it'll rewind the stack pointer, dropping the stack frames for both A and B. But B isn't done running yet; it's just blocked, so now we've got a problem because its stack just got clobbered. To avoid this, languages that use "stackful" coroutines have to allocate coroutines' stacks on the heap in many cases because the traditional single-stack model isn't just running out of space; it totally breaks down.

Rust uses stackless coroutines, which impose some restrictions on how the coroutine is structured (mostly involving unbounded recursion) so that the state the task has to store between yield points has a fixed size.

12