trre
Dev tools
text editing regex tool
SHOW HN2025
How HN took it
10 positive, 20 neutral or asking, 1 mixed, 19 critical, out of 50 comments about the project. Thread score -0.17.
Idea: 9 for, 9 againstDesign: 0 for, 4 againstDocs: 0 for, 4 againstExecution: 1 for, 2 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Interesting idea and clean small C code
From 3 comments
What a pleasure your C code is :) very nice (currently reading it) My only quick comment is - the link to `theory.pdf` in README is broken (your pdf is in docs/ dir, so just need…
wfn on HNI love the idea, wanna se where it goes. Gives me the same vibe as when jq came out all those years ago.
sabellito on HNvery inspiring idea, makes me wanna start projects I had in mind related to that. thanks and good luck
agumonkey on HN
Transducers are a powerful approach for in-place text transformation
From 2 comments
In place replacing the text while parsing is very powerful approach. Fingers crosses this flies. This, combined with probabilistic approach can be even more interesting.…
larodi on HNInteresting! I did an internship where I tried to use transducers for fast information extraction. In theory, you can use FST's for fast approximate parsing. I didn't really work…
synthc on HN
Objections
Operator precedence for colon is unnatural
From 3 comments
Cool, I’m interested to see where you go with this. I found the operator precedence unnatural, and it looks like a lot of other folks in this thread did too. I would naturally…
danielparks on HNI would give the colon operator lower precedence than concatenation and repetition.
layer8 on HNsweet, I did my "Diplom" CS thesis around 1997 on finite state transducers. was mich less trivial than I'd thought. the ask was to implement composition and DFAs where possible.…
froh on HN
Docs and examples are wrong or underspecified
From 4 comments
I feel like this is very underspecified, The very first example: ``` $ echo 'cat' | trre 'c:da:ot:g' dog ``` Feels strange. What is happening here; the grammar says ``` TRRE <-…
andrewla on HNAre the examples all actual outputs of the program? It's entirely possible that my understanding of the grammar is off, but it looks like these examples are wrong: $ echo 'cat…
i3oi3 on HNFrom the readme: ``` $ echo 'cat' | trre 'c:da:ot:g' dog ``` Why? Elsewhere, the readme says that ":" is "non-associative", and I had a look at the language grammar but haven't…
MathMonkeyMan on HN> $ echo 'xor' | '(x:)or' 'xor' > cat I got lost here.
the_arun on HN
No convincing examples of advantage over regex or sed
From 4 comments
> Regular expressions is a great tool for searching patterns in text. But I always found it unnatural for text editing. The entire purpose of this project seems to hinge on this…
crazygringo on HNIt's a cool exploration, but I'm missing examples of why it's actually better. (Which, TBF, might just be an indicator I spent too much time with regexps :) I.e - why is trre…
groby_b on HNWhen I saw this headline, I got excited about the prospect of a new innovation in the application of Regular Expressions. After reading, I was scratching my head because trre…
metadat on HNso basically just `sed -e`?
pmarreck on HN
Build and -g flag errors in installation
From 1 comment
I ran the installation lines and got this error: ``` make && sh test.sh cc -std=c99 -Wall -Wextra -Wpedantic -o2 trre_nft.c -o trre cc -std=c99 -Wall -Wextra -Wpedantic -o2…
simlevesque on HN
Requests
Clearer examples showing advantage over regex
From 2 comments
> Regular expressions is a great tool for searching patterns in text. But I always found it unnatural for text editing. The entire purpose of this project seems to hinge on this…
crazygringo on HNIt's a cool exploration, but I'm missing examples of why it's actually better. (Which, TBF, might just be an indicator I spent too much time with regexps :) I.e - why is trre…
groby_b on HN
Support for structural or tree-based substitution
From 1 comment
This doesn’t seem sufficient as soon as you want to perform some kind of structural substitution, for example doing the equivalent of s/"([^"]*)"/'$1'/. If it could do that and…
layer8 on HN
Change colon precedence to lower than concatenation
From 2 comments
I would give the colon operator lower precedence than concatenation and repetition.
layer8 on HNsweet, I did my "Diplom" CS thesis around 1997 on finite state transducers. was mich less trivial than I'd thought. the ask was to implement composition and DFAs where possible.…
froh on HN
Disallow * and + on right side
From 1 comment
> Avoid using * or + in the right part, as it can cause infinite loops Why not just disallow this? I understand it would make the grammar more difficult to specify - but I don't…
zoogeny on HN
Questions
Why does 'c:da:ot:g' produce dog
From 2 comments
I feel like this is very underspecified, The very first example: ``` $ echo 'cat' | trre 'c:da:ot:g' dog ``` Feels strange. What is happening here; the grammar says ``` TRRE <-…
andrewla on HNFrom the readme: ``` $ echo 'cat' | trre 'c:da:ot:g' dog ``` Why? Elsewhere, the readme says that ":" is "non-associative", and I had a look at the language grammar but haven't…
MathMonkeyMan on HN
How the range operator behaves with [a:A-z:x]
From 1 comment
Not sure the range operator is fully specified, this works and seems like it shouldn't: ``` echo "regular expressions" | ./trre "[a:A-z:a]" REGULAR EXPRESSIONS ``` In fact,…
skykooler on HN
Alternatives named
sed
From 3 comments
When I saw this headline, I got excited about the prospect of a new innovation in the application of Regular Expressions. After reading, I was scratching my head because trre…
metadat on HNso basically just `sed -e`?
pmarreck on HNThis is nifty --- and small. You could port this to like V7 Unix from 1979 or earlier; why didn't they get this idea? :) Tools like sed build a transducer around the whole…
kazinator on HN
Xerox XFST and FOMA
From 2 comments
For folks interested in finite-state transducers and other kinds of tooling available, check out XFST (Xerox Finite-State Transducer), which has been used in computational…
languagehacker on HNCheck out Xerox XFST and its open source clone FOMA for finite state transducers as described by extended regular expresssions, both of which describe the language of regular…
jll29 on HN
Rosie Pattern Language
From 1 comment
If you are looking for an alternative to standard regex, especially if you have trouble with group logic and are looking for something maintainable, you might like the Rosie…
Lanzaa on HN
Carmel
From 1 comment
Another alternative that is similar would be Carmel (https://github.com/isi-nlp/Carmel-Repository)
BFPQVZ on HN
VS Code regex replace
From 1 comment
Another alternative is regex and use replace all. Then you cam replace the regex cat with dog (or use a group for wrapping with space) This is a common modus operandi for me in…
aqueueaqueue on HN