Pijul: Towards 1.0
pijul.org
pijul.org
I've changed my mind now that they're tracking byte ranges instead of lines, with ranges decided in a customisable way at commit time. Semantic/format-aware versioning would be really nice. The easiest plugins to write would be s-expressions and JSON, and I could definitely see myself choosing Pijul for such repos in the future. If the patch-based approach is truly as nice as it appears, that might push me to use it more generally.
In fact, making an s-expression plugin which is robust across various Lisp dialects might be a good way to bootstrap the user community.
It would be nice to have for other languages too (C, Python, etc.), but they'd (a) be more complicated and (b) more subject to churn.
I believe the Unison language [1] does this for their code storage system. (Unison does not use traditional text storage but stores code in a normalized repository)
I explored using an off the shelf syntax highlighting tokenizer (Pygments specifically as a it was a Python prototype) [1] to build character-based diffs. Got surprisingly good results from what I tested. Most off the shelf syntax highlighters support a huge variety of languages. One advantage to using a syntax highlighting tokenizer/lexer is that they are designed to be fast (many of them need to be real time in text editors after all), and handle "degenerate cases" very well (text editors spend a lot of time on work in progress code that doesn't fully describe a complete compilable unit; version control systems just as well need to be good at storing work in progress states).
The finished prototype I built created standard character-based unidiffs, and it sounds like could possibly be slotted directly into Pijul now. I'd be very interested to experiment further with it now that one of the patch algebra VCSes has finally adopted a "chunk" option.
[1] https://github.com/WorldMaker/tokdiff
(ETA: Suppose the first step is that it is time to get the band back together and update the prototype to Python 3.)
(Or the vast number of TextMate grammars in the wild, such as editors like VS Code have standardized on.)
The "universality" of tokenizers is tough to beat, and though the tokenizers seem "dumber" than parser brethren, it's at a nice maxima for "good enough" for things like character-based diffs.
> The finished prototype I built created standard character-based unidiffs, and it sounds like could possibly be slotted directly into Pijul now.
The diff algorithm, acting on lines, is pretty generic in Pijul, but there is a crucial and nontrivial pass after that, to get from a line diff to a graph diff.
From my understanding of the post:
- Pijul patches were storing raw lines of text
- Word-based diffing was suggested as an option
- This option wasn't implemented due to complexity, and having to decide at repo creation time whether to store lines or words
- Unrelated improvements to Pijul's performance resulted in patches storing offsets into a byte array, rather than raw text
- Since offsets can point anywhere, patches are no longer limited to being line-based
Lines are still the default.
-def foo()
-{
+def bar()
+{
+ doBarThing;
- doFooThing;
}
There are many ways to represent the same diff, but this sort of half-and-half result happens so often, and is such a minor problem, that it's usually not worth bothering to fix when committing. Yet it's the sort of weird input that can complicate later merges, cherry-picking, etc.A semantic-aware diff could do better. Again, there are many ways to represent the diff, but it could be as fine-grained as the token-level, e.g.
def -foo+bar()
{
-doFooThing+doBarThing;
}
Or as coarse-grained as the definition level, e.g. -def foo()
-{
- doFooThing;
-}
+def bar()
+{
+ doBarThing;
+}
Either way (or something in-between), these represent more meaningful changes, and hence provide more useful input to subsequent processing (e.g. merging).One property you might want would be that, in some sense, parentheses would always remain balanced. I think this would be very hard if not impossible to get from the graph-of-byte-ranges representation. But I’d be excited if someone figured out how to do it.
I think a particular part of the problem is to get the diff algorithm to match parentheses correctly. Consider some changes from A to B:
1A (a b)
1B (a b) (c d)
2A (define p () (a) (b) (c))
2B (define q () (a) (b) ) (define q () (p) (c))
3A (a b c d)
3B (a b) (c d)
4A (a b c )
4B (a b) (c d)
5A (a b c)
5B (a b) (d)
I think in these examples it’s relatively easy to pair up parentheses in a reasonable way though there are already some tricky cases. As you get more of a tree structure and want a diff algorithm that can think of operations like wrapping, splitting, and spreading as basic operations as well as appending and deleting, I think it becomes even harder to make the right call. Indeed I think computing this kind of diff of s-expressions is computationally a harder search problem than diffing files.Anyway, what I find weird about the Pijul project is that they place the barrier to entry so damn high, that it's absolutely not motivating to even give it a try:
- The Pijul front page (https://pijul.org) has a prominent link in the middle that points to their source code hosting service, Nest. That page has always been dog slow. It takes multiple seconds for that page to open, and then it shows me "Not found". Maybe I should log in to view the code? There is a "Sign in" form at the top right of the page, so maybe I should do that. Where's the registration button?
- The project got renamed to Anu. A couple of days ago I tried to visit that page (https://anu.dev), and I wasn't able to find any source code there. I just tried to go there again and the page is offline.
- As BlackFingolfin pointed out, the blog post has a "Warning about licenses" at the top. Even though I don't think that's how the GNU GPL works, it's already a big motivator for me to simply close that tab. I do work in the area of data storage myself. Would I want to put myself at legal risk, just because I want to try an experimental VCS?
- Why isn't there an official Git mirror of Pijul/Any? Sure, it's awesome if those tools can host themselves, but what about being able to set it up quickly? Pijul/Any is written in Rust. Doesn't Cargo depend on being able to 'git clone' software for it to be installable?
I slowly get the feeling that the goal of the Pijul project was never to become popular in any way. To me it seems little more than a hobby project of someone with an interest in version control systems. That's fine I suppose, but my fear is that this current approach is that the existence of this project simply acts as an impediment for truly motivated people to work on the next generation VCS.
No. The registry is controlled using git, and Cargo allows you to pull in software via git, but Rust projects don't need to be using git.
* The index of packages on crates.io is stored in a git repository
* Cargo knows how to clone that down without you having git installed
* The contents of packages are not acquired by doing a git clone; source code is stored in an S3 bucket, and Cargo downloads it directly.
* You can have your project depend on a package that lives in a git repository, but you cannot upload a crate to crates.io that depends on a git repository. This means that this feature is mostly useful for end projects and private libraries, not public dependencies.
The Nest is still experimental (which explains the downtime), but you shouldn't need to sign in order to view any code there.
> - The project got renamed to Anu. A couple of days ago I tried to visit that page (https://anu.dev), and I wasn't able to find any source code there. I just tried to go there again and the page is offline.
Right, there have been really strong reactions against that move. As a person who carefully listens to HackerNews and Twitter comments for life advice (as one should), I decided to revert that move.
More seriously, I noticed it was distracting from the main point. But then I managed to find another distracting thing, by writing a rant about occurrences of plagiarism that have happened to me, including theft of actual GPL source code, as well as republication of academic papers (in one case, I was fortunate enough to be picked for review).
> - As BlackFingolfin pointed out, the blog post has a "Warning about licenses" at the top. Even though I don't think that's how the GNU GPL works, it's already a big motivator for me to simply close that tab. I do work in the area of data storage myself. Would I want to put myself at legal risk, just because I want to try an experimental VCS?
That is clearly not what I meant, and I'm deeply sorry about this.
> - Why isn't there an official Git mirror of Pijul/Any? Sure, it's awesome if those tools can host themselves, but what about being able to set it up quickly? Pijul/Any is written in Rust. Doesn't Cargo depend on being able to 'git clone' software for it to be installable?
Until there are packages in linux distributions, you can get it with `cargo install pijul --version 1.0.0-alpha`. You would need cargo to compile it from source anyway.
One of the show-stopper complaints that I had about Pijul was the lack of a version identifier. However according to this post that has now been resolved which is fantastic news.
That's not how copyrights work.
no matching package named `sequoia-rfc2822` found
and I cannot download the latest sources because I'm not "lucky enough to already have one version of Pijul" sitting around to access the self-hosted repo.I clicked on the "nest" link (hoping for a download source tarball button), but this link 404s: https://nest.pijul.com/pijul_org/pijul
Possibly this is the right home for pijul: https://nest.pijul.com/pijul/pijul
(no download functionality sadly)
I cannot find an issue tracker. Hoping the author reads this. The project seems very interesting
> cargo install pijul --version 1.0.0-alpha
(needs some native dependencies like zstd)
Seems like the project was renamed to `anu`, and then back to pijul, and all documentation and hosting is a big mess right now.
thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library at /usr/local/opt/llvm/lib/libclang.dylib could not be opened: dlopen(/usr/local/opt/llvm/lib/libclang.dylib, 2): Symbol not found: __ZN4llvm11raw_ostream10resetColorEv\n Referenced from: /usr/local/opt/llvm/lib/libclang.dylib\n Expected in: /Users/erin/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/libLLVM.dylib\n in /usr/local/opt/llvm/lib/libclang.dylib"', /Users/erin/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.55.1/src/lib.rs:1896:31
That's from doing "cargo install pijul --version 1.0.0-alpha".Bonus question: I'v never seen the notation "[0,n[" to represent a half-open internval before (I've seen "[0,n)"), but it does have a certain logic to it! Is it novel or standard in some places?
Thanks for Pijul; I'm super-excited about the possibilities. (Unlike many HN commentators, who are too trapped inside the git way of thinking to realize its limitations ;-)
I think your biggest challenge now is going to be everything besides the software itself that makes a project successful: Is the website fast and inviting? Is the software easy to install? Etc.
Thanks again & wishing the best for Pijul.
A very gentle way of phrasing this ;-) Thank you.
The Nest used to be really fast with the previous Pijul, but I remember the first iteration took a few days of debugging under full load before being stable. I'm not expecting it to be fast until a week or two.
It looks like you don't have libclang. The required libraries are openssl libsodium llvm(which contains libclang) xxHash zlib zstd libgit2 pkgconfig
edit: with nix on macos, this 'should' be enough
$ nix-shell -p openssl libsodium llvmPackages.libclang xxHash zlib zstd libgit2 pkgconfig rustc rustfmt cargo darwin.apple_sdk.frameworks.CoreServices darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.SystemConfiguration
[nix-shell] $ cargo install pijul --version 1.0.0-alpha --features gitEdit: The nix tip worked; thanks!
I've been meaning to try out nix for a while anyway, so this was a nice nudge. :-)
What's going on there? Sounds like a hostile environment!
Can someone help me find a more flattering way to pronounce this project? Any way I slice it it sounds awful in English.
- PEE - HOOL
- PEE - HOLE
- PIE - HOLE
- PEE - JEWEL
- PIE - JEWEL
Hearing nothing, probably gonna have to stick with "pie jewel".Git is a snapshot based model and so doesn't leak any implementation details about patches themselves. Every user can use whatever diffing algorithm they want when generating patches for use in three way merge and then only the results are stored. In fact with git you don't even need to use three way merge, the only thing that matters is that you say "I merged A and B and this is what the tree looks like as a result".
Pijul being based on patches encodes patch information into the repo. Each line belongs to a patch and it can depend on the diffing algorithm which patch owns a particular line. This is a big drawback and so we should hope to get some serious benefits to make up for it, but I don't think we do.
One of Pijul's main selling points is the ease of cherry-picking. They make the claim that cherry picking "just works" but I think this misses the big picture. Pijul's cherry picking only "just works" with respect to merging lines of code. It can automatically pull in patches that the lines of code you are merging depend on for the merging algorithm, but it can not track things like "This calls a function introduced in patch X" which makes the cherry-picking functionality of very little value.
The biggest problem IMO is that Pijul is more similar to git rebase than git merge. What I mean is that it forces you to resolve conflicts that you probably wont ever care about. Let's say I have a local git branch with 10 commits on top of master. Now if I update my master and do "git rebase master" I must make sure that each one of those 10 commits resolves cleanly on top of the new master. It's common to get into situations where you would have to resolve conflicts in several of those rebase steps but a merge which did a three way merge of the tops of both branches would result in few or no conflicts. Pijul is like rebase in that it forces you to consider the full history of all the patches in a set which requires to resolve arbitrary conflicts. The benefit of resolving those conflicts is that it can help with cherry-picking, but I don't want to be doing this work all the time for an incomplete solution to a rare operation. I even made some test repos in both Git and Pijul to verify that Pijul forces you to resolve conflicts that three-way merge doesn't care about.
It's certainly possibly I got some information wrong about Pijul. Please correct me if I have!
That's actually the case, because you can totally simulate Git using Pijul if you want, except for the weird merges where Git shuffles up lines randomly.
> This is a big drawback and so we should hope to get some serious benefits to make up for it.
It is not a drawback at all, there are no downsides to it, and we get the very serious benefit that merges are associative, which is not the case in Git. Indeed, in Git (using diff3 to merge), when Alice adds lines at the beginning of a file and Bob adds lines at the end, some of Bob's line can get merged into Alice's new lines.
> it can not track things like "This calls a function introduced in patch X" which makes the cherry-picking functionality of very little value.
You can totally do that in Pijul by adding extra dependencies, and moreover, this is like saying `git rebase` adds very little value to Git.
> Pijul is like rebase in that it forces you to consider the full history of all the patches in a set which requires to resolve arbitrary conflicts
It is actually the exact opposite: Git forces you to reconsider those conflicts (there's even `git rerere`), whereas Pijul only shows you the unresolved conflicts. Once a conflict is solved in Pijul, it's solved by a patch, and solved forever.
I don't think this is true. The snapshot model is fundamentally different and doesn't require resolving conflicts in the same way.
> It is not a drawback at all, there are no downsides to it
It's a much more complicated model to implement, performance isn't as good, and your model is closely tied to your diffing algorithm. Contrast this to git where you can merge however you want and no one else needs to know the details.
> You can totally do that in Pijul by adding extra dependencies, and moreover, this is like saying `git rebase` adds very little value to Git.
Can do that and will happen in practice are very different things. It's not something likely possible to do automatically and doing it manually is just extra work that is probably for nothing.
> It is actually the exact opposite: Git forces you to reconsider those conflicts (there's even `git rerere`), whereas Pijul only shows you the unresolved conflicts. Once a conflict is solved in Pijul, it's solved by a patch, and solved forever.
I'm comparing git merge to adding a patch to a set in Pijul.
Let's say I have a patch A that adds a line: return 1 + 1 + 1 + 1;
and a patch B based upon A changes it to: return 1 + 1 + 2;
and a patch C based upon B changes that to: return 1 + 3;
and a patch D based upon the original A changes it to: return 4;
So we now have:
A
|\
B D
|
C
Now lets say we add them all to the same set of patches. Will I have to resolve the conflict in B and D and then also the conflict in (the resolution of B and D) and C?I do think they might want to go with something shorter (pi?) for the command-line.
Now "git," "pijul," and "anu." I guess it doesn't matter as long as it works /shrug
I just hope the command line tool gets a good 3-letter binary, "pijul record" is a bit awkward, maybe "pjl"?
And distribute that by default as well, otherwise everyone defines their own mutually incompatible aliases.
Oh and provide an official way to pronounce it!
EDIT : Oh crap : https://en.wikipedia.org/wiki/Islamic_Jihad_Movement_in_Pale...
Well, at least it didn't change the name to another (than 'Anu') ancient god : Isis !
/ɡɪt/
nouninformal•derogatory
noun: git; plural noun: gits
an unpleasant or contemptible person.
"that mean old git"For example Pijul aims to focus on first creating a patch, whereas git tutorials IME tend to focus on first creating a branch, then editing files, and only later discussing patch oriented areas such as `git add --patch` and `git stash`. I see many newcomers finally get their "AHA" insights about git's power when they learn `--patch`.
Coming from a darcs background where that was a natural and very easy part of the UX, I had reason to learn how to do it in git (because I was used to doing it quite often in darcs). When people watch me do it, they can't believe that magic exists in git.
I agree with the above poster that if graphical user interfaces prioritized it better, if the CLI had a bit fewer warts (I still often confuse when to use `git add --patch` and when to use `git add --interactive` though it isn't an awful confusion because you can get to one from the other when you remember how to use it), and if tutorials tried better to train people on the tools that already exist, a lot more people would presumably use them (daily in some cases). More awareness of tools like darcs and pijul does help in that by presenting UXes built around it, it does drive people to ask how to do equivalents in git.
(Why just the other week there was an HN headline where someone was really excited they hacked the email-focused `git format-patch` and a workflow akin to sending email to oneself to replicate `git add --patch` because they didn't realize `git add --patch` was also a built-in tool.)
I still drop into the git CLI if I need to do things like editing the contents of lines, e.g. if I've added a new function and renamed an existing one, and I want to add these as two commits, I might edit the first commit to use the old name.
I do this so infrequently that I never remember the commands, but frequently enough that I remember which StackOverflow answer to Google for: https://stackoverflow.com/a/11426261/884682
That's not a good vision for the future ;)
BTW, my Day has max 18-20 hours.
But don't be angry, i just wanted to play a little bit quality assurance...and read the documentation.
Any project moves one step at a time, even though the length of time steps might step down over time.
More detail in that blog post, when you have time.
Big problem on Git in game dev, is the fact that you often don't want to download everything. And then you have to use subtree and submodules... And that's a nightmare.
There’s no way I’m ever going to be typing pujil, no wait pijul, any amount of times during my daily work.
Anu was at least pronounceable without doing a few double takes.
To clarify: they claim that after reading the article, any independent implementation of the algorithm (even if it didn't involve looking at their code) must be licensed under the GPL. But that seems to go against everything I thought I knew about "clean room reverse engineering"?
That said I couldn't find anything authoritative like case law or guidance from WIPO or other IP organisations, so any expert input would be appreciated in this thread.
https://law.stackexchange.com/questions/4097/does-copyrighte...
Quoting:
> Well, this is the documentation for a particular implementation. It is actually targeted at a particular species of academics, who have been quietly republishing my work in recent years, and not only my work on Pijul.
---
This is absolutely bogus. TFA is a description of the math behind Pijul, not a step by step description of the implementation, and certainly not the implementation itself. Have you ever read a math/CS paper that attempts to dictate a license on all future work based on the algorithms (or ideas in general) within? I’m honestly shocked that the author, who is apparently an academic, flouts academic norms like this.
Disclosure: as someone who was trained as a mathematician, I’m offended by attempts at restricting the free exchange of knowledge.
Re sibling that links to author’s tweet: plagiarism is something else entirely, and I fail to see how GPL helps in combating plagiarism.
That's a patent, and I do think that there exists papers that describes patented algorithms.
TFA seems to think that their algorithms is patented by the GPL license
However, even patents can’t be licensed in perpetuity, so they can’t possibly apply to all future work. GPL on the other hand doesn’t have an expiry date.
In addition, there’s no implicit patent, you have to apply in every jurisdiction where you want to protect your idea, and IIRC in most jurisdictions you either can’t retroactively apply for a patent after you’ve published the idea, or you only have a short period after publishing before the right is forfeited.
Of course it does. 70 years (or was it 95?) after the death of the author, like for any copyrighted work.
I think, it's less this, and more preventing others as passing these ideas as their own. Which is valid. I've seen sleazier academics just CnP things without attribution.
When you submit a paper to a journal, you don't get to pick your reviewers. In fact, you most likely don't ever get to know who the reviewers are because the process is anonymized.
But given that many areas of scientific inquiry are highly specialized, it isn't particularly surprising that if you rip off someone's work, that someone is going to be picked as a reviewer for your paper by chance.
That comment of mine doesn't belong in that post, I removed it.
Whenever I've talked about Creative Commons with artists, their most frequent concern is about others passing off work as their own. It's a widespread conflation, but thankfully it's easy to sort out; for example, The Canterbury Tales was written before copyright existed, but that doesn't mean I can claim it as my own work; that would be fraud (specifically: plagiarism).
Ssh has such a large surface, I don't see why they would do this. I also hope they allow you to use openssh as a fall back.
Ssh deals with keys and accounts and all that which SSL/TLS don't do.
And being able to use pijul (or git) over plain old ssh is a pretty nice feature.
Second reason: SSH on Windows used to be the most nightmarish thing you can imagine.
As a matter of fact there are dozens if not hundreds of them out there. For a time, I was tracking some of them to figure out which ones support which particular protocol extension; the result is https://ssh-comparison.quendi.de and the list there is really incomplete (and sadly also outdated -- PRs welcome ;-)), I think I could easily double the number of entries there if I resumed work on it.
The one concern I'd have for a custom implementation is when they roll their own crypto... On a quick glance, that seems (?) to be the case here, see <https://docs.rs/crate/thrussh/0.28.0/source/src/cipher/chach...>, albeit only for chacha20poly1305 which is relatively easy to implement "right" and "securely", but one can still mess that up...
I'm the author, and you just made my day. Thanks.
> On a quick glance, that seems (?) to be the case here
Nope, I don't do crypto, I wouldn't work on other stuff if I did.
That particular file you point to implements decoding from SSH packets, and passes everything on to libsodium.