News for hackers. Stuff that matters.
Re:Ask HN: What interesting problems are you working on? by boyter on Tuesday January 28, 2020 @07:05PM (#22175631)
Interesting to me, your mileage may vary.

Working in my spare time on a command line terminal UI application that searches over source code and ranks the results.

It came about from watching a work college constantly opening VSCode when trying to find things in a codebase. I mentioned he should use ripgrep/silver searcher which he tried, but said he preferred to get more context and wanted ranked results. The context was possible using -A and -B but he didn't want that.

I had always wanted to make a terminal application and it seemed like an interesting problem to solve. I had also always wanted to implement BM25/TFIDF ranking algorithms myself and I was curious to see how well this could be done without pre-flighting and building an index.

Still a work in progress https://github.com/boyter/cs but coming along. Its usable now (with bugs) and is being used by my work mate.

Re:Ask HN: What interesting problems are you working on? by galacticdessert on Wednesday January 29, 2020 @08:28AM (#22180199)
Hey! Looks cool, I tried compiling it on Windows (at work ATM, hehe) but so far it does not seem to find any files. If I start it in a folder, the search always says 0 in 0 files.

Is windows a supported platform?

Re:Ask HN: What interesting problems are you working on? by boyter on Wednesday January 29, 2020 @02:21PM (#22184722)
Yes it is, or should be. I’d need more details to really work it out for your case. I will have a look at potential issues in the next few hours.

EDIT I tried and no issues on Windows. I would need more details to investigate. Please raise the issue on github and I will investigate.

Re:Ask HN: What interesting problems are you working on? by chinmays on Friday January 31, 2020 @03:15PM (#22205170)
Looks promising and definitely that can have a huge commercial value. I'm curious about how you establish context for code-search? Also, how do you decide on how to rank the result based on a single string?
Re:Ask HN: What interesting problems are you working on? by juancampa on Tuesday January 28, 2020 @10:00PM (#22176849)
Looks useful. Would it be fast in huge codebases?
Re:Ask HN: What interesting problems are you working on? by boyter on Tuesday January 28, 2020 @10:20PM (#22177000)
Yes and no. The interactive version appears to be because it displays results as it goes. However for pure command line, it will be fast but not comparable to ripgrep/grep/silver server or others.

I want it fast, but absolute performance is not a goal as its a trade off with any ranking algorithm. Not really the same sort of tool.

Anyway here is a search over my projects directory which is about 5.7 GB of content https://github.com/boyter/cs/blob/master/large-search.gif

Feel free to try it out if you are able to build from source. It certainly has some bugs in there over large codebases in the UI which I am aware of but does work generally.

Re:Ask HN: What interesting problems are you working on? by stefco_ on Tuesday January 28, 2020 @10:54PM (#22177232)
This is super cool! Could see myself using this when I'm feeling foggy-brained and want to bash keys until something useful comes up. But I also just love how it looks; nice interactive TUI apps are always a pleasure to use. Good luck getting it stable!
Re:Ask HN: What interesting problems are you working on? by boyter on Wednesday January 29, 2020 @12:13AM (#22177659)
Thank you. It is rather nice to use. The instant feedback is fantastic for code spelunking in my opinion.

The tui is indeed the sticking point and the thing people like the most. I had planned on sticking an embedded HTML page in there as well but that might be a bit much for a first version.