Ada Code Search page needs some context

The “code Search” link from the main page:
https://search.ada-lang.io/
Is lacking any explanation on its page.

What code is it searching?

I can see from results that it is Ada code from projects such as SDLAda and GTKAda. But are those from some repo or a “special” list (Awesome-Ada) of projects? What set of projects are included?

I suspect this maybe searching Alire’s crates. But this is left to the imagination of the user.

With no information, a new user might assume they are searching through all public Ada code in existence. (Unlikely)

So, some info on that page would be helpful to users who don’t already know.

I think that page is maintained by @JeremyGrosser (sorry for pinging if incorrect).

Based on the URLs of all the results, it looks like it searches alire crates, but only a guess on my part.

It searches a snapshot of all .ads and .adb files in Alire crates.

Honestly, this search function is mostly just a proof of concept. I haven’t had much time or desire to improve it. If someone else wants to build a better code search, you have my blessing.

I wonder if people would find useful to have adasearch as the frontend to different search engines (including search.ada-lang.io) here in ada-lang.io
Search for Ada/SPARK on the Web

I don’t mind transferring ownership to the ada-lang-io organization on GitHub, since I don’t plan to implement more improvements for it.

Is it on a public repository where people can send pull request and suggest enhancements?

No, and I don’t think it should be. It’s just a couple of very hacky Python scripts and a SQLite database. Any reasonable set of patches would effectively be a rewrite anyway.

I did a rewrite in Ada last year. It does work, but I’m not satisfied with the result and never deployed it to the live site.

I think a better approach would be to use the new libadalang based gnatdoc to generate html docs for every crate, then index those pages using a more modern system like Elasticsearch.

That looks very useful. I’ve bookmarked it for later. Thanks.

If you want to put that out there, I’m sure you could get some help making it better.

If you are going to do that, might as well post those html docs on the site so people could browse them as well as search.


In the mean time, it would be good to put a blurb on the page that says something like:
Beta Test Version
Search Alire Crates (Cashed on <date>).

Ok, I’m open sourcing it, but I’m kinda grumpy about it.

I really don’t want to hear a bunch of “Why did you do X?” and “You should just…” comments. I don’t want feedback, I want well reasoned patches. If people can’t be nice about it, I’ll take my ball and go home.

I reserve the right to refuse to merge any patches I don’t like.

I’ve put the AGPLv3 license on it, which is on the extreme end of the copyleft specrum. I generally prefer more liberal licensing, but in this case I really want to see contributions rather than just giving it all away. I might be convinced to change the licensing later.

5 Likes

I have written plenty of horrible code that I would be embarrassed to show anyone. I wouldn’t want anyone to think such code represents my standards or skills. So, I understand your sentiment.

(This is not a comment on your code. I have not yet looked at the code.)


I hope you didn’t feel pushed into it. I did not intend to presser you.
But thank you for trusting us with something you are embarrassed about.