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

zen/schema traversing #38

Open
KGOH opened this issue Oct 13, 2022 · 1 comment
Open

zen/schema traversing #38

KGOH opened this issue Oct 13, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@KGOH
Copy link
Contributor

KGOH commented Oct 13, 2022

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:

  • Semantic diff (data is some DSL expression, compiled schema is DSL definition)
  • Breaking changes analysis
  • Generate :text property for some resource

We also may want to transform data:

  • Enriching data by setting default values
  • Fixing data by type coercing (e.g.: replace arrays with sets if schema says so)

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

  • Generating type/object schema for programming languages (e.g.: typescript)
  • Generating snapshot schema (super-schema, with symbol definitions inlined in-place of symbols)
  • Generating zen/schema viewer & generative documentation
  • Generative test data based on a schema

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 KGOH added enhancement New feature or request help wanted Extra attention is needed labels Oct 13, 2022
KGOH added a commit that referenced this issue Jan 20, 2023
Will contain zen.schema abstract interpreter, currently it is just a part of v2-validation extracted

Co-authored-by: @islambegkatibov <79331750+islambegk@users.noreply.github.com>
KGOH added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @islambegkatibov <79331750+islambegk@users.noreply.github.com>
KGOH added a commit that referenced this issue Jan 20, 2023
…heck

Co-authored-by: @islambegkatibov <79331750+islambegk@users.noreply.github.com>
KGOH added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @islambegkatibov <79331750+islambegk@users.noreply.github.com>
KGOH added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @islambegkatibov <79331750+islambegk@users.noreply.github.com>
KGOH added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @islambegkatibov <79331750+islambegk@users.noreply.github.com>
KGOH added a commit that referenced this issue Jan 20, 2023
KGOH added a commit that referenced this issue Jan 20, 2023
KGOH added a commit that referenced this issue Jan 20, 2023
@KGOH KGOH self-assigned this Jan 20, 2023
KGOH added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @islambegkatibov <79331750+islambegk@users.noreply.github.com>
Co-authored-by: kenichsberg <kn1017356@gmail.com>
Co-authored-by: IvannikovG <ivannikogeorge1337@gmail.com>
KGOH added a commit that referenced this issue Jan 20, 2023
KGOH added a commit that referenced this issue Jan 20, 2023
KGOH added a commit that referenced this issue Jan 20, 2023
KGOH added a commit that referenced this issue Jan 20, 2023
Co-authored-by: kenichsberg <kn1017356@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
Co-authored-by: @rublag_hs <rublag-ns@yandex.ru>
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
Co-authored-by: @rublag_hs <rublag-ns@yandex.ru>
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
Co-authored-by: @rublag_hs <rublag-ns@yandex.ru>
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
Co-authored-by: @rublag_hs <rublag-ns@yandex.ru>
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
Co-authored-by: @rublag_hs <rublag-ns@yandex.ru>
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
Co-authored-by: @rublag_hs <rublag-ns@yandex.ru>
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
Co-authored-by: @rublag_hs <rublag-ns@yandex.ru>
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
katibov added a commit that referenced this issue Jan 20, 2023
Co-authored-by: KGOH <kgofhedgehogs@gmail.com>
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
Co-authored-by: @rublag_hs <rublag-ns@yandex.ru>
Co-authored-by: @kenichsberg <kn1017356@gmail.com>
Co-authored-by: @IvannikovG <ivannikogeorge1337@gmail.com>
@KGOH
Copy link
Contributor Author

KGOH commented Jan 22, 2023

    ;; 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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant