TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: "Smart" VCS with a built-in interpreter?

2 pointsby mofeyabout 14 years ago
Has there ever been developed a VCS that tracks changes on a semantic level? For example, if you change a variable name, then a "smart VCS" doesn't treat it as character updates, but rather as refactoring of a field.

2 comments

nostrademonsabout 14 years ago
I've heard that Darcs had a plugin that did this, but it was hella slow (like much of the rest of Darcs).<p>It's generally a very hard problem to go from a series of character updates back to a semantic update. A lot of people say "Well, just parse the source code before check-in, diff the parse trees, and store the parsed representation." The problem is that a lot of information is discarded when you go from flat text to parse trees. Comments, whitespace, linebreaks, code-formatting, etc. What happens if you rename a variable, this makes the line grow longer than 80 characters, and that forces you to add a linebreak and reindent the lines following it? That's trivial for a human to do, fairly hard for an automated refactoring tool (trust me on this ;-)), and nearly impossible to reverse in a manner that preserves the original formatting intent.
评论 #2291113 未加载
burgerbrainabout 14 years ago
What sort of enhanced user experience do you see this providing? Automated change summaries?
评论 #2291022 未加载