is it possible to use ripgrep as a library inside of another Rust program? #2067
-
I want to ship ripgrep functionality as part of a larger Rust program (using Tauri), but do not want to rely on calling ripgrep as a separate shell process. How feasible is this? Is there any documentation that you can point to that could help with this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If you cannot create a child process, then your only option is to port ripgrep to Javascript or to devise a C API of ripgrep's various crates. Either is technically possible, but "feasible" is not a word I would use to describe it unless you have a lot of resources to throw at it. I suggest shelling out, like VS Code does. Or writing your application in Rust and make use of ripgrep's crates as-is, and compile to WASM. |
Beta Was this translation helpful? Give feedback.
If you cannot create a child process, then your only option is to port ripgrep to Javascript or to devise a C API of ripgrep's various crates. Either is technically possible, but "feasible" is not a word I would use to describe it unless you have a lot of resources to throw at it.
I suggest shelling out, like VS Code does. Or writing your application in Rust and make use of ripgrep's crates as-is, and compile to WASM.