HNHacker News
TopNewBestAskShowJobs

wmanley

972 karma · joined June 18, 2018

submissionscomments
wmanley··on Hole Punch: Sling your spaceship around gravitational fields
> It's like Space Golfing

Or pool...

I am prince of the planet potters!

wmanley··on Claude discovers a novel enzyme system with CRISPR-like repeats
Violent uprisings are controlled all the time all over the world. It’s rare for a violent uprising to successfully achieve its goals. Governments are designed specifically to survive violent uprisings, even from within their own ranks or armed forces.

One of my worries about AI is that it will improve the rich and powerful’s ability to survive a violent uprising or allow them to insulate themselves from the populace with less need for numerous human bodyguards. This in combination with a concentration of wealth/income generation could lead to a Russia-style elimination of personal freedoms.

Essentially it could allow the rich and powerful to come increasingly untethered to the needs of their fellow man. No longer needing a middle class of lawyers, architects and managers for them to achieve their goals. And having the capability to suppress the general populace with less need for expensive private security.

wmanley··on Building Progressively Enhanced Forms Using htmx
You mean by having a function per fragment? I don’t think this solves the hard to maintain bit - which is “which fragments should I regenerate/send”, and how do I keep that list up to date as my app evolves.

FWIW I have a potential solution: to show live data in my app I use an SSE stream of OOB swaps. On every relevant change to the database I regenerate the HTML and compare it to the previously generated html to create OOB swaps (including hx-preserve). I send that down so the browser can update.

The same approach could be used for normal POSTs. On a POST generate the HTML before and after modifying the database and diff them to generate OOB swaps.

wmanley··on Humans missed 1 in 3 threats approving AI agent commands across 40k game runs
The agent should ask whether it's allowed to read/write particular files, rather than whether it's allowed to run particular commands. It would be much easier to review. Then wrap each command invocation in bwrap (+http proxy) accordingly.
wmanley··on Prefer strict tables in SQLite
We use this for migrations: https://david.rothlis.net/declarative-schema-migration-for-s...

Discussed here: https://news.ycombinator.com/item?id=31249823

But it would be a lot better if it were built in.

wmanley··on crustc: entirety of `rustc`, translated to C
It's not diverse in that case - it's the same compiler source compiled to binaries twice - it's just that with one compiler you've gone via a C intermediate representation. For the purposes of diversity it's the same as compiling rustc with the cranelift/gcc backend.
wmanley··on Lightning Memory-Mapped Database Manager (LMDB) 1.0
I use mmap with my SQLite database[1] because I have many concurrent SQLite connections (one per concurrent HTTP request) and I don't want each connection to have its own 2MB cache[2]. It's better that all the connections simply share the page cache.

[1]: https://sqlite.org/pragma.html#pragma_mmap_size

[2]: https://sqlite.org/pragma.html#pragma_cache_size

wmanley··on Lightning Memory-Mapped Database Manager (LMDB) 1.0
The context is in the sentence before your quote:

> The memory map can be used as a read-only or read-write map.

So presumably lmdb writes to the database using the `pwrite` syscall by default, but can optionally write via the mmap instead - if you are willing to accept the increased risk of accidental data corruption.

wmanley··on Free the Icons
> seemingly because Zuck isn't aware of how untalented the guy is.

Maybe Zuck just wanted his laptop to get better.

wmanley··on AI agent runs amok in Fedora and elsewhere
> A good fix (which is the only acceptable fix in open-source software), is one that speaks for itself.

I disagree. Often if I'm making a PR to an open-source project I'm doing so because I have a use-case that the original author hadn't considered. So the first step in getting the PR merged is explaining my point of view and convincing the maintainer that my use-case is valid. Only when this is done can the "goodness" of the patch be evaluated.

wmanley··on Building an HTML-first site doubled our users overnight
I disagree. An HTML website which uses links, forms, buttons and inputs will by default:

* Have working back/forward buttons * Have working progress indicator as provided by the browser * Show errors to the user - even if they are ugly * Be accessible to keyboard navigation

With SPAs these are all things the developer has to get right.

So often when using a SPA I'll click a button, you get a spinner and then nothing will happen. Is it still in progress? Don't know. Eventually I'll open developer console and trace the network requests to find the JSON HTTP request that returned "ERR_BAD_EMAIL" and fix what I've entered. With a normal form submission at least the user will see the error message and can press back and then fix it.

wmanley··on Building an HTML-first site doubled our users overnight
The counterargument: In Defence of the Single Page Application:

https://williamkennedy.ninja/javascript/2022/05/03/in-defenc...

wmanley··on Love systemd timers
I design all my services expecting to receive sockets this way. It makes sandboxing easy as the service itself doesn't need network access to have a listening socket.

It's a shame docker never supported it. I feel like if they had got on board all those years ago there would be broad support across the software ecosystem for it and we wouldn't need half of these complicated iptables rules and proxies and service mesh. It would be a step towards a capability based system.

wmanley··on Details of the Daring Airdrop at Tristan Da Cunha
Wonderful. I love the poem at the end too.
wmanley··on Durable queues, streams, pub/sub, and a cron scheduler – inside your SQLite file
I've implemented something similar in the past, but using inotify. You need to watch the -wal file for IN_MODIFY. To make it work reliably I found I had to run:

    BEGIN IMMEDIATE TRANSACTION; ROLLBACK;
Otherwise the new changes weren't guaranteed to be visible to the process. I'm sure there's a more targetted approach that would work instead - maybe flock on a particular byte in the `-shm` file.
wmanley··on Do you even need a database?
SQLite in mmap mode (not the default) will use mmap for reading. It will still use write using `pwrite` so it can detect and recover from write failures.

See https://www.sqlite.org/mmap.html :

> The default mechanism by which SQLite accesses and updates database disk files is the xRead() and xWrite() methods of the sqlite3_io_methods VFS object. These methods are typically implemented as "read()" and "write()" system calls which cause the operating system to copy disk content between the kernel buffer cache and user space.

> Beginning with version 3.7.17 (2013-05-20), SQLite has the option of accessing disk content directly using memory-mapped I/O and the new xFetch() and xUnfetch() methods on sqlite3_io_methods.

The principal advantage to mmap in my mind is that the cache is shared among your SQLite connections.

wmanley··on Do you even need a database?
Business logic tests will rarely test what happens to your data if a machine loses power.
wmanley··on What does " 2>&1 " mean?
It's a shame that unix tools don't support file descriptors better. The ability to pass a file (or stream, or socket etc) directly into a process is so powerful, but few commands actually support being used this way and require filenames (or hostnames, etc) instead. Shell is so limited in this regard too.

It would be great to be able to open a socket in bash[^1] and pass it to another program to read/write from without having an extra socat process and pipes running (and the buffering, odd flush behaviour, etc.). It would be great if programs expected to receive input file arguments as open fds, rather than providing filenames and having the process open them itself. Sandboxing would be trivial, as would understanding the inputs and outputs of any program.

It's frustrating to me because the underlying unix system supports this so well, it's just the conventions of userspace that get in the way.

[^1]: I know about /dev/tcp, but it's very limited.

wmanley··on America vs. Singapore: You can't save your way out of economic shocks
US borders are awful. I guess you get away with it because the USA is so large that most people rarely leave, so rarely have to experience it.
wmanley··on The state of the kernel Rust experiment
I guess that means you're using the colloquial meaning of the word safety/unsafe rather than the rust definition. It's worth being explicit about that (or choosing a different word) in these discussions to prevent confusion.

For Rust safety (meaning no UB) most definitely is a property of the language. If a module does not contain unsafe and the modules it uses that do contain unsafe are implemented soundly then there is no UB.

In C UB is a part of the language.

wmanley··on The state of the kernel Rust experiment
> in C only specific language features are unsafe and not all code

Using rust's definition of unsafe which is roughly "can cause undefined behaviour" then it seems to me isolating use of these features isn't possible. What is C without:

* Dereferencing pointers * Array access * Incrementing signed integers

You can do all of the above without invoking UB, but you can't separate the features in C that can cause UB from the ones that can't.

wmanley··on 100k TPS over a billion rows: the unreasonable effectiveness of SQLite
Use a connection per-thread instead. By sharing a connection across threads you’ll be limiting concurrency - and transactions won’t work as you’d expect. SQLite connections are not heavy.

Also: use WAL mode and enable mmap.

wmanley··on Migrating the main Zig repository from GitHub to Codeberg
Retries won’t work in that case. Would be better to have two endpoints: get the time in x seconds and wait until time passed. That way retrying the wait endpoint will work fine and if time hasn’t elapsed it can just curl itself with the same arguments.
wmanley··on Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
No, actually the biggest difference is removing the `filter` property from the `.wave2` class which is used for rendering the background. With that removed the page is responsive even with the backdrop-filter - and it makes no visual difference AFAICS.
wmanley··on Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
It's also perfectly responsive if you disable JavaScript. Maybe something related to the --positionX and --positionY CSS variables that are updated on every mouse move?
wmanley··on Laptops with Stickers
What stickers did you used to have? I'm always fascinated with how people change their mind.
wmanley··on Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
Looks like it's caused by `backdrop-filter: blur(6px);` on `.menu-content`. After disabling that it's slow, but not that slow.

Edit: This is with Firefox 144 on Ubuntu 22.04

wmanley··on The future of Python web services looks GIL-free
Even with volatile it’s a load and then a store no? It may not be undefined behaviour, but I don’t think it will be atomic.
wmanley··on Keeping SSH sessions alive with systemd-inhibit
> SSH is a "legacy protocol" and its users are "uneducated troglodytes",

Who are you quoting here?

wmanley··on Just Use HTML
With jinja you’d use template inheritance and just update the base template for this:

https://jinja.palletsprojects.com/en/stable/templates/#templ...

Page 1 of 6Next →