zlacker

[return to "Hk, a new Git hook manager"]
1. judofy+2b[view] [source] 2025-02-17 17:20:48
>>DrBenC+(OP)
> lefthook is written in go, hk is written in rust. This will make hk faster but the advanced parallelism logic in hk should make hk much faster. Because git hook managers are often limited not by their own logic but the speed of the commands they run, this should make hk significantly faster in real-world usage.

What a strange sentence. First Hk will be faster than Lefthook because it will be written in Rust[1], but then later on it says that it doesn't actually matter? But either way it will be faster because it has "advanced parallelism"?

Looking at the comparison to Lefthook it's not clear to me why this isn't a PR to Lefthook. It's already a well-established solution which is present in many package managers. Surely the distinction between "checks" and "fixes" would be possible to introduce there as well?

Do we yet another tool instead of working together on improving the existing ones?

[1]: Which also is not a given. Programs which allocate a lot can be faster in Go since the garbage collector only works on the live set of objects whereas Rust have to explicitly deallocate all memory. CLI tooling is actually kinda a sweet-spot of GCs: You don't want to spend time reclaiming memory until you reach a certain threshold of used memory. In scenarios where you use less than the threshold you end up spending zero cycles on deallocation. (And completely leaking all memory is bound to cause problem on bigger commands or smaller machines.)

◧◩
2. doug_d+Oe[view] [source] 2025-02-17 17:43:17
>>judofy+2b
Why mention Rust at all? How is that possibly relevant to the problem? There seems to be a lot of projects that are rewrites of existing project in Rust where the fact that they are in Rust seems to be their distinguishing feature. Languages are less important than the solutions that a piece of software provides.
◧◩◪
3. jayd16+3m[view] [source] 2025-02-17 18:32:50
>>doug_d+Oe
If they didn't mention the language, it would be an immediate question. The main focus is parallelism.

Could the Go solution add parallelism, sure. Did they? Not yet. Does that mean no other improvement in any other language can ever be written? No.

"Rust is faster" as an off the cuff comment that should have been left out seeing it has triggered some folks to hyper focus on that point.

◧◩◪◨
4. judofy+uo[view] [source] 2025-02-17 18:48:34
>>jayd16+3m
> Could the Go solution add parallelism, sure. Did they? Not yet.

They did: Lefthook lets you define a "group" where you can specify that every command should be done in parallel: https://lefthook.dev/configuration/group.html. In addition, it's possible to configure the whole hook to run in parallel through another property: https://lefthook.dev/configuration/parallel.html.

I'm assuming that Hk's innovation here is that it's a bit smarter with what it runs in parallel. Maybe it uses the globs to automatically run commands in parallel which targets different files?

> "Rust is faster" as an off the cuff comment that should have been left out seeing it has triggered some folks to hyper focus on that point.

It's not a a hyper focus: This was the first reason (out of only three) that Hk itself presented as a reason to use it over Lefthook. So yes, I agree: It should have been left out if the intention wasn't for people to focus on it. Put it somewhere in a footnote if it's not so relevant.

[go to top]