This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-25
Channels
- # announcements (1)
- # architecture (3)
- # beginners (31)
- # calva (61)
- # cider (1)
- # clojure (43)
- # clojure-dev (17)
- # clojure-europe (85)
- # clojure-uk (8)
- # clojurescript (31)
- # cryogen (2)
- # cursive (7)
- # data-science (12)
- # datalog (1)
- # datomic (4)
- # defnpodcast (1)
- # figwheel-main (11)
- # fulcro (32)
- # hoplon (1)
- # leiningen (1)
- # malli (47)
- # pedestal (1)
- # rdf (2)
- # re-frame (11)
- # reagent (4)
- # reitit (7)
- # shadow-cljs (22)
- # vrac (8)
- # xtdb (2)
I recently rewrote my slides on http://pitch.com https://app.pitch.com/app/presentation/a760be33-4a5b-4e73-bd25-07387cd197dc/d673c9f7-c98f-45eb-a6ff-668b42909f1c
Lately, I took a break away from the project, now I am back at it.
Today I am working on modeling a query language which will be used between the Vrac clients and the Vrac servers.
I will call it VracQL (VQL in short), it naturally stands for Vrac’s Query Language
I finished to decide for the format:
; EQL
'{session [:session/title
:session/description
{:session/speakers [:speaker/name
:speaker/bio]}]}
; VQL
'[(:session/title session)
(:session/description session)
(for [speakers (:session/speakers session)]
[(:speaker/name speakers)
(:speaker/bio speakers)])]
;; VQL - same semantic as above
'(let [{:session/keys [title description speakers]} session]
[title
session
(for [{:speaker/keys [name bio]} speakers]
[name
bio])])
; Returns values similarly to Clojure
["session title"
"session description"
[["name1"
"bio1"]
["name2"
"bio2"]]]
VracQL can include a directed graph of data computations, similarly to the Vrac templates.
; VQL - computed data
'[(- (:admin.money/spent global)
(:admin.money/earned global))
(count (:admin/users global))]
; VQL - let with computed data
'(let [{:admin/keys [users]
:admin.money/keys [earning spending]} global
benefit (- earning spending)
nb-users (count users)]
[benefit
nb-users
(/ benefit nb-users)])
VracQL is more verbose than EQL, but I like the fact that users won’t have to remember one more DSL syntax, as it is a subset of Clojure.
I pushed my VQL wip code at https://github.com/green-coder/vrac/blob/vracql/src/vrac/model/vql.cljc I am considering adding support for recursion in VQL later. Any suggestion about the syntax is welcome.