Live data from Hacker News

How Google Code Search Worked

swtch.com

41–47 of 47 posts

Re: How Google Code Search Worked

#42
post #32

What were the criteria for determining that there were too many unique 2-grams and too few 3-grams? Did it just come down to too much memory for the former, and barely enough memory for 3-grams?

Compare 256^2, 256^3, 256^4.

Re: How Google Code Search Worked

#43
post #26
post #10

Google made a mistake in killing code search. Indexing the world's source code and making it searchable is so obviously part of their core mission that I wonder how this decision even got made. Yeah, code search is a niche market numerically speaking, but intellectually and economically (considering the economic impact of software) it is vital. Google was doing so much better a job of it than anybody else that they c…

You mentioned hoping someone can come along to get this right. I am certainly trying with http://searchco.de/ Its still a long way from being close to Google code search both in terms of code indexed (amending that as I write this) but I hope to get things up-to a par as soon as I possibly can. Symbolhound http://symbolhound.com/ also has a code index that's worth a look too.

SymbolHound developer here, thanks for the mention boyter!

Re: How Google Code Search Worked

#44

Earlier quoted context omitted.

Seems like the default should be linear runtime and you should have to explicitly ask for the richer feature set (and opt into the assertion that you trust the input not to DOS your process). Could easily be added as a modifier (see `man perlre`), but should be implemented as two to enable explicit behavior and toggling the default. Randomly picking the letter N: /(\w+) \1/n # Error: look-behind is incompatible with…

I don't think you need to even go as far as adding a modifier. A smart enough regex engine would know when it could use the linear runtime algorithm, and when it needs to fall back.

Hence my last example without the modifier & the comment saying it should work.

My claim was that there should be a modifier to demand a particular performance characteristic. i.e. "I want an error if I do something stupid"

Assuming that means that a library function exists to verify that no linearity-breaking features are used, you could also use that to validate user input, which may be good enough.

Re: How Google Code Search Worked

#45
post #38
post #26

Earlier quoted context omitted.

You mentioned hoping someone can come along to get this right. I am certainly trying with http://searchco.de/ Its still a long way from being close to Google code search both in terms of code indexed (amending that as I write this) but I hope to get things up-to a par as soon as I possibly can. Symbolhound http://symbolhound.com/ also has a code index that's worth a look too.

That's a seriously cool website. You're obviously still developing it, but way to go!

Thanks. Working on increasing the index size and speed for the moment. Live indexes will be coming up soon too.

Re: How Google Code Search Worked

#46
post #43
post #26

Earlier quoted context omitted.

You mentioned hoping someone can come along to get this right. I am certainly trying with http://searchco.de/ Its still a long way from being close to Google code search both in terms of code indexed (amending that as I write this) but I hope to get things up-to a par as soon as I possibly can. Symbolhound http://symbolhound.com/ also has a code index that's worth a look too.

SymbolHound developer here, thanks for the mention boyter!

No problem at all. The more people attacking the problem the better off we all are.

Re: How Google Code Search Worked

#47
This is a really great tool. If it could take the first .csearchindex going up the tree as the current index (somewhat like git does with .git dirs), it could easily top rgrep/ack for searching into projects. (just add line numbers and some match coloring)
Post reply on HN