Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Sourcegraph: Search code, jump around source, see real usage examples (sourcegraph.com)
111 points by joe2010xtmf on July 8, 2014 | hide | past | favorite | 37 comments


Hope you have Haskell soon, I've wanted to do some analysis of occurrence of certain patterns.


None of us at Sourcegraph write Haskell, but if you know of anybody who would be interested in helping us add it (on a contract basis), please let me know! sqs at sourcegraph.com


Any plans on Clojure support?


Same deal...we would love to add it but none of us use Clojure. Anyone who's interested in helping us add it (on a contract basis) should email me at sqs at sourcegraph.com. Or follow the issue at https://github.com/sourcegraph/sourcegraph.com/issues/154.


I'd love to see C# support. I suspect you could achieve this via Rosyln [0], but I don't think I'd be able to accomplish this myself. I'd be happy to chat about it, though.

[0]: http://msdn.microsoft.com/en-us/vstudio/roslyn.aspx


CrossClj does something very similar.

http://crossclj.info/


wow, that's fantastic, thanks!


Love the idea! I tried it by searching for Node's require. It did point me to the right source [1], but the usage examples are all minified and unreadable. Might want to check for a maximum size on the usage examples that are presented.

[1] https://sourcegraph.com/github.com/joyent/node/.CommonJSPack...


Ahh, thanks for pointing that out. I just filed that at https://github.com/sourcegraph/sourcegraph.com/issues/151 and we will fix it soon.


I fixed this issue, but it'll take a while to propagate as Sourcegraph rebuilds all libraries that contain minified JS files. Thanks for reporting it.


One of the co-founders of Sourcegraph came to UC Berkeley and spoke at entrepreneurship event. He was very engaged and gave lots of real practical advice.

I've tried Sourcegraph and think it solves a real pain point but I have had problems integrating it into my workflow. I'm not sure when I should be using it. I've been meaning to use it to read more open source code code but it seems like they recently disabled support for Ruby.


We've got all of the documentation (and source code) for all versions of Ruby, and all versions of all Ruby gems over at Omniref: http://www.omniref.com

Some examples:

https://www.omniref.com/ruby/2.1.2/symbols/Enumerable/sort_b...

https://www.omniref.com/ruby/gems/sass/3.3.8

https://www.omniref.com/ruby/2.1.2/symbols/MiniTest

https://www.omniref.com/ruby/gems/activerecord/4.1.1/symbols...

You can even build custom search engines for your project by uploading your project's Gemfile.


Yeah, Omniref is really cool. We're going to release our Ruby analyzer soon as a standalone open-source tool. If you are interested in using it to get semantically annotated code on Omniref, let me know (we'd prioritize Ruby over some of the other language analyzers we are also going to release).


I'm doing it almost the same way!

http://rubycodesearch.com/


I'm glad you found my talk and that panel useful!

We will have Ruby support back in soon, hopefully this week. I'll email you when it's in to get your feedback.

As for integrating it into your workflow, the new improvements we pushed today make it much faster and easier to use Sourcegraph to find docs and examples. In a lot of cases, Sourcegraph will give you the docs or examples you want faster than a Google search. (And often Sourcegraph , because it actually analyzes code, will have examples that you can't find anywhere else.)

But we still have a lot of work to do, and it'd be great to hear your feedback on when Sourcegraph works well for you and when it doesn't.


Wasn't there a sublime plugin for sourcegraph?


Yes, it was for Ruby, and we will reenable it once Ruby support is back in. Sorry for the disruption.


I've just been able to add my repository but there's nothing happening even though it says it's indexed the code completely. No annotation happening anywhere. Does it support angular.js's development style?

https://sourcegraph.com/github.com/SchizoDuckie/DuckieTV


No, we don't support AngularJS yet. Sourcegraph really only supports node.js (anything with package.json). It's on our todo list, though!


Then you should really update the frontpage to say 'node.js' instead of 'javascript' imo, it would have saved me the time of importing my repostitory.

Other than that: cool tool! :-)


Good call. I just pushed that change. It should be up in a few minutes. I hope you find Sourcegraph useful once we support AngularJS! :)


As a matter of fact, I hope you get bought by github because this would be the most brilliant addition to it since the invention of github itself. Turning it into a code intelligence tool makes it 100^99 times more powerful.


This is very cool, it is very close to a product I would spend money for. The product I would spend money for is an e-reader for code. I would copy a 'blob' to my tablet (ipad preferred by Android is ok too) which has all of the code in my example (could be small like an application, could be large like the entire 3.13 kernel source) There would be an ever present search bar or hot-gesture that would let me search for function, definition, callers, or callees. Think cscope on steroids for the language of my choice. Browsing around the source code would bring up source in syntax colored glory (either dark motif or light). It would use high resolution fonts on my retina display for crisp clear text. The typography would be optimized for reading code. It would remember my walks through the code, it would be able to recreate them on request, it would have a swipe-able interface to get to a notes pad "behind" the code where I could at notes about what does what. I would have the ability to fold entire functions, clauses, or loops, and unfold them as needed. It could bring up doxygen comments, when I gave a long press on a function name, it could jump between call graph and code mode. In short I could read code of arbitrary complexity while I rode the train home from work, or sat on the tarmac at JFK. I would pay $100 for an App that could do that for me.


As I write this the parent comment is sitting at 0 points (downvoted by 1). Given that everyone here is looking for the "next big thing" and given that I expressed a potential market for a product which doesn't exist, I would think people might say "impractical" or "too limited a market" But I don't get the person with enough karma to down vote, doing so without a comment. I would love to know what they were thinking.


This is cool, but I'm not sure what's going on here. Is this full static (i.e. AST) analysis of these languages or simple full-text search, or some middle-ground constraint on full-text search driven by common usage patterns?

For example, "d3.timer" doesn't show meaningful results?


This is full static analysis, with AST and type inference.

However, type inference on JavaScript is quite hard, and as you've seen, our analyzer fails on many complex libraries like d3. We have an open issue about fixing d3 support at https://github.com/sourcegraph/sourcegraph.com/issues/13, which you can +1 if you want to stay updated on. And we're releasing the analysis toolkit we use as open source soon so it's not bottlenecked on us.


What I love about sourcegraph is that between it and github search/searchcode you can find pretty much every bit of code you need without resorting to Google. Big improvement to my workflow personally as I always have preferred to find an example first and the documentation second.


Searchcode is awesome and super snappy. It's great to see more tools being created to make open source code more accessible and useful.


I must be stupid, but can someone please tell me how I navigate to the list of examples? When I click on search result, I get to the relevant source code. I just can’t seem to find a way to get to the examples.


I'm 2 weeks into building the thing I just watched you demo. Cue sinking feeling.

It looks awesome. Bravo.


Sorry! I would love to get in touch with you but I don't see your email in your profile. Can you send me an email at sqs at sourcegraph.com?

(I'm the co-creator of Sourcegraph.)


I've been using it to study good open source code.


Is it possible to filter search results by language?


Sourcegraph looks beautiful. Good job guys!


[deleted]


Why do you assume the mods did that? It's just as likely the author of the comment would do that himself.


[deleted]


It was marked dead pretty soon after I posted it, so I deleted it myself because I was afraid it somehow violated the rules.


Congratulation Beyang and Quinn. Looks really slick!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: