agentm / project-m36

Project: M36 Relational Algebra Engine
The Unlicense
876 stars 47 forks source link

Pull query AST into separate library #141

Open 3noch opened 6 years ago

3noch commented 6 years ago

I just realized that with very little work I could have my GHCJS front-end build up Project:M36 queries directly. It could then send them to a websocket on my server and get the results directly. All the serialization/deserialization would be done automatically. I know Project:M36 already has a websocket server, but this would allow me to do 2 key things:

  1. Generate the AST on the client directly.
  2. Rely on my application's authentication (which happens via JWT in a header).

However, GHCJS can't currently build Project:M36 because it has so many heavy server-side dependencies. If the AST types were in a separate library, I could share them between the back end and the front end.

agentm commented 6 years ago

Indeed, some sort of GHCJS integration would likely be beneficial. It could even be possible to build the entire relational algebra engine in GHCJS (without persistence, of course).

However, for broad appeal, I chose to make a simple JS library. I was thinking that the JS library could be improved to allow the user to build up a JS-style ADT, in the short-term at least.

3noch commented 6 years ago

Having the JS library is certainly valuable. I'm only advocating for yet another option, GHCJS.