惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
小众软件
小众软件
S
SegmentFault 最新的问题
GbyAI
GbyAI
量子位
爱范儿
爱范儿
L
LangChain Blog
Vercel News
Vercel News
A
About on SuperTechFans
腾讯CDC
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
V
Visual Studio Blog
美团技术团队
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium

The Rust Programming Language Forum - Latest posts

What's everyone working on this week (21/2026)? Rust Function Call with one Param Iced + Canvas + Text: How do I create a style for canvas text "Value dropped while borrowed" as a lifetime mismatch Weird `use of moved value` behaviour Slightly surprising behavior of a while loop Clap: how to disable options after a certain positional argument How do i tell rust-analyzer what kind of bracket to use for a macro? Iterator + Borrow Checker: Work around borrowing already borrowed mutable variable Requesting data via mavlink SKILLS.md for Rust development 🧵 Stringlet UTF-8 Hack Option Niche? Iterator + Map - How do divide every element, including the last element, by the last element Why can't we store returned value of a function in a variable if one of the parameters goes out of scope My first crate :D, floop: A more convenient and less error prone replacement for loop `{ select! { .. }}` Sorting is slow because architectures are wrong — zan-sort redesigns the architecture, not the algorithm Iced Font - Create a custom monospace font to display dollar amounts Is the UnsafePinned RFC wrong about being able to return `&mut T` from `get_mut_unchecked`? Fixing Polars 0.37 compilation errors: Hashbrown 0.17 dependency conflict and decimal parsing Any plans for improving error diagnostic in Rust 2.0? How do I build completely offline? Is `&mut T -> &mut ManuallyDrop<T>` well-defined and sound? Would you use this? — fixtura, declarative fake data injection for tests Foreign trait restrictions on native types make generics hard to use Cargo Exclude Directive Compiler reasoning around a modulo counter Multiple mutable references to elements within one vector Handling non-`Send` data in a `Send` closure Review: Static Multi Pool Allocator Rmquickjs - High-level MicroQuickJS bindings for Rust
Sem: semantic entity level version control CLI built with...
rs545837 · 2026-04-20 · via The Rust Programming Language Forum - Latest posts

I've been researching and working on a CLI tool called sem that diffs code at the entity level (functions, classes, structs) instead of raw lines. Written in Rust, open source.

The motivation came from feeding diffs to LLMs. Line-level diffs are optimized for human eyes scanning a terminal, but when you feed a git diff to a model, most of those tokens are context lines, hunk headers, and unchanged code. I ran some attention score experiments and found the model concentrates significantly better on semantic diffs than raw git diffs.

sem uses tree-sitter to extract entities and diffs at that level. Instead of lines with +/- noise, you get exact entity changes: which struct changed, which function was added, which ones were modified. It also builds a cross-file dependency graph with petgraph and does transitive impact analysis via BFS.

Commands:

  • sem diff - entity-level diff with word-level inline highlights
  • sem entities - list all entities in a file with their line ranges
  • sem impact - show what breaks if an entity changes
  • sem blame - git blame at the entity level
  • sem log - track how an entity evolved over time
  • sem context - token-budgeted context for LLMs

Parsers for Rust, Python, TypeScript, Go, Java, C, C++, C#, Ruby, Bash, Swift, Kotlin, plus JSON, YAML, TOML, Markdown, CSV.

There's also an extension of this research study towards a git merge driver called Weave that plugs into git via .gitattributes and resolves conflicts at the entity level. Two developers editing different methods in the same class get a clean merge instead of a conflict.

I wrote up the algorithmic decisions (structural hashing with xxHash64, three-phase entity matching, BFS vs DFS for impact analysis, Rayon for parallel parsing) here: Building Semantic Version Control in Rust

Install: brew install sem-cli

GitHub: https://github.com/Ataraxy-Labs/sem

Happy to answer any questions about the tree-sitter integration or the graph approach. Always eager for constructive criticism.