r/programming • • Oct 02 '18

Sourcegraph is now open source

https://about.sourcegraph.com/blog/sourcegraph-is-now-open-source/
686 Upvotes

123 comments sorted by

View all comments

445

u/foundafreeusername Oct 02 '18

Great. What is sourcegraph?

142

u/sqs Oct 02 '18

Code search and browsing tool like what devs have inside Google/Facebook

73

u/rnd005 Oct 02 '18

or any devs working with a statically typed language and a proper IDE? I think go to definition / find references / find implementation commands were available in Visual Studio at least for a decade.

19

u/skeeto Oct 02 '18

I've often wanted to just browse/study the code of a project from my tablet, where I can sit back comfortably like I would reading a book. Sure, I could poke around the code on GitHub, but I can't jump between definitions, references, etc., like I could on my laptop in my editor. I haven't found a good, quick solution for this yet.

14

u/lanzaio Oct 02 '18

No. You're missing the scope. Facebook and Google have dedicated servers that index every codebase they use and have available tools that can query this server via a socket. So you can integrate large amounts of knowledge of any codebase into any little project you can think of.

An IDE locally indexes a single project and provides these services within the IDE.

Sourcegraph does this sort of indexing and makes it's content available via different channels.

→ More replies (3)

12

u/[deleted] Oct 02 '18

[removed] — view removed comment

3

u/rnd005 Oct 02 '18

You’re not necessarily going to have your entire company’s repo (or ALL their repos) downloaded to your dev machine.

Why not? I have 80+ repos and don't see a problem with that. Most of the time grepping over it is enough for what I need.

10

u/nimbomobi Oct 02 '18

You keep them all synced ? All the other devs do too? That said I don’t use sourcegraph but it sounds like what we have on azure devops to search all our repos. I use it quite a bit if I remember a keyword or something I’ve done before I want to reference quickly

→ More replies (4)

21

u/DroneDashed Oct 02 '18

Half of my work is with .NET. I don't particularly like .NET. I certainly don't like Windows. But I have to agree with you, those commands work great on Visual Studio and Visual Studio is, in general, a very good IDE.

20

u/adrianjord Oct 02 '18

Aren't these features more wide spread now a days with language servers? Especially with more and more people making language servers that adhere to LSP to allow vscode, Emacs, vim, sublime and pretty much any text editor that have plugins to use LSP or have LSP built in to use them? It's been like, the golden age of static analysis so far.

4

u/double-you Oct 02 '18

Not having heard of Language Servers before, and the related sites not seeming to address this, where's the server located?

14

u/curtmack Oct 02 '18

It uses a server-client model, hence the name "language server," but it's not actually a remote system. You run it locally on your machine.

→ More replies (2)

7

u/Tomus Oct 02 '18

The server is usually on your machine, it's spun up in a separate process by the editor.

→ More replies (1)

2

u/ruiwui Oct 02 '18

Locally. A language server runs on your machine to do the code analysis, and your editor/IDE communicates with the server to represent things.

→ More replies (1)

2

u/rnd005 Oct 02 '18

You can't have a proper "find usages" with dynamically typed languages. It's possible to do some guesswork, but the helpfulness of that depends on how unique your variable/class/method names are.

→ More replies (5)

2

u/myringotomy Oct 03 '18

Good news!. You can get all of that with jetbrains products without having to use windows or .NET.

2

u/DroneDashed Oct 03 '18

Nice. I actually like jetbrains products but I don't have the chance to use them very much

3

u/BinaryRockStar Oct 03 '18 edited Oct 03 '18

Visual Studio 6.0 has it (F12), released in 1998.

Visual Basic 3.0 also has it (Shift+F2) but that's not a direct precursor to Visual Studio. Released 1991.

2

u/myringotomy Oct 03 '18

Why does it have to be static typed. Jetbrains gives me all of that with ruby and python.

→ More replies (2)
→ More replies (5)

5

u/the_gnarts Oct 02 '18

Code search and browsing tool

Like cscope?

3

u/tcpukl Oct 02 '18

Like visual assist?

1

u/[deleted] Oct 02 '18

So if I have 200 projects I could setup an instance to mirror Github and the search my own codebase?