Live data from Hacker News

Difftastic: A diff that understands syntax

github.com

41–50 of 224 posts

Re: Difftastic: A diff that understands syntax

#41

Looks nice! Now I only need patchtasic :-)

Actually, the README addresses that!

  > Non-goals
  > Patching. Difftastic output is intended for human consumption, and it does
  > not generate patches that you can apply later. Use diff if you need a patch.

Re: Difftastic: A diff that understands syntax

#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 necessary to run it.

It's frustrating to pollute my nicely packaged managed system with hundreds of locally installed python modules just to run one tool. Or, in this case, backport and rebuild a language specific build tool simply to compile. :)

Re: Difftastic: A diff that understands syntax

#45
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

Helfpul is (pun fully intended) so very, very helpful.

Honestly, I cannot imagine going back to the standard emacs help.

Re: Difftastic: A diff that understands syntax

#46
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…

>shell

>universal

* laughs in Windows, then cries *

Re: Difftastic: A diff that understands syntax

#47
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…

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?

Re: Difftastic: A diff that understands syntax

#48
post #12

Earlier quoted context omitted.

Because it is much easier, you don't have to build and maintain parsers for hundreds of languages. And you don't need need just any parser, you need very robust ones that can deal with malformed files well. Or, if you only pick a small set of supported languages, your diff tool will not work on most files or have to fall back to a structure-agnostic algorithm. Also not all text files even follow any useful grammar at…

> And you don't need need just any parser, you need very robust ones that can deal with malformed files well. I very much agree. I feel there has been a trend recently where people (re)discovered how cool and useful ASTs are and now expect everything be using them. I suspect old-school computer scientists might be secretly laughing at this while programming with some Lisp-like languages they invented for themselves.…

With only basic knowledge in the domain I would assume it is hard and ugly. If the file is malformed, there is almost certainly an infinite number of possible edits to make the file adhere to the grammar, hence there can not be any algorithm that just provides the one and only correct syntax tree. This in turn means that you have to come up with heuristics that identify reasonable changes which fix the file and that is probably not easy. Also, if you do this online in an IDE, the problem becomes probably easier [1] - if you have a valid file and then make it invalid by deleting an operator in the middle of some expression, you can still essentially use the syntax tree from just before the deletion. If, on the other hand, you get a malformed file, you might have a harder time.

[1] And also harder because if you want to parse the file after each key stroke, you have to be fast. This probably also makes incremental updates to the syntax tree the preferred solution and that might align well with using prior result for error recovery.

Re: Difftastic: A diff that understands syntax

#50
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

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 things seemed so obviously useful that I can’t understand why nobody else thought to put them there, including myself.

Post reply on HN