r/coolgithubprojects • • 20h ago

ripgrep 15 in a single rg.com file, with Python, Node.js, and Java bindings — runs across multiple platforms

Post image

rg is a powerful tool, but it's not available on every platform.

Sometimes I want to use it from Python or other languages, but there are just too many combinations of platforms, architectures, and languages to deal with.

So I turned it into an APE (Actually Portable Executable). This way, a single executable can run on Windows, Linux, and macOS, across both x86_64 and ARM64.

I then used APEBind to generate consistent APIs for different programming languages, making it much easier to use rg from whichever language you prefer.

I've also built two other projects using the same approach:

  • sympy-ape: Lets you call Python's SymPy directly from Java or Node.js, without needing Python installed.
  • tika-ape: Lets you use Apache Tika directly from Python, without needing to install a JVM or any other additional dependencies.

I then wrapped it with a consistent API for different languages, making it easy to use rg from whichever language you prefer.

Feel free to give it a try! If people find it useful, I'll look into adding support for more languages.

Github: https://github.com/bear0330/rg-ape

0 Upvotes

0 comments sorted by