Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A dynamic page accepting queries #9

Open
jpellegrini opened this issue Aug 21, 2020 · 10 comments
Open

A dynamic page accepting queries #9

jpellegrini opened this issue Aug 21, 2020 · 10 comments

Comments

@jpellegrini
Copy link
Contributor

jpellegrini commented Aug 21, 2020

Well... It may be quite some work to do, but a dynamic page that lets you enter queries would be nice.

(srfi :implementations gauche guile stklos
      :keyword syntax  ;; the keywords used in srfi.schemers.org
      :status final
      :order-by quantity-implementations)

would return the SRFIs matching the criteria, ordered by the number of implementations (SRFIs with more totalimplementations - not only those three -- show up on the top). order-by could also be sequential, or keyword.

(implementation :srfi 2 13 64
                :order-by quantity)

would return implementations with those SRFIs, ordered by number of supported SRFIs.

:order-by could accept stable-age (age of last stable release); quantity (or total supported SRFIs, not only those in the query); alphabetical; implementation-age (time since first release ever).

Maybe other data, if possible. If the implementation has a github repository, one could also order by "team size", "commit frequency", "total commit volume in last 12 months", "source code size"...

And... This could actually be a library, loadable from Scheme implementations (hence the Schemish syntax proposed).

Does this make sense,or did my coffee not make effect yet?

@lassik
Copy link
Member

lassik commented Aug 21, 2020

It makes a lot of sense. We talked about this a lot last year, and it would make sense to have api.scheme.org which provides a GraphQL endpoint for arbitrary queries about Scheme stuff. GraphQL has already solved all these problems about constructing queries, is widely used and remarkably elegant for web technology. We could add an alternative S-expression syntax for GQL (it gives JSON output by default, and uses a query language that looks a lot like JSON).

Here's what we have so far: https://api.staging.scheme.org/

If you follow the "GraphQL endpoint" link, it takes you to a playground where you can type stuff like this:

{
  reports {
    id
    documents {
      id
      errata_corrected_pdf_url
    }
  }
}

Ctrl+space for autocomplete.

@lassik
Copy link
Member

lassik commented Aug 21, 2020

Here's a WIP GraphQL server in Chicken: https://github.com/lassik/graphql-chicken

@lassik
Copy link
Member

lassik commented Aug 21, 2020

One reason I've been trying to encourage having automated scripts to gather information into S-expression files in schemedoc, is that those scripts and S-expressions would be easy to plug into the API server once it is functional.

@jpellegrini
Copy link
Contributor Author

So this issue would then stay and wait for that?

@lassik
Copy link
Member

lassik commented Aug 21, 2020

Sounds good.

We could also make a separate API just for SRFIs. But it seems it would be just as easy to do one API for everything.

The server running at that staging host is a proof of concept in Node.js. I can add a quick SRFI listing to it based on this repo and srfi-data.scm if you want to play with some queries.

@lassik
Copy link
Member

lassik commented Aug 21, 2020

@jpellegrini Are you personally interested in writing code like this? The API doesn't have to be just my project; I'll gladly share the workload with others.

We have server space and lots of ideas and connections. The main missing ingredient is time and energy to do everything :)

@jpellegrini
Copy link
Contributor Author

Hi @lassik - I woud like to, but I think I am already involved in too many things (STklos, Geiser-STklos, translation of darktable, a math book and some personal coding projects). I may take a look and contribute slowly if that's ok.

@lassik
Copy link
Member

lassik commented Aug 21, 2020

I understand :) I have the same problem... By all means, it is perfectly ok.

@erkin
Copy link
Member

erkin commented Nov 6, 2020

We can, alternatively, generate JS code from, say, BiwaScheme to filter the table on the front-end. Just an idea.

@lassik
Copy link
Member

lassik commented Nov 11, 2020

Or concede to use a couple lines of ordinary JS if it's just a simple filter :) The SRFI website uses a little JS for that purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants