Hacker Newsnew | past | comments | ask | show | jobs | submit | shortercode's commentslogin

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.


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.


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.


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.


Those Teslas were controller-less SSDs IIRC, common in the cheap embedded world.

Modern proper SSDs for computers do their best to spread out the writes (TRIM, and other features). They still wear out of course, nothing can beat physics. But if you buy a 2TB drive, there's a lot of room to spread out the write cycles that a normal user probably never has to worry about (no normal user is going to hit 500TBs of writes that breaks a modern 2TB SSD write balancing algorithm)

But it probably should be noted that embedded controller-free SSDs have significant write amplification issues. Embedded systems assumed you were trying to save money and/or compute... and also assumed you didn't do too many writes. So they really weren't designed for the write cycles that Teslas logging system did.


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


It reminds a bit of musicians tracking rhythm. You can somehow feel a beat after a bit practice even when not directly paying attention to it and it's not too hard to associate it with an increasing counter (somehow). It sounds hard, but it is quite doable.


Very true. Strangely, I also found this in competitive games. You get a very accurate sense of cooldowns without consciously tracking them. StarCraft with different build times, Apex Legends with character abilities, etc.


yeah, doesn't the multitasking in this thread feel a little bit like what i imagine playing the drums is like? i've done some low-key drum-playing sorts of musical things in my life, and it was the disconnection point when you genuinely had 2-3 different things to focus on at once that i found my brain to be lacking. i observed the same with piano, but i had much more of a knack for piano, so it was only the rare song that genuinely required tracking three things at once... and those kinds of songs are hard enough for most mortals that people just pin them all as "dw those songs are super hard", when in reality it always felt like that specific skill was the thing that was lacking, and besides rote memorization i never found some way to lick it all the time. when i was really in flow, though, it would be completely effortless. it's bizarre.


> You can somehow feel a beat

If you play in an orchestra, you might have the visual memory of the conductor and their time signature motions helping you along.

The somewhat jarring tick tock of a digital metronome can also be encoded into a sort of background track that plays more or less automatically in your head.


> If you play in an orchestra, you might have the visual memory of the conductor and their time signature motions helping you along.

Or on the other side of the spectrum, most DJs learn to "feel" beat counting and phrases, more or less by feeling. After a while, your head kind of goes "1,2,3,4" by itself, and the phrases of the songs "feels" like they're about to come, then they come.


> 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.

Funny timing for this comment, just last week I was running slowly on the treadmill and was counting my steps due to curiosity about steps vs time, and decided to count using images. It definitely takes more effort but I think it's because I hadn't tried it before.

I would hold the tens digit image static and repaint the ones digit until it rolled to the next tens digit, which meant very limited effort was required to retain the tens digit image and most effort was transitioning the ones digit.

The ones digit would not just instantly flash in place, it took a small amount of time and some noticeable deliberate effort for the process to complete, and then it was just in maintenance mode until the next transition.


If you miss it, maybe she does too. You can still do it even though she doesn’t need it


Maybe. But as a parent, sometimes you have to make sacrifices (or force them to make sacrifices) as otherwise they won't have space grow.


Ugh, yeah. It’s the worst. It’s the best.


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.


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


As I understood it, the two APIs have different purposes, so I don't think you can really compare them.

Origin Private File System is for files that the app manages internally and that normally, the user should never touch - like stuff in /var or AppData for native applications. Hence why browsers make no guarantees where on disk they will store those files or even if they'll store them as files at all.

But I think that's not really very interesting, because it's not offering anything new you couldn't already do with localStorage or indexedDB, just with a file-like API. Hence why browsers also put it in the same "ephemeral local data" bucket as those APIs.

The directory picker API would offer a new ability, namely to "open a directory" in user-managed space and work with it like an IDE would. But I can see why the security risks are too large for that.


> The downside is the user loses some control over the files:

Why not use some human-readable path like ~/Internet/example.com/ ? In this case the user could see the files.


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.


> 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 ).

Then they should not store anything on user's device.

> 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.

OS could add a warning when copying the files into the folder.

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

Many apps on Android request "media access" which allows accessing all user files.


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.


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…


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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: