Live data from Hacker News

TXR – A Programming Language for Convenient Data Munging

nongnu.org

11–20 of 74 posts

Re: TXR – A Programming Language for Convenient Data Munging

#12
post #11

From where I'm standing this looks like someone put a lot of effort into re-inventing Perl, minus the documentation and user community.

I've not studied this language yet, but if its syntax is in any way saner, that would still be a net gain.

Re: TXR – A Programming Language for Convenient Data Munging

#14

Well, this looks great, but I'm not about to start digesting the self-admitted 600-page tome just to see if it's worth learning for the tasks I encounter - surely there's a "tutorial" somewhere?

This page is quite explanatory:

http://www.nongnu.org/txr/txr-pattern-language.html

Re: TXR – A Programming Language for Convenient Data Munging

#16

> The PDF rendition of the reference manual, which takes the form of a large Unix man page, is over 600 pages long, with no index or table of contents. There are many ways to solve a given data processing problem with TXR. "Good luck, you're on your own!"

I've learned/used basic TXR some time ago. I had a text parsing problem that needed backtracing, and it seemed simpler to use TXR than to use implement this in python or perl.

Basic TXR matching is really quite simple. Match some patterns, generate a report at the end. The patterns are interleaved with the matching text, so it's more like a more powerful version of regexprs (but far more readable), than a normal programing language.

You can learn it quickly based on the provided examples.

It's just a few straight forward commands, although you have to wrap your mind how the backtracing parser works.

Most of the manual is about the LISP. I never used that part and I don't think it's really needed for 95+% of all text parsing/summarizing.

Re: TXR – A Programming Language for Convenient Data Munging

#17
post #2

I ashamedly had never heard of this before. Could anyone add any colour RE: 1. Parsimony. 2. Performance vs awk and friends. 3. Multi threading. 4. Ideal use cases.

4. My use case was: If you have a some what fuzzy parsing problem that is harder than a single regexpr and needs backtracing, and then generate a report from it.

For these things TXR is great.

If you want to do multi threading or best performance it's probably not the thing to use.

Re: TXR – A Programming Language for Convenient Data Munging

#18

Well, this looks great, but I'm not about to start digesting the self-admitted 600-page tome just to see if it's worth learning for the tasks I encounter - surely there's a "tutorial" somewhere?

This page is quite explanatory: http://www.nongnu.org/txr/txr-pattern-language.html

Way off topic, but as someone who has recently switched to using a non-standard background color in my browser... that page is horrendous to read:

https://i.imgur.com/pvCnmSa.png

I can accept that doing something non-standard leads to some rough edges like this, but i'm not sure how many web developers know this is an issue. At least it has surprised me how many websites have this issue of assuming the default color is bright white.

Re: TXR – A Programming Language for Convenient Data Munging

#20

We already have this, it is R with tidyverse. What we need is a fully baked transpiler from R/tidyverse to sql.

Yep. Seriously. R w/tidyverse is a ridiculously powerful data wrangling tool especially when dealing with text files.

I tend use Notepad++ when starting out on a data-wrangling adventure. It has an uncanny ability, unlike any other editor, to open hundreds of files at the same time and to perform regex operations on all of them without dropping dead. I uses Notepad++ for initial manual exploration to get the lay of the problem, and then switch to R for the actual analysis.

Post reply on HN