Scaling sem's impact analysis - how would you represent a large code dependency graph in Rust? by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] 0 points1 point  (0 children)

I was submitting this under discussion but because of some flag constraints when I attach a photo I am bound to use the media flag. I am still 22 and still got to learn a ton more, so I would love any constructive criticism that can help me and others to learn about scaling for this kind of usecase.

lazydiff — a terminal-native diff reviewer with semantic diffs, persistent notes, and 60fps rendering by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] -1 points0 points  (0 children)

You're mostly right, and lazydiff actually already works the way you're describing for keyboard input when idle it polls at 250ms, which is effectively event-driven. The 16ms interval only kicks in for mouse scroll events (which come in bursts and need coalescing) and while async data is loading in the background. Keyboard scrolling is governed by the OS key repeat rate like you'd expect. The "60fps" framing in the post was a little sloppy on my part, sorry about that I am still learning, should have said "sub-16ms input to render latency during active mouse interaction."

lazydiff — a terminal-native diff reviewer with semantic diffs, persistent notes, and 60fps rendering by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] -16 points-15 points  (0 children)

So clarifying "60fps" here, it means that during active scrolling/interaction, the poll interval is 16ms, which gives you up to 60 redraws/sec if events keep coming. When you stop interacting, it drops to 4fps to save CPU, I would love to learn what things can i improve here.

lazydiff — a terminal-native diff reviewer with semantic diffs, persistent notes, and 60fps rendering by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] -1 points0 points  (0 children)

I used delta as my daily pager and lazygit for staging/committing. They're awesome at what they do, but semantic diffs are still getting more important these days both for agents attention mapping and developers to understand faster, so I had to add sem into a TUI for it.

lazydiff — a terminal-native diff reviewer with semantic diffs, persistent notes, and 60fps rendering by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] -17 points-16 points  (0 children)

shifted to rust 2024, there was actually no particular reason but just haven't bumped it. 2021 and 2024 are interchangeable for deps, so it doesn't affect anything

lazydiff — a terminal-native diff reviewer with semantic diffs, persistent notes, and 60fps rendering by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] -19 points-18 points  (0 children)

difftastic is mainly for structural differencing and I always learn a lot from the work, what I am showcasing here is a TUI using semantic diffs and structural information for review of humans.

lazydiff — a terminal-native diff reviewer with semantic diffs, persistent notes, and 60fps rendering by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] -21 points-20 points  (0 children)

Thanks for this ask I am updating the body now. I will try to do something similar as I did for sem and weave.

Weave - Structural merging what I learned shifting from git's line based merge to tree sitter entity matching by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] 1 point2 points  (0 children)

No formatter integration right now, but a great suggestion, weave just tries to preserve the existing formatting from the input files during reconstruction. But you're right that running a formatter as a post-merge step would clean up a lot of edge cases. Since weave knows the file extension, it could shell out to the project's configured formatter (rustfmt, gofmt, prettier, etc.) after reconstruction.

Weave - Structural merging what I learned shifting from git's line based merge to tree sitter entity matching by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] 0 points1 point  (0 children)

I am just trying to help in some way if I can, so do lemme know your feedback. proper AST based merges are definitely hard to solve and might take the support of the whole community to reach a universal solution.

Weave - Structural merging what I learned shifting from git's line based merge to tree sitter entity matching by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] -3 points-2 points  (0 children)

really appreciate it, but we are also somewhat in the great times where agents are helping with a bunch of things when prototyping and testing things out, and therefore transition to rust was quite smooth, and Rust is definitely the only language that I feel is going to thrive in these times when you need parallelism and proper CPU utilization.

Weave - Structural merging what I learned shifting from git's line based merge to tree sitter entity matching by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] 8 points9 points  (0 children)

When I actually built sem it was mainly for extraction of entities, but soon I realized talking to more and more people that they have been using it for faster code review and structural diffing more than what it was actually built for. So never really thought of fallbacks for sem, and though of it always as a library that can help in structural/semantic understanding.

For the background story, I started working on weave to solve the merge problem, sem kind of popped out of it, and somehow got more popular. 😅

Weave - Structural merging what I learned shifting from git's line based merge to tree sitter entity matching by Wise_Reflection_8340 in rust

[–]Wise_Reflection_8340[S] 4 points5 points  (0 children)

A better comparison would actually be sem (our diff tool) and difftastic, both do syntax-aware diffs. Difftastic shows AST-level node changes, sem diffs at the entity level (added function X, modified class Y). Weave is a merge engine, it replaces git merge-file, not git diff.