Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

phiresky does this use libripgrep under the hood?

Or do you shell out to the ripgrep binary?



libripgrep isn't currently a thing (not merged to mainline). On reddit, the author noted that ripgrep (and other utilities) need to be on the PATH, which is one of the issues related to windows packaging.


libripgrep has been on master since 0.10.0. There just isn't any high level documentation for it.

It's not clear whether libripgrep would be a good fit for this project or not. They would need to reroll all the arg parsing logic themselves. libripgrep is really about building your own search tools (or more specialized tools) using the same internal infrastructure as ripgrep. But yeah, this is why I need high level docs to explain this stuff. I've been putting it off until I get bstr straightened out.


> It's not clear whether libripgrep would be a good fit for this project or not

I actually looked into using libripgrep for this, but then I decided not to because of (a) not wanting to handle arg parsing myself (ripgrep has sooo many arguments), (b) missing or hard to find documentation.

The main reason it might be a good idea is because currently ripgrep does not know at all about a single file returning multiple "files", and all line prefixes are "hardcoded" (e.g. Page X: hello in pdfs is just prefixed per line). Also I can't rely on ripgrep's binary detection currently, because it would have to happen for "parts of files" from the perspective of ripgrep.

It would be great if ripgrep had a slightly more advanced preprocessing API - allow returning multiple "files" per filename input, maybe even with a "sourcemap" of line<->Page etc.


> libripgrep has been on master since 0.10.0. There just isn't any high level documentation for it.

Oh damn, sorry (when I checked yesterday the branch was still there and the "doc" PR was still open so I assumed it wasn't merged yet)


I'd like to try libripgrep out in one my projects, maybe I could also take on the challenge of attempting to document it.


So, a lot of it is actually written already. :-) https://github.com/BurntSushi/blog/blob/ag/libripgrep/conten... (The formatting is FUBAR, so you'll want to look at the raw text.)

There's just a lot of polish that needs to be done, and converting portions of it appropriate API documentation. Unfortunately, I don't really have the bandwidth to mentor this at the moment. :-( However, with that said, one super useful thing you could do is try out libripgrep and then give feedback[1] on how it worked for you, and in particular, which things were hard to figure out.

[1] - https://github.com/BurntSushi/ripgrep/issues/1009




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: