HNHacker News
TopNewBestAskShowJobs

wmanley

972 karma · joined June 18, 2018

submissionscomments
wmanley··on Next.js is infuriating
And also:

> and so have 4 different libraries they rely on

HTMX has no dependencies. https://htmx.org/essays/vendoring/

> and actually the most up to date version of two libraries you rely on are not interoperable right now because they depend on different node versions

HTMX has no build step. https://htmx.org/essays/no-build-step/

wmanley··on Unexpected productivity boost of Rust
> Its always funny when i see these kinds of posts.

What's funny about it?

wmanley··on Object-oriented design patterns in C and kernel development
It’s not about ‘this’ being a global, it’s if you see ‘i++’ in code it’s not obvious if ‘i’ is a member or not without having to check context.
wmanley··on Will Smith's concert crowds are real, but AI is blurring the lines
People over 35 are the people with money. I can't imagine a bunch of 16 year olds paying £300 to go and see Oasis in the 90s, but those 16 year olds are now in their 40s and now have money and an opportunity to live their adolescent dream.
wmanley··on Prime Number Grid
Scaling is already supported - try Ctrl+Mouse Wheel or pinch to zoom on mobile. It also supports writing an image with the keyboard shortcut "Print Screen".
wmanley··on Millau Viaduct
I got the 1.2B from the Beeb: https://www.bbc.co.uk/news/articles/c0mrm84wg4ko.amp

> Plans for the 14.5-mile (23km) route were approved in March after a 16-year process that has already cost £1.2bn.

wmanley··on Millau Viaduct
I visited it last year. It’s 2.4km long and at its highest point the Eiffel Tower could fit under the road. Remarkably the construction cost was only €394 million.

For comparison the planned 4.2km Lower Thames Crossing has already cost £1.2bn (€1,400 million) just for the planning phase with nothing built. The French know how to build.

wmanley··on Following Up on the Python JIT
> I have no idea how LWN can be sustainable

Speculation: it’s because Linux (the kernel) is a large centralised project, so there’s a critical mass of people willing to pay for Linux Weekly News.

From there the proven quality allowed the publication to cover other OSS projects. I suspect that without Linux LWN would not be sustainable.

wmanley··on Tom Lehrer has died
Depends on willingness to pay - Even if your cost per customer is 0 maximising profit would mean that it’s better (for you) to sell 10 licences for £1,000,000 a pop to rich customers who really need the service rather than 500,000 licences for £1. It’s a shame because those 500,000 miss out on your product even though it would cost you nothing if they were to use it. This is where price segmentation comes into play - maybe you can still charge those 10 big customers the full whack, while providing benefit to the 500,000.
wmanley··on Swift-erlang-actor-system
How does this compare to hyperview? https://hyperview.org/
wmanley··on SQLite async connection pool for high-performance
>There are two downsides of mmap - I/O errors can't be caught and handled by SQLite code,

True. https://www.sqlite.org/mmap.html lists 3 other issues as well.

> and buggy stray writes by other code in the process could corrupt the database.

Not true: "SQLite uses a read-only memory map to prevent stray pointers in the application from overwriting and corrupting the database file."

wmanley··on SQLite async connection pool for high-performance
Regarding shared caching: Use `PRAGMA mmap_size` to enable mmap for reading your database. This way SQLite won't add another layer of page caching on top saving RAM and making things faster. SQLite only uses mmap for reads and will continue to write to the database with pwrite().

You must set it to a value higher than the size of your DB. I use:

    PRAGMA mmap_size = 1099511627776;
(1TB)
wmanley··on People Keep Inventing Prolly Trees
Here's apenwarr's description of the same data structure from 2009: https://apenwarr.ca/log/20091004 .

Here's a post to the git mailing list from Martin Uecker describing the same from 2005: https://lore.kernel.org/git/20050416173702.GA12605@macavity/ . From the tone of the email it sounds like he didn't consider the idea new at that point:

> The chunk boundaries should be determined deterministically from local properties of the data. Use a rolling checksum over some small window and split the file it it hits a special value (0). This is what the rsyncable patch to zlib does.

He calls it a merkle hash tree.

Edit: here's one that's one day earlier from C. Scott Ananian: https://lore.kernel.org/git/Pine.LNX.4.61.0504151232160.2763...

> We already have the rsync algorithm which can scan through a file and efficiently tell which existing chunks match (portions of) it, using a rolling checksum. (Here's a refresher: http://samba.anu.edu.au/rsync/tech_report/node2.html ). Why not treat the 'chunk' as the fundamental unit, and compose files from chunks?

wmanley··on All four major web browsers are about to lose 80% of their funding
I read your comment to mean:

> There should be a huge mess of choices available because it increases the cost of web development.

wmanley··on I'm manually transcribing the AltairBASIC source, ten lines a day starting today
> Let's see how many days it takes!

I reckon there are ~40,000 lines in the printout. So: ~10 years.

wmanley··on Declarative Schemas for simpler database management
See also:

“Simple declarative schema migration for SQLite”

https://david.rothlis.net/declarative-schema-migration-for-s...

Discussed previously:

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

Disclosure: I am the co author of that article

wmanley··on I tried making artificial sunlight at home
Really cool. Did you consider using hexagonal lenses? It seems like they would tessellate, while being closer to being circular.
wmanley··on Introducing command And commandfor In HTML
> We could have ten different open-source web browsers

To what end?

wmanley··on Siren Call of SQLite on the Server
WAL mode requires shared memory, so doesn’t work over the network.

mmap_size = 1TiB requires 1TiB of address space per connection. This is fine on 64-bit, unless you have millions of connections. Doesn’t work with 32-bit (4GiB) address space.

You want mmap_size to be greater than the size of your database. If you know your database will be small then you could set it to a smaller number, but you could still become address space constrained with many connections.

wmanley··on Siren Call of SQLite on the Server
You definitely want WAL mode (unless you’re accessing SQLite over NFS). It’s only not the default for backwards compatibility. I’d enable:

PRAGMA journal_mode = WAL; PRAGMA foreign_keys = 1; PRAGMA mmap_size = 1099511627776;

Unless you know a reason that you can’t (like NFS or using a 32-bit cpu).

wmanley··on Hard numbers in the Wayland vs. X11 input latency discussion
HTTP is to Wayland as the web is to what???

I think the answer is also Wayland. It's very confusing because there is wayland the protocol and wayland the system, where the protocol is a part of the system - but there is no separate name for it. When people discuss wayland they are very rarely talking about wayland the protocol, and are much more likely talking about wayland the system.

wmanley··on Hard numbers in the Wayland vs. X11 input latency discussion
I'm not trying to claim that X is secure as is. The claim I'm making is:

1. There is nothing fundamentally insecure about the design of X that couldn't be fixed with a bit of effort.

2. The effort required would be significantly less than what has gone into Wayland over the last 16 years.

Fixing the security of the system certainly would involve changes to more than just xorg. Anywhere there is a security boundary you'd need to make modifications - but that's OK, most of these security boundaries are younger than wayland anyway.

This discussion of $DISPLAY seems like distracting minutiae. Sure it's a medium size problem that would need solving, but that's all it is.

To address your specific point: it could be the responsibility of the window manager to set $DISPLAY to a less powerful socket when starting processes. Ultimately it doesn't matter though, because if the display server isn't doing some sort of sandboxing then the spawned process can just ptrace xorg and do whatever it wants. X being secure only matters in the presence of a security boundary and in that case it would be the responsibility of whatever is setting up that boundary to create a less privileged socket. Whether that be ssh or flatpak or whatever.

wmanley··on Hard numbers in the Wayland vs. X11 input latency discussion
> You're kind of getting tripped up on terminology.

I'm not. My comment doesn't address the latency of gnome shell. I understand the boring technical distinctions between wayland and wayland client libraries and wayland display servers and gnome shell and mutter and sway, blah blah blah. Much like I understand that Linux is a kernel. That it is inspired by UNIX, but it is technically not a UNIX. I also understand that if someone describes themselves as a Linux user they probably don't just mean that they have a Android phone or that the display controller in their dishwasher or wireless access point happens to include Linux the kernel.

The "well acksually wayland is just the name of the protocol" that emerges whenever a problem is brought up is a symptom of the underlying problem with wayland the system. The confusion that gives rise to these deflections is also a symptom of that problem.

By Conway's law systems end up resembling the organisations that produce them. In this way the design of wayland the system seems to be designed by people who don't want to work together. I can see a parallel with microservice architecture.

wmanley··on Hard numbers in the Wayland vs. X11 input latency discussion
> It'll be challenging to even figure out which one of the things connecting to $DISPLAY is the real window manager.

I suspect it would be less challenging than writing a whole new wayland server.

Off the top of my head, I'd use a separate abstract domain socket for the window manager including some UUID, and then pass that to the window manager when launching it.

You could create these sockets on demand - one for each security context. On linux typically a different security contexts will either have different UIDs - in which case filesystem permissions would be sufficient - or they have different mount namespaces - in which case you make different sockets visible in different namespaces.

For SSH forwarding you could have SSH ask the X server for a new socket for forwarding purposes - so remote clients can't snoop on local clients.

> Good luck on your lonely[1] journey! > > [1]: The people who actually developed Xorg are now working on various Wayland-related things.

This is what I mean by a failure of technical leadership.

wmanley··on Hard numbers in the Wayland vs. X11 input latency discussion
Software works best when the developers take responsibility for solving user's problems.

> Wayland, which is a protocol

This is wayland's biggest weakness. The effect is diffusion of responsibility.

wmanley··on Hard numbers in the Wayland vs. X11 input latency discussion
> the X11 protocol [...] has plenty of design decisions that simply cannot be secured.

I've been hearing this for over a decade now. I don't get it. Just because xorg currently makes different clients aware of each other and broadcasts keypresses and mouse movements to all clients and allows screen capturing doesn't mean it has to. You could essentially give every application the impression that they are the only thing running.

It might seem difficult to implement, but compare it to the effort that has gone into wayland across the whole ecosystem. Maybe that was the point - motivating people to work on X was too difficult, and the wayland approach manages to diffuse the work out to more people.

I was really bullish on Wayland 10 years ago. Not so much any more. In retrospect it seems like a failure in technical leadership.

wmanley··on Where is London's most central sheep?
Richmond park has Adders and Deer, both of which have the potential to kill you - but in practice would be very unlikely to. To get to the nearest wild wolf you'd probably have to look as far as the Ardennes in Belgium, which is roughly 400km away. For bears you'd probably be looking at 1000km or so in the Pyrenees on the French/Spanish border.
wmanley··on The Future of Htmx
I’ve done something similar, but using pandoc to convert the html to text, so tables and bullet points are rendered appropriately.
wmanley··on Can LLMs write better code if you keep asking them to “write better code”?
Ah, so that’s what’s been happening!
wmanley··on Fear, Friendship and the Channel Tunnel
Back in the days of peak "booze cruise"[1] the ferry companies used to issue every passenger with a leaflet describing exactly what the duty free limits were. You'd go over, max it out and come back.

If border control were to select on this basis they'd spend all day pulling over bearded men in anoraks driving volvo estates, searching their cars and discovering that they have exactly the "right" amount.

[1]: https://en.wikipedia.org/wiki/Booze_cruise

← PreviousPage 2 of 6Next →