HNHacker News
TopNewBestAskShowJobs

100k

3,186 karma · joined July 11, 2008

Was co-founder of FanChatter (YC S09), then an independent consultant, then first employee at Swiftype (YC W12). Currently working at GitHub on code search.

Minneapolitan in exile. My blog is http://recursion.org.

I usually go by "look" online but that was taken at HN when I registered.

submissionscomments
100k··on Loss of Mid in English: Free Peasantry and Their Linguistic Advantage
If this interests you, I recommend The History of English podcast. The episodes on Old English cover similar linguistic evolution that happened due the influence of Old Norse.

https://historyofenglishpodcast.com/

100k··on The Bathyscaph Trieste: Technological and Operational Aspects (1962)
Wikipedia: "After passing 9,000 metres (30,000 ft), one of the outer Plexiglas window panes cracked, shaking the entire vessel."

If anyone else is curious about why the cracked window didn't cause an implosion, I found the answer in an interview: it was a plexiglass window on the entrance tunnel, not the viewport that was part of the sphere.

"A Plexiglas window in the flooded entrance tunnel had cracked under the pressure. But Walsh and Piccard were safe inside their cabin, separated from the tunnel by a thick steel hatch."

https://spectrum.ieee.org/don-walsh-describes-the-trip-to-th...

100k··on The Bathyscaph Trieste: Technological and Operational Aspects (1962)
SpaceX deliberately decided not to use a flame diverter for that launch site, which is a few hundred feet from an endangered bird nesting area. It's clear they could have done more to avoid damage to nearby wildlife and property and it's a travesty that they were given a permit to launch without using standard practices.
100k··on Platinum Photography
Absolutely. There are regular darkroom classes you can sign up for. It's kind of hard to get a spot because the classes are small but my teacher said people also have learned how on YouTube and then come in to practice.
100k··on Platinum Photography
San Francisco has the Harvey Milk Photo Center, which has a huge dark room and film processing facilities. It's pretty awesome. I've taken several classes there. https://www.harveymilkphotocenter.org/
100k··on Neanderthal Flute
Amazing, hearing it played sends chills down my spine.

It's not as old, but in Wernor Herzog's documentary "Cave of Forgotten Dreams", an archeologist plays a 30,000 year old vulture bone flute. It even uses the pentatonic scale!

Some links about it:

https://www.youtube.com/watch?v=yUCBBDV2Tzk https://www.ethanhein.com/wp/2011/flute-of-forgotten-dreams/ https://www.npr.org/2009/06/24/105823127/a-little-flute-musi...

100k··on GitHub code search is generally available
We want to do it right if we do implement it, but I can't promise anything concretely. It's not trivial, unfortunately.
100k··on GitHub code search is generally available
Thanks for your patience! It has been a long road with some dead ends (we've wanted to add this since 2012 at least). We actually wrote about why we didn't just use grep in our last blog post: https://github.blog/2023-02-06-the-technology-behind-githubs...
100k··on GitHub code search is generally available
(I work on code search.) Yeah, sorry about that. We've heard this feedback a lot. There's two reasons why we haven't implemented this. First, content is shared between repositories which makes this harder than before, when it wasn't. Second, we rebuild the index weekly or even more frequently, so the proxy of "when was this added" that was used doesn't work any more. What we would like to use is "when was this blob added to this branch" but that's extremely expensive to retrieve from Git because Git trees don't record it.
100k··on VecLucene: Vector Search on Top of Lucene
Since Lucene already supports ANN vector search, I am curious how this project is different than what's in core.
100k··on Revisiting Vernor Vinge’s “predictions” for 2025
I read this novel and didn't really care for it much. I thought the idea of completing massive projects with the fractional attention of tens of thousands of people was hard to take. Coordination costs and context switching are a large overhead for that type of thing, and the novel doesn't address that at all.
100k··on Grep.app – Search across a half million Git repos
Hi, I work on GitHub code search. Grep.app is based on Solr and indexes about 500,000 public repositories. As far as I know, the author has not shared their tokenization strategy, but based on the the results I expect they are indexing trigrams to perform regular expression matching.

The current GitHub code search is based on Elasticsearch and indexes more than 100M repositories. Its tokenization is based on whitespace, case changes (like CamelCase) and punctuation (like kebab-case) and strips out non-letter characters like < or { which is why it can't do exact match search.

Our new code search, currently in beta and indexing about 45 million repositories, uses an search engine we built in house that indexes content using a technique we call sparse ngrams. This allows us to execute searches faster than a trigrams index, while also being smaller than a positional trigram index. My teammate discussed some of the technology behind it in our blog post that was published yesterday: https://github.blog/2023-02-06-the-technology-behind-githubs...

100k··on The technology behind GitHub’s new code search
(I edited this post.) Maybe that could have been worded more clearly... What we mean is repositories with atypical activity patterns, for example a busy monorepo with lots of files and continuous pushes. If we sharded by repository, a single shard would be responsible for processing all the updated documents for this busy repository.
100k··on The technology behind GitHub’s new code search
Yes. You can also use regular expressions to limit your search. Details: https://docs.github.com/en/search-github/github-code-search/...
100k··on The technology behind GitHub’s new code search
How do you think Algolia shards their data given that architecture?

My guess is that Algolia's indices are sharded by customer and each cluster probably has multiple customer indices.

do you keep a copy of the index document form of repos or is that done on the fly during indexing?

As mentioned in the post, the index contains the full content. Our ingest process essentially flattens git repos (which are stored as DAGs) into a list of documents to index (the prior state is diffed for changes).

Is your custom index format a binary format? I have no idea whether that's standard practice, or just a compressed text format is enough. I guess that non-binary formats would be enormous though, and given that an index is by definition relatively unique it probably wouldn't compress that well.

Binary formats are normal, posting lists are giant sorted blocks of numbers, so there are a lot of techniques that can be used to compress them. Lucene's index format is pretty well documented if you're interested in learning more (interestingly, Lucene has a text format for debugging: https://lucene.apache.org/core/8_6_3/codecs/org/apache/lucen...).

Scale up in terms of what? Is the current system not indexing all of GitHub, or you mean you want to index on more things (E.g. commits, PRs, etc)?

It's not indexing all of GitHub yet, nor do all users have access yet. Those are the things we are focusing on now. In the future, we want to support indexing branches.

100k··on The technology behind GitHub’s new code search
Sorry, there are size limits on the number of files in a repositories that we'll index. That is probably why your repository wasn't indexed. Out of curiosity, what are you storing in this repository?
100k··on The technology behind GitHub’s new code search
(I work on this.)

If you check out our prior blog post, "A brief history of code search at GitHub" (https://github.blog/2021-12-15-a-brief-history-of-code-searc...), you can learn a bit about the evolution of this feature. And, in fact, we used to use git grep to search repositories.

This doesn't work well at GitHub's scale. We have 100M users and over 200M repositories in a multi-tenant environment. Your git grep is going to be competing for resources with other user's pushes and clones.

100k··on The technology behind GitHub’s new code search
Thanks! I enjoyed reading your blog posts about building your code search engine. One minor point of clarification, we do not use a positional ngram index, which as you note blows up the index size. Instead, we use the covering sparse ngrams to produce candidate documents and then search the content.

An early version of Blackbird experimented with trigrams plus a bitmask of the next character, but it didn't work well because it wasn't selective enough. This is mentioned in the blog post:

We tried a number of strategies to fix this like adding follow masks, which use bitmasks for the character following the trigram (basically halfway to quad grams), but they saturate too quickly to be useful.

100k··on The technology behind GitHub’s new code search
I agree! Search is so cool.

It's interesting that GitHub seems to have quite a few shards. Algolia basically has a monolithic architecture with 3 different hosts

I used to work at an Algolia competitor. I don't know for sure, but my guess is that Algolia shards their indices by customer. Algolia does not provide global search. GitHub code search does. That, and the desire to deduplicate data, is what led us to our current sharding strategy (notably, it is different than the old GitHub code search's sharding.).

I'm guessing GitHub probably doesn't store repos in a custom binary format like Algolia does though:

We have a custom index format, so I would say this is the same, unless you mean something different. We of course translate repos from their Git form to our index document form for indexing.

I'm curious why they chose to optimize ingestion when it only took 36hrs to re-index the entire corpus without optimizations. A 50% speedup is nice, but 36hrs and 18hrs are the same order of magnitude and it sounds like there was a fair amount of engineering effort put into this. An index 1/5 of the size is pretty sweet though, I have to assume that's a bigger win that 50% faster ingestion.

The index size is a bigger win, but being able to reindex quickly is huge for our development velocity and trying things out. We really feel it when things are slow. This is also not our final goal, we want to scale the system up considerably.

100k··on The technology behind GitHub’s new code search
We hope to share more on this soon!
100k··on The technology behind GitHub’s new code search
You are correct, as I mentioned, we do not analyze symbols for C and C++ at this time.
100k··on The technology behind GitHub’s new code search
Have you tried the new search? Thanks to the variable length ngram indexing mentioned in the post, it can handle all of those cases. Sign up here to try it: https://github.com/features/code-search

Symbol extraction for C and C++ is currently disabled because we were having problems with the performance of the tree-sitter queries we were using, but we are planning to bring that back.

100k··on The technology behind GitHub’s new code search
You can try it right now in our beta. Right now, we are onboarding all signups daily. Sign up here: https://github.com/features/code-search

Obvious disclaimer because I work on this (and I also worked on the legacy search): It is way better.

100k··on The technology behind GitHub’s new code search
Thanks for the feedback! That's coming, we've been prioritizing scaling the index and ingest process and haven't had a chance got add that yet. There are a bunch of value-add features like this I am looking forward to knocking out soon.
100k··on Ask HN: What sub $200 product improved your 2022
I also upgraded to a split keyboard and I love it. I really liked the Microsoft Natural keyboard, but slamming my mouse into the number pad was driving me crazy, so I decided to get a split keyboard without one. I have the Kinesis Freestyle Pro. As a bonus the mechanical keys are nice to type on! My only complaint is it takes a moment to get it dialed in for placement if it's been moved.
100k··on Ask HN: Books about full text search?
At a general audience level, "Index" is on my list to read. It covers the invention of the index up to digital search engines. https://www.nytimes.com/2022/02/09/books/review-index-histor...

"Introduction to Information Retrieval" is a textbook which is available online https://nlp.stanford.edu/IR-book/ Here's a review: http://glinden.blogspot.com/2009/02/book-review-introduction...

Another textbook which IMHO is a bit lower level is "Information Retrieval: Implementing and Evaluating Search Engines". The book website is down for me right now, but you can find it on Amazon here: https://www.amazon.com/Information-Retrieval-Implementing-Ev...

Another commenter linked to "Relevant Search", which is great if you want to learn how to effectively use a search engine to improve relevance (as opposed to how to implement a search engine). It's old, but another book in that vein that was really helpful for me earlier in my career is Lucene in Action: https://www.amazon.com/Lucene-Action-Second-Covers-Apache/dp...

100k··on GitHub is replacing Rails front end rendering with React
(I worked on the backend for this, not the frontend.)

Yes, the new code search and navigation experience is powered by React for the frontend. We decided to use that because we wanted to build a stateful, rich navigation experience.

If you want to try it, please sign up for our beta https://github.com/features/code-search (we have been clearing the waitlist daily.)

100k··on GitHub code search – waiting list signup
Yes, Stack Graphs power code navigation for supported languages (currently, Python). We also use tree-sitter parsers for CTags-style symbol navigation.
100k··on GitHub code search – waiting list signup
This is addressed in the FAQ. It will be included with GitHub, just like the current code search.
100k··on GitHub code search – waiting list signup
No, it is a custom-built search engine for code. grep.app is great, though.
← PreviousPage 2 of 22Next →