Recent submissions

Comment · 2 months ago
Zip files are an example of something that works, are used extensively, and have a number of weird design decisions. Some of this just history, other not so much. But good luck replacing them for customers or friends.

They have some cool advantages. Like being able to read directly from the archive without decompressing the whole thing, per file checksum, and skipping compression on parts which won’t benefit. You can also wedge large amounts of arbitrary data into the file without changing it which… is kinda weird and sometimes useful?

Nasty bits are they used 32 bit ints all over the place, so rely on hacks to support larger files. Can’t support true streaming decompression. Implementations can vary quite a lot, as can compatibility. They also have a number of old and weird features that people don’t really use. Like being able to split a zip file into multiple parts, some ancient compression techniques etc.

Comment · 3 months ago
Defer is easier to fit into TS/JS as GC isn’t observable ( it kinda is with FinalisationRegistry but with a huge list of gotchas ).

Defer only cares if the variable leaves scope. At the end they mention the new “using” syntax which only requires you to mark the declaration, not requiring an additional statement for the cleanup. It’s kinda nice but the resource needs to implement a cleanup method making it less flexible than defer.

Comment · 3 months ago
Oh cool I was working on something similar awhile back and couldn’t find much precedent. The project got retired as our use case went away. But I’d love to revisit it. It’s still on npm as “data-rambler”.

Idea was a DSL that could be loaded into a JS runtime, then fed data streams. Your module would transform that data into various output streams which could then be fed to a separate reporting library. Powering dynamic reports based on a template.

Our first iteration was already pretty powerful but I had some big plans to bring it into a more JS feeling syntax to reduce complexity.

Comment · 3 months ago
There are also some cases where this can be magnified by certain write patterns or system behaviours.

I think there was a case of Teslas having these sorts of failures at one point due to them writing logs quite aggressively.

Another example was MacOS causing rapid wear due to virtual memory swaps if I recall on devices with smaller amounts of RAM.

Comment · 3 months ago
Interesting, I experimented a bit with this when my daughter was younger. I used to walk around the room with her in my arms singing to get her to sleep. To ensure she would be settled I would then count 300 steps before putting her in the cot. I discovered I could count and sing at the same time by visualising the number in my head, instead of using my inner monologue. But it requires more focus to maintain.

Thankfully these days she can get herself to sleep. But I miss it sometimes

Comment · 3 months ago
Yeah it wasn’t until I started pushing my daughter around in a pram that I started appreciating them. Crossing a road without them is a chore.

I saw a sibling comment mentioning about the drop curbs making the path awkwardly angled. Yeah they can be a real pain. Pushing a pram along on an angled path is hell on the wrists. But a lot of the troublesome ones are the wider ones for people to get their cars up to their front door.

Makes you think about how hard just going down the road with a wheelchair is.

Comment · 4 months ago
Mmm so there’s 2 trade offs as far as I can see if you used a folder which both the user and app can access.

Firstly if an app does want a space that’s filesystem shape but does not want users/apps to have access for security or consistency reasons ( think Spotify offline storage of songs ).

Secondly if the user has access they can do the “easy” thing and just throw lots of files in, including things which are sensitive anyway.

It’s interesting to look at how Android and iOS have handled filesystem sandboxing in relation to this.

Comment · 4 months ago
Both sides are valid. Is it a security risk? In the right conditions yes. But on the other side of it there’s user consent, limited per domain access, and the capability to do multi file editor style apps.

I think the WebKit take on this is good and a better fit for most apps. They instead implemented Origin Private File System. Which is based on the same API bits but the folder is only accessible by the website. The downside is the user loses some control over the files:

- can’t see what’s being stored

- can’t easily backup those files

- has to use that web app to access the files

- usual nonsense about important files being classed as “cookies” or some nonsense by cache cleaning tools, leading to users deleting their data without realising it

Comment · 4 months ago
Arcane Scholar: a local first application for all your TTRPG needs. Create and manage characters, classes, spells, and more. Then package them up to share with your table.

In the style of Sauron I’m channeling all my frustration and hatred of slow loading tools that require you to pay a subscription, buy the digital book on every platform you want to use it on, and won’t let you use the physical book from your shelf.

For my first pass I decided on focusing on a character creator for a single game and streamlining the process.

I started with the 5.5e SRD but got frustrated with the sheer amount of text without much actual content ( 100+ A4 double column pages of spells, only 1 subclass per class ). Plus a number of weird and frustrating rules that make it hard to create software for. As I’m using Nimble RPG at the table a bit recently and it has a much nicer license I’ve switched to that and been getting on a lot better. Character creation is almost done and I’be moved to character sheets and persistent object storage now. This is the first major project I’ve done with sveltekit and I’m really enjoying it.

Comment · 4 months ago
As other people have said the community is divided. I try not to be too negative about AI frankly because a lot of people I know are excited about it and are using it. But it’s safe to say I have strong feelings.

For me HN became a lot less interesting when AI became popular. I don’t want to read about OpenAI’s incremental improvements, or see an AI generated landing page that fails to tell me what a project is about. Maybe the people who love the craft have also reduced the amount they are writing…

Comment · 5 months ago
Strangely enough kids did fine before social media, and I would say as an adult I also do fine without it.

Concerns about age gating etc are true but as we’re already experiencing that nonsense without social media bans it’s kind of a moot point.

Comment · 5 months ago
Fun thing about random is that these things happen. UUIDv7 is less prone to this as it includes both a time component and random. I’ve been using ULID in a few project which has similar attributes to uuidv7 but more space efficient.
Comment · 6 months ago
Having lived through the changes from callback hell, early promises and then async/await I only ever found each step an improvement and the negatives are very minor when actually working with them.

Now function colouring is interesting but not for the reason these articles get excited. Recolouring is easy and has basically no impact on code maintenance. BUT if you need that code path to really fly then marking it as async is a killer, as all those tiny little promises add tiny delays in the form of many tasks. Which add up to performance problems on hot code paths. This is particularly frustrating if functions are sometimes async, like lazy loaders or similar cache things. To get around this you can either use callbacks instead or use selective promise chaining to only use promises when you get a promise. Both strategies can be messy and trip up people who don’t understand these careful design decisions.

One other fun thing is indexeddb plays terribly with promises, as it uses a “transactions close at end of task” mechanism, making certain common patterns impossible with promises due to how they behave with the task system. Although some API designers have come up with ways around this to give you promise interfaces for databases. Normally by using callbacks internally and only doing one operation per transaction.

Comment · 7 months ago
Near to me they are planning a new data centre. As part of the proposal they have included a solar power plant, and running coolant from the data centre to houses in the village for heating. This then relies on a heat pump which does top up and heat exchange. As part of it they are also intending to run fibre lines with the pipes for “high speed internet”.

District based heating is generally much more efficient than per building heating, and this side steps many of the issues that you would have installing/maintaining servers on your property.

Honestly my only concern is the impact of having a data centre nearby. They are asking for people to put a deposit down for the heating. I won’t encourage it, but I will make use of it if they put it in!

Comment · 7 months ago
Push push push. When your customers are livid at you take a small step back. Wait for a moment then come back at them from another angle.

I hate this philosophy. But it’s seems to be the preferred path for Microsoft.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton