[ANN] ocaml.codes, code search for OPAM packages

Hello,

I recently started using a local instance of livegrep to easily search through a bunch of OCaml repositories. It’s been helpful for looking at examples of how others use certain functions or libraries where documentation is scarce.

I thought I’d set up a public instance in case others would find this handy too. You can now search through the code of most OPAM packages on https://ocaml.codes/.

Here are some things to keep in mind:

  • I’m currently only indexing GitHub repositories from the dev-repo field of OPAM packages, as most are hosted there (2375 repositories). I plan on indexing the remaining repositories if there’s interest (e.g., stuff on GitLab, Bitbucket, personal domains).
  • There’s no automated re-indexing to keep up with the addition of new packages yet, but this could be implemented fairly easily.
  • The livegrep instance is running on a low-end VPS, so the performance isn’t optimal. However, it still feels snappy and perfectly usable to me.

I’m looking forward to any feedback.

3 Likes

Looks interesting, thanks.

From your description, it sounds like there is quite an overlap with https://sherlocode.com/. Did you know about this project? If yes, do you mind saying a few words about how they compare? Thanks!

Cheers,
Nicolas

1 Like

@nojb I saw a thread about this today while creating mine, but I thought that it was just for documentation, didn’t realise that it also worked with code. Looks great actually, let me play with it some more to understand any differences, there’s definitely tons of overlap.