2 ms·
> that I don't already have with Python, Zsh, and Gauche Scheme. Those times when it would be nice for the Python-Zsh-Scheme solution to be in one language and
by kazinator 3y ago
> that I don't already have with Python, Zsh, and Gauche Scheme.
Those times when it would be nice for the Python-Zsh-Scheme solution to be in one language and program.
> is this solution any cleaner or faster or easier to write or read than the equivalent in Python or Perl or Gauche or Guile or Common Lisp?
I believe so because we can see the salient parts of the diff hunk structure appearing literally in the code, so we know at a glance where it is pulling what. I've not looked at that since 2016 but it's transparent.
On top of that, any Python, Perl, Guile or Common Lisp solution can be transliterated to decent TXR Lisp. There are multiple ways to attack that same problem in TXR, not necessarily using the TXR Pattern Language.
There are "spiritual ties" between TXR Lisp and Common Lisp. There probably isn't another language distinct from Common Lisp that is as similar to Common Lisp as TXR Lisp. The TXR Lisp reference manual mentions ANSI CL numerous times in various Dialect Notes.
There is a translation to TXR Lisp of the CL-WHO HTML generation library called TL-WHO. It's a function-by-function translation that retains most of the structure of the original code. https://www.kylheku.com/cgit/tl-who/about/ https://www.kylheku.com/cgit/tl-who/about/
If you have CL skills and knowledge, a lot of it will transfer over to TXR Lisp, and vice versa. There will be things you will miss in either direction.
By the way, here is another TXR program that matches unified diffs: diff2err:
https://www.kylheku.com/cgit/diff2err/tree https://www.kylheku.com/cgit/diff2err/tree
This reads diff material from standard in and converts it to compiler error format, stored in a file called errors.err (implicitly used by "vim -q" quickfix mode). This is useful for visiting differences in the actual code, with the editor: you can jump to all the places that were changed, and at every location, the diff info appears in diagnostic format: how many lines were changed, and what the original lines are.