Sourcegraph is now open source
The kind of cross-reference SourceGraph provides is a must have for me after a few years of using a tool like it to understand big projects (I don&#x27;t use SourceGraph, I use Grok&#x2F;CodeSearch).<p>Google open sourced a version of Grok some time ago (<a href="https:&#x2F;&#x2F;kythe.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;kythe.io&#x2F;</a>). [1]
A quick search also found this `OpenGrok` thing which I assume must be yet another generic indexer [2].<p>I wonder if there are other <i>popular</i> tools out there providing generic cross-referencing of code bases?<p>&lt;SourceGraph&gt;<p>I was trying to find the equivalent of this Kythe page (how to write an indexer)[6] on SourceGraph docs, after 20 minutes I was still confused. I wish there was more clarity on the different pieces of the system. At first I thought SourceGraph could create a cross reference index from an LSP server, but I guess makes more sense it is the order way around? (SG can talk to text editors via LSP).<p>It must be a lot of work to make integrate any single language with both SG or Kythe and LSP, perhaps there&#x27;s some tools or methodologies to make this easier?<p>&lt;Tangent&gt;<p>I feel like language designers don&#x27;t always think about building their implementations with ease of integration as a goal. I remember wanting to play with doing some AST transformations with both TypeScript and Dart (independently) and finding both languages made the task so hard and tedious. Mandatory remark: this is so easy with Lisp derivatives :-)<p>Things that a good language+ecosystem should have, IMO:<p>* Easy to retrieve and manipulate CST (for things like writing refactoring and querying tools, writing code formatters&#x2F;pretty printers, etc). Many languages provide the syntax tree say, without comments, so it is hard to write a pretty printer.<p>* Documentation generator with cross-reference navigation.<p>* Play along nicely with generic build tools like Ninja [3].<p>* Good debugger and value-pretty-printer support (so I can just drop a breakpoint and print anything easily). And some sort of API to use the debugger programmatically or connect to a remote process.<p>* An LSP implementation [4], although it seems pretty much every popular language is getting one these days!<p>1: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Google_Kythe" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Google_Kythe</a><p>2: <a href="http:&#x2F;&#x2F;oracle.github.io&#x2F;opengrok&#x2F;" rel="nofollow">http:&#x2F;&#x2F;oracle.github.io&#x2F;opengrok&#x2F;</a><p>3: <a href="https:&#x2F;&#x2F;ninja-build.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ninja-build.org&#x2F;</a><p>4: <a href="https:&#x2F;&#x2F;langserver.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;langserver.org&#x2F;</a><p>5: <a href="https:&#x2F;&#x2F;about.sourcegraph.com&#x2F;docs&#x2F;code-intelligence&#x2F;" rel="nofollow">https:&#x2F;&#x2F;about.sourcegraph.com&#x2F;docs&#x2F;code-intelligence&#x2F;</a><p>6: <a href="https:&#x2F;&#x2F;kythe.io&#x2F;docs&#x2F;schema&#x2F;writing-an-indexer.html" rel="nofollow">https:&#x2F;&#x2F;kythe.io&#x2F;docs&#x2F;schema&#x2F;writing-an-indexer.html</a><p>&lt;edit: line breaks&gt;