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

推荐订阅源

G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
C
Check Point Blog
B
Blog RSS Feed
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
小众软件
小众软件
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
GbyAI
GbyAI
The Cloudflare Blog
博客园 - 叶小钗
S
SegmentFault 最新的问题
博客园 - Franky
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
B
Blog
Jina AI
Jina AI

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.