Linux code search
codesear.ch
codesear.ch
There is also http://searchco.de.
I will have an official announcement once I get the exact count, but its something like 3,338,449,289 lines to 3,800,000,000 or so.
So heres a bookmark to add links to the page, run it after completing the search query: http://pastebin.com/G53SjNWy
Also, its my first little foray into JS, so I'd really appreciate any criticism of the code and/or style.
edit: new link preserves the <td> tags
I had so much fun demo'ing that ability at a PHP conference one year.
I wish that the `filename` column was a link to the raw file (or a link to the file in git.kernel.org).
A simple grep I can do myself (with the added bonus of knowing what version/commit I'm searching against).
I did a code search thing, (which I don't claim is anything more than a hack) described over in this HN thread: http://news.ycombinator.com/item?id=4113348 but yes, the syntax wasn't quite 'a string', you'd type the code you're looking for with parts wildcarded, but parentheses in what you typed had to match.
I keep going back lately to Rob Pike's idea that breaking files into lines is not the best approach (http://news.ycombinator.com/item?id=4111667). In that paper he proposes a regular expression for breaking up lines into structured content. But maybe there's another way. Like an ometa grammar? (http://tinlizzie.org/ometa)
Anyways, just a few random thoughts.
For Krugle, we actually parsed the various languages so it actually knew the differences between e.g. definitions, invocations, comments, strings, etc. It affords the capabilities to do all sorts of cool queries and analyses.
This is weak.
P.S. Chrome source search does the same thing, makes me angry and sad with so many stupid people.
I'm the author of this and didn't really intend for it to get submitted to hacker news at this point, which is why it's missing this feature among others. I literally just got things working on Sunday afternoon. I am definitely going to make it possible to link to search results.
clang-3.1.src gcc-4.7.1 ghc-7.4.1 linux-3.4.4 llvm-3.1.src lua-5.2.0 openjdk perl-5.16.0 php-5.4.4 Python-2.7.3 Python-3.2.3 ruby-1.9.3-p194
And it only increased the size of the index by about 50%.
EDIT: Don't get me wrong, the code behind this is awesome. I just can't help but think there could be something bigger to search, that is infeasible to do on my desktop. What about all of the code from the Debian repositories or something?