20 comments

bonkiabout 3 hours ago
This looks pretty cool! Is it (or would it be) possible to have multiple adjacent root commits?

Example use case: Store multiple versions of a game (which means they don't really share a chronological history, but possibly share assets which can be deduplicated)? This would avoid having to deal with subfolders inside the archive and push the abstraction from the file layout to the archive format. Being able to store unrelated archives inside the same file would be great.

Also, can commits be named?

brmmm3about 2 hours ago
Commits are organized in a chain, not in a tree. So there is not root commit. If you add same files with the next commit then only links to existing data are added. The same content will not be added twice. The files are stored in the same layout as the file tree(s). And yes, every commit can have a name (max 64 characters) and a description (max 8 lines by max 128 characters each line). Existing commits can be modified: name, description, encryption. Several commits can be joined to cleanup the archive. If you want to store data, which is unrelated to the files stored, then you can use the arbitrary metadata feature. This feature lets you store keys with values and strings. For metadata keys the same limitations as for commit names apply. Metadata values can have 1024 characters max. This metadata is also stored as commits.
Wicherabout 17 hours ago
Does it allow for padding so that the start of files can be (memory/filesystem)-page aligned? That allows for mmap-ing non-compressed members and also for reflinking in/out contents from/to the filesystem (on Linux with btrfs, XFS). With tar it's possible with some padding tricks involving PAX comments, see https://pkg.go.dev/nontrivialpursuit.org/deduptar (mine!).

For any new format I'd like to have that flexibility at least in the format; the utilities can implement it later or not at all but at least the format should allow for the required alignment.

lifthrasiirabout 13 hours ago
My Aqueous (https://lifthrasiir.github.io/aqueous/) can, via spacer blocks. In fact uncompressed blocks are particularly designed for mmaping.
brmmm3about 12 hours ago
Interesting question. I'll have a look at it.
lifthrasiirabout 13 hours ago
I can't figure out the actual file format, partly because your document exposes bare UMLs [1]. Also ideally you better do the runtime detection for x86-64 features (otherwise, well, you need to do what you are doing now).

(I have much more ambitious and possibly competiting format called Aqueous [2], as you may have seen in r/rust, but these points are genuine advices for you ;-)

[1] https://github.com/brmmm3/zar-rs/blob/master/doc/zar-file-fo...

[2] https://lifthrasiir.github.io/aqueous/

brmmm3about 12 hours ago
You're right. github shows UML files as source. I'll correct this. Runtime detection of CPU features is a good idea.
luckystarrabout 21 hours ago
Try getting it into as many distros as possible, lest it won't have any chance of being adopted.
brmmm3about 20 hours ago
I'm working on this.
koziserekabout 19 hours ago
Looks impressive.

can you avoid zstd?

exiting 'pure rust' breaks the deal for me when considering to include in my project.

lifthrasiirabout 13 hours ago
There does exist a pure Rust implementation of Zstandard [1] [2].

[1] https://docs.rs/libzstd-rs-sys/

[2] https://docs.rs/mzstd/

brmmm3about 8 hours ago
I've created a test implementation with mzstd.

Unfortunately the performance is much worse than with zstd.

Tested with compiled linux kernel 6.1.1:

- zstd: compress ~6s, uncompress ~6s

- mzstd: compress ~7s, uncompress ~8s (encrypted 33s)

brmmm3about 12 hours ago
mzstd seems to be very interesting. It is even faster than the C original. Maybe I'll replace zstd with mzstd.

Read the full thread on Hacker News →

Related stories