Live data from Hacker News

Difftastic: A diff that understands syntax

github.com

61–70 of 224 posts

Re: Difftastic: A diff that understands syntax

#61
post #42
post #14

Looks really cool, but there was no instructions on how to install it. I would recommend putting an installation guide in your readme, and it being a full installation guide. I followed the link to your manual and then it told me to install your tool using a tool called "cargo" with no reference on how to install cargo. At this point I gave up. Lazy, maybe, but for a convenience tool like this I want a convenient ins…

I think it's wonderful that there's an explosion of new exciting languages, it can only improve the quality of all our tools. I for one am looking forward to replacing my eons of MATLAB experience with Julia. But I wish there was more of a convention in the F/OSS community that if your software isn't written in something universal (C, C++, shell and maybe python), then it also comes with a container of all that's nec…

Have you used pipx? I really like it for installing Python tools because it automatically creates a virtual environment for them so that their dependencies don't affect anything else.

https://pypa.github.io/pipx/

Re: Difftastic: A diff that understands syntax

#62
post #50

Earlier quoted context omitted.

Helfpul is (pun fully intended) so very, very helpful. Honestly, I cannot imagine going back to the standard emacs help.

Agreed. It’s so good it feels like it should have been that way all along. For example, when you view the help for a function Emacs has always given you a link to the source code where that function is defined. Helpful shows you the source code right in the Help buffer, and shows you a list of callers, and gives you buttons that enable tracing or debugging for the function. Once I discovered Helpful, all of those thi…

The best part is the forget function, for when functions are incompatible. As an example, lsp won't work for me unless I forget the project-root function from ess-r (I have no idea why this hasn't been fixed) and helpful makes this a two or three key activity.

Re: Difftastic: A diff that understands syntax

#63
post #43

This is written by the same guy who wrote Helpful, an enhancement package for the Emacs Help buffer. I highly recommend checking out Helpful if you haven’t seen it. https://github.com/Wilfred/helpful

He wrote https://github.com/Wilfred/deadgrep too. It's awesome and I don't know how I lived without it for so long.

Re: Difftastic: A diff that understands syntax

#65

I paid and used SemanticMerge quite successfully when we had a complex Git workflow with lots of conflicts. https://semanticmerge.com/ Since moving to short lived feature branches it is less useful to me.

SemanticMerge sounded interesting enough so I wanted to check it out, but to my surprise there is no Buy or Download link anywhere on the site. The only thing that might do it is a Login link, but I don't want to create an account just to see how much the thing costs. Is it only sold in bulk to companies? I find it bizarre that there isn't even a "contact sales" button.

There is a 'sales' button at the bottom, but it's just a link to an email. I'm really not sure how they're even trying to sell this thing.

Maybe they don't want to any more? And this is just their subtle way of pushing everyone interested in using it away?

Re: Difftastic: A diff that understands syntax

#67
post #58
post #34

Earlier quoted context omitted.

Build errors for me. Apparently I'm on some nightly build of cargo, but I need 2021 version. The pain begins... Edit: Reinstalling Cargo worked!

How did you do it? When I tried to rebuild cargo I got build errors. I'm starting to suspect the only way to run this tool is make a chroot tracking sid or something....

I just followed the installation instructions here: https://doc.rust-lang.org/cargo/getting-started/installation...

It'll confirm that you want to install it, because it's already installed I think, and I just selected 1. for Yes.

Re: Difftastic: A diff that understands syntax

#68
post #25

I really like the idea of focusing on producing patches for human consumption. I studied the problem of merging AST-level patches during my PhD ( https://github.com/VictorCMiraldo/hdiff ) and can confirm: not simple! :)

Can you give a little color on where the difficulties lie? Is it an efficiency question, or is determining "which changes" hard in the first place?

Not OP, but the docs call out some "Tricky Cases" [1].

[1] https://difftastic.wilfred.me.uk/tricky_cases.html

Re: Difftastic: A diff that understands syntax

#69
post #53

I would love it if version control stored an AST that also includes comments and dividers (where right now we would leave an empty line) and dev machines rendered it out however they wanted. They could even change the language of keywords in addition to normal formatting.

To do this requires some standard way of encoding an AST which includes comments and dividers.

That standard format is commonly known as source code - although it lacks a normal form.

Tools like prettier, gofmt and black can be thought of as a way to produce a normal form of source code.

This is (IMO) a reasonable incremental approach towards exactly what you describe - if a project checks in only source code that's formatted using a standardised format, then you're free to work on it using whatever equivalent representation you like - as long as it's converted back at commit-time.

Re: Difftastic: A diff that understands syntax

#70
post #47

Earlier quoted context omitted.

Cargo is Rust's build tool/package manager and can be installed easily using rustup. But I would probably suggest the difftastic maintainers add some prebuilt binaries to the releases (I have an example workflow here if anyone from there is interested https://github.com/conradludgate/wordle/blob/main/.github/wo... )

What's rustup and how do I install it?

See https://rustup.rs/
Post reply on HN