Hacker News new | ask | show | jobs
by chubot 3286 days ago
Hm does anyone know of a web-based tool like this that uses Clang as a back end? I want to put open source code like the bash and Python interpreters in it and be able to navigate symbolically. And I want nice permalinks.

EDIT: It looks like https://woboq.com/codebrowser.html is what I want. The code available but not under and open source license. https://github.com/woboq/woboq_codebrowser/

I will probably try this, but I'm interested in alternatives!

1 comments

We built Sourcegraph, which is a web-based code search and navigation tool. Our Python support is in beta, and you can try it out at https://sourcegraph.com/github.com/plotly/dash/-/blob/dash/d.... (And hit Alt+D/Opt+D to search by symbol.) Sourcegraph also supports a bunch of other languages: https://sourcegraph.com/help/languages.

It gives you nice URLs (hit Alt+Y/Opt+Y to get the full commit ID in the URL to make it permanent).

Would love to hear your feedback.

I just spent a few minutes clicking around but had a bit of trouble.

EDIT: nevermind, most of this is due to the fact that you have to keep "repo" in the search box, which I found confusing.

I quickly found the repo I wanted, but discovered that C/C++ isn't supported, so Woboq is more useful to me at the moment.

I tried to build something like this once myself, and made the mistake of going "wide" rather than "deep". That is, trying to support all languages. I think it does make sense to try to get the absolute best experience for one language. But yeah for now since C/C++ aren't supported, it's not useful for me.

------

I typed "cpython" in the search box on https://sourcegraph.com/ and got no results. (I also typed "python" and got no results, which seems pretty odd.)

I would have liked to browse this repo:

https://github.com/python/cpython

I guess you have to import repositories yourself? There seem to be sample repositories, but they are in Go, and I'm interested in C/C++ (the Python interpreter, not Python source code).

I'm looking for something that uses Clang as a back end for intelligent navigation of C/C++ projects.

Also, I would like to browse the bash source code, but as far as I know it isn't available on Github. Can SourceGraph import from an arbitrary git repo?

https://savannah.gnu.org/git/?group=bash

That said I'm glad somebody is working on this problem! I like your mission statement.

Thanks for posting this. We'll think about how we can make that search UX clearer. And when we have C/C++ support, I hope you'll find it super useful.
> Sourcegraph also supports a bunch of other languages: https://sourcegraph.com/help/languages.

That's an interesting link. It only works when you go to "Help -> Language features".