Live data from Hacker News

Towards Natural Language Semantic Code Search at GitHub

githubengineering.com

41–50 of 55 posts

Re: Towards Natural Language Semantic Code Search at GitHub

#41

It is a real cultural problem how engineers get more excited about machine learning than basic usability. GitHub search can't even search for a literal string, let alone a regex. It can't search a subdirectory. Ranking is indistinguishable from random. It's been this way for years. How about building an actual, usable, basic code search and then getting all fancy with your machine learning? I almost built my own "onl…

I've honestly moved to Google, adding

`{search query} -site:github.com/{repo}/{file i want to target}`

Its much clearer and concise.

Re: Towards Natural Language Semantic Code Search at GitHub

#43

Earlier quoted context omitted.

We are very aware of the problem. I think you are going to really love what we are working on.

I really hope you are right and have your priorities straight when it comes to search. I'd love for a way to search for usages of a class::method, or for strings that contain the text "hello" or for variables named foo. And if you integrate that into the code itself, Ctrl+click a class method to find all usages, maybe even usages in other repositories, so I can see how other people use a certain library. And of cours…

Sourcegraph does this quite well if you need.

Re: Towards Natural Language Semantic Code Search at GitHub

#44
post #16

It is a real cultural problem how engineers get more excited about machine learning than basic usability. GitHub search can't even search for a literal string, let alone a regex. It can't search a subdirectory. Ranking is indistinguishable from random. It's been this way for years. How about building an actual, usable, basic code search and then getting all fancy with your machine learning? I almost built my own "onl…

Agreed. Luckily, we as a community have tools like Sourcegraph which are based on battle-tested pragmatic systems from places like Google. Disclaimer: no affiliation, just love the team and product.

Damn, Sourcegraph is very close to something I've been thinking of building.

Re: Towards Natural Language Semantic Code Search at GitHub

#45
post #30

Earlier quoted context omitted.

People use grep on their local code repository, which is generally less than 2 gigabytes of source. A tool like ripgrep can process that in under a second on any modern machine with a warm disk cache. Its when you get to hundreds of repositories or 10's of gigabytes of code that local tools cannot run fast enough. They are not designed for this use-case, and usually rely on the files being searched hitting the disk c…

Nobody is asking for cross-repo search. Literally just let us run "git grep" on Github.

it would only really make sense to have one big index, and to narrow the search to particular project in that index. This of course has the benefit that you can move out to the whole index if you want.

You could then offer code search across the whole index (minus any project marked private that you are not a part of) as a paid offering.

Re: Towards Natural Language Semantic Code Search at GitHub

#46
post #16

Earlier quoted context omitted.

Agreed. Luckily, we as a community have tools like Sourcegraph which are based on battle-tested pragmatic systems from places like Google. Disclaimer: no affiliation, just love the team and product.

Damn, Sourcegraph is very close to something I've been thinking of building.

Join us! We are hiring and growing quickly.

Re: Towards Natural Language Semantic Code Search at GitHub

#48

It is a real cultural problem how engineers get more excited about machine learning than basic usability. GitHub search can't even search for a literal string, let alone a regex. It can't search a subdirectory. Ranking is indistinguishable from random. It's been this way for years. How about building an actual, usable, basic code search and then getting all fancy with your machine learning? I almost built my own "onl…

Could not agree more. Everyone who works for or have worked for Google in the last years knows that an excellent code search does not have to be fancy.

Re: Towards Natural Language Semantic Code Search at GitHub

#49
post #36

Earlier quoted context omitted.

Nobody is asking for cross-repo search. Literally just let us run "git grep" on Github.

On your local machine, you can get away with a linear scan (as "git grep" does), because nothing else is contending for time with your search. "git grep" is actually very costly in terms of CPU and disk IO, but you don't notice, because you're only running one "git grep" at once, and so nothing is contending for those resources. On GitHub, tens of thousands of searches will be happening at once on the same search clu…

When I press "download" on GitHub, it also does a linear scan ...

Re: Towards Natural Language Semantic Code Search at GitHub

#50
Devs don't search code repositories using natural language queries, and any scenarios of searching for code examples that way are already extremely well handled by StackOverflow and Google.

This is an incredible waste of time and resources that could be spent making the existing search far better with very minor tweaks. A perfect example of big company project management where nobody seems to know what their users actually want.

Post reply on HN