Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Self-host your own AI text detector on CPU to filter out slop (github.com/pablocaeg)
    —discuss
  2. I can spam anyone about the OpenAI DevDay
    —discuss
  3. Show HN: 5 mins daily programming quiz to prevent skill rot from AI coding (fata.app)
    —discuss
  4. Show HN: NotchMind – a native Mac app that puts the MacBook notch to work (notchmind.com)
    —discuss
  5. Building a Skill Interview with AI (hugoj0s3.dev)
    —discuss
  6. Dataviz: Most mentioned companies in the NYT since 01/01/2000 (habibicode.org)
    —discuss
  7. Lego Sorting via F# WebAssembly (johansivertsen.com)
    —discuss
  8. Self-Play Pretraining with Zero Data (arxiv.org)
    —discuss
  9. Show HN: CodeDiff – Fast (<100ms), robust (99.95%) syntax-aware code diff (github.com/ivankovic)
    —discuss
  10. Diablo II: Resurrected in 3D (youtube.com)
    1comments
  11. Prismriver: Formalization of Music Theory and Algorithmic Composition in Lean 4 [video] (youtube.com)
    —discuss
  12. Data context should be debuggable (getcassis.com)
    —discuss
  13. The Language of Living Air (worldsensorium.com)
    —discuss
  14. A Microsoft Lunduke OS (LCOS) Is Not Even in Top in DistroWatch (techrights.org)
    —discuss
  15. We Need to Log Some Hours Holding Babies (nwilliams030.substack.com)
    —discuss
  16. Venus Has Been Waiting 40 Years. One Scientist Is Done Waiting with It (blue-continuum.com)
    —discuss
  17. Climate is accumulating 4 Hiroshima atomic bombs worth of heat per second (4hiroshimas.info)
    —discuss
  18. "@Claude create a ticket" is an anti-pattern (bend.bearblog.dev)
    —discuss
  19. An amoeba that can survive and swim at 147 degrees F (smithsonianmag.com)
    —discuss
  20. #060: Using bubblewrap for R sandboxing (eddelbuettel.com)
    —discuss
  21. Google Researcher Praises Windows NT Kernel over Linux (x.com)
    1comments
  22. Thinking in batches and aggregates with streaming HTML (andersmurphy.com)
    —discuss
  23. Germany produces three times more solar power than Australia so far this year (reneweconomy.com.au)
    —discuss
  24. Show HN: Ophtml – Compile HTML/CSS into UIs for Your Homebrew PlayStation 2 (github.com/coffeedevsolutions)
    —discuss
  25. Realistic Code Execution Exploit Chain in OpenBao and Vault (control-plane.io)
    1comments
  26. Package Manager Sandboxing (nesbitt.io)
    1comments
  27. Anthropic's prospectus details losses, growth, and, yes, a warning that its AI (techcrunch.com)
    —discuss
  28. GeekyAnts reports top-10 placement in Clutch's financial app developer rankings (geekyants.com)
    —discuss
  29. Show HN: Bough, Visualize your vibe coded project: progress, time, cost and more (github.com/nickelsec)
    —discuss
  30. AMD buys World Labs for $8.2B (techcrunch.com)
    2comments

Show HN: CodeDiff – Fast (<100ms), robust (99.95%) syntax-aware code diff

1 pointsby 11m agogithub.com
0 comments
Hi folks!

Because of AI, there is more code to review. I don't know about you, but I get annoyed when the default git diff doesn't match something "obvious". I built CodeDiff to help.

It's a syntax-aware, careful implementation in Rust of all current research in code diffing. It parses 24 languages with TreeSitter and falls back to a modified Myers line diffing algorithm for any file it cannot parse. I wouldn't necessarily call it a novel algorithm, but it isn't a re-implementation of existing tools either.

I tested it on the last 50 commits of all 7400-or-so repositories that are in the Gentoo package list. CodeDiff can diff 99.95% of those file pairs in 120s and 6GB of RAM on a rusty 11 year old Intel E3-1275 v5. The median speed is 7ms and 93% of files are diffed in under 100ms.

I also did a bit of hand solving and have a test dataset of 1400 hand solved diffs. CodeDiff is perfect on 70% and near-perfect on 90% of them. But accuracy is actually a complex thing to measure, because if you are only after the AST diff, then it is perfect 89% of the time. Deciding what to paint however is not an objective thing so if you do try it out, check out the render options (press M) and make it fit your style.

If you just want to see how it looks like: https://ivankovic.github.io/codediff/showcase/?case=python-r...

If you want to install it: https://github.com/ivankovic/codediff

Do feel free to file issues. It's v0.1.1 at the moment, but I have been using it for months as my git difftool and I plan to keep that stable. Using it as a library directly from Rust however, might change until v1.0. The final goal for v1.0 is p99 < 400ms and 99% perfect diff, including multi-file diff support in 30 languages.

Credit where credit is due: There is a bunch of people researching diffs in the past 20 or so years. Without those papers, CodeDiff would be a lot harder to build. Especially without APTED and Myers algorithms.

License: AGPL3.0, I kind of like copy-left. If your company prevents use of AGPL software tell them to throw a few bucks my way for my token usage and we can talk.

AI disclosure: I use AI assisted coding. Claude and Mistral were used, heavily.

A quiet thread, for now.Start the conversation on HN ↗