meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
noprompt 2020-02-14T06:16:35.237800Z

In consideration of the many suggestions to have a way to do aggregation, zeta will introduce an operator just for this that will work with mutable variables *m which currently have little value. Right now this operator is called fold but may end up having a different name. fold has the signature

(fold *mutable-variable <initial-value> <reducing-fn>)
Here’s an example based on a problem someone shared today:
(rewrite [{:time 2} {:time 1} {:time 3} {:time 0}]
  (mz/with [%max-time (mz/fold *max-time 0 max)
            %min-time (mz/fold *min-time 0 min)]
    [{:time (mz/and %max-time %min-time)} ...])
  {:max-time *max-time
   :min-time *min-time})
;; =>
{:max-time 3
 :min-time 0}

noprompt 2020-02-14T06:19:21.240200Z

fold can also be on the right side of rewrite rules which means “unfold” and an unfold function can be registered for this purpose. For example, the unfold of min and max are dec and inc respectively starting from the initial-value or bound value of the mutable variable.

noprompt 2020-02-14T06:25:29.241800Z

I may have mentioned it previously but you’ll also be able to generate data from patterns as well:

((gen [[:id (mz/fold *id 100 max)]
       [:status (mz/or "pending" "delivered")] ...]) {})
;; =>
([]
 [[:id 101] [:status "pending"]]
 [[:id 101] [:status "pending"]
  [:id 102] [:status "pending"]]
 [[:id 101] [:status "delivered"]]
 [[:id 101] [:status "pending"]
  [:id 102] [:status "pending"]
  [:id 103] [:status "pending"]]
 ,,,)
(Ignore the details for now.) 🙂

noprompt 2020-02-14T06:28:16.244100Z

I may have also mentioned that the quality of the new runtime and code generator is much better than of any previous version of the library. The core parts of the parser and compiler are being written with epsilon and compiled to Clojure code which uses the new runtime. At some point it’ll break with epsilon entirely and zeta will bootstrap itself.

noprompt 2020-02-14T06:30:46.245400Z

At the current rate of progress I estimate — but won’t promise — a stable release of zeta some time in June or July.

noprompt 2020-02-14T06:33:26.247300Z

If I get to a point of confidence with the runtime code, I think I can also make a “programmable” API available. Of course, it won’t be as fast as the macro flavor but the option will be available (hopefully).