zen-lang / zen

Library for model driven systems
116 stars 12 forks source link

`zen/schema` traversing #38

Open KGOH opened 2 years ago

KGOH commented 2 years ago

Validation implements zen/schema traversing. There are more applications that need to traverse zen/schema besides validation

They can be split in 3 categories. With data and without.

With data -- use cases alternative to validation. We need to compile schema into a function and apply compiled function to a data:

We also may want to transform data:

Without data -- we need to compile the whole schema into something else:

Some may be done in either way:

If we want to implement any of above, then we need to reimplement all traversing for all zen/schema syntax available and then keep updating this implementation with support of new features that may be introduced into zen/schema that may alter traversing.

I suggest that we need to come up with separate namespace with sole purpose of traversing, which then will be used in zen.v2-validation and in other features we want to implement.

Current zen.walk just uses validation

Severity: high (we need to describe transformations)

KGOH commented 1 year ago
    ;; with update cold
    ;; "Elapsed time: 12.151666 msecs"
    ;; with update warm
    ;; "Elapsed time: 2.454166 msecs"

    ;; without update cold
    ;; "Elapsed time: 18.907042 msecs"
    ;; without update warm
    ;; "Elapsed time: 6.38625 msecs"

    ;; x5000 with update + warm
    ;; "Elapsed time: 2707.391292 msecs"
    ;; x5000 without update + warm
    ;; "Elapsed time: 1868.867417 msecs"