json-model-compiler 2.0.54__tar.gz → 2.0.56__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/API.md +15 -2
  2. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/BACKLOG.md +19 -20
  3. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/BENCH.md +30 -19
  4. {json_model_compiler-2.0.54/json_model_compiler.egg-info → json_model_compiler-2.0.56}/PKG-INFO +1 -1
  5. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/PUBS.md +6 -12
  6. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/VERSION.md +27 -3
  7. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/about.sh +9 -3
  8. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/__init__.py +2 -0
  9. json_model_compiler-2.0.56/json_model/data/VERSION +1 -0
  10. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/jmc.pod +10 -0
  11. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/irep.py +17 -7
  12. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/language.py +4 -0
  13. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/predefs.py +1 -1
  14. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/c/json-model.c +6 -4
  15. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/script.py +150 -55
  16. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/utils.py +3 -1
  17. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/xstatic.py +131 -47
  18. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56/json_model_compiler.egg-info}/PKG-INFO +1 -1
  19. json_model_compiler-2.0.54/json_model/data/VERSION +0 -1
  20. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/.github/workflows/sanity.yml +0 -0
  21. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/.gitignore +0 -0
  22. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/.gitmodules +0 -0
  23. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/DESIGN.md +0 -0
  24. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/DEV.md +0 -0
  25. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/DOC.md +0 -0
  26. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/HOWTO.md +0 -0
  27. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/INTEGRATION.md +0 -0
  28. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/MANIFEST.in +0 -0
  29. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/Makefile +0 -0
  30. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/README.md +0 -0
  31. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/SPEC.md +0 -0
  32. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/TUTO.md +0 -0
  33. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/README.md +0 -0
  34. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/analyze.py +0 -0
  35. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/clang.py +0 -0
  36. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/convert.py +0 -0
  37. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/clang_entry.c +0 -0
  38. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/clang_free.c +0 -0
  39. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/clang_init.c +0 -0
  40. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/clang_pcre2_fun.c +0 -0
  41. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/clang_re2_fun.c +0 -0
  42. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/java_free.java +0 -0
  43. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/java_init.java +0 -0
  44. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/javascript_exe.js +0 -0
  45. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/javascript_foot.js +0 -0
  46. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/javascript_free.js +0 -0
  47. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/javascript_head.js +0 -0
  48. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/javascript_init.js +0 -0
  49. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/javascript_main.js +0 -0
  50. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/perl_entry.pl +0 -0
  51. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/perl_exe.pl +0 -0
  52. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/perl_free.pl +0 -0
  53. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/perl_init.pl +0 -0
  54. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/perl_main.pl +0 -0
  55. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/perl_pkg.pl +0 -0
  56. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/plpgsql_entry.sql +0 -0
  57. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/python_entry.py +0 -0
  58. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/python_exe.py +0 -0
  59. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/python_free.py +0 -0
  60. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/python_init.py +0 -0
  61. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/data/python_main.py +0 -0
  62. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/export.py +0 -0
  63. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/java.py +0 -0
  64. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/javascript.py +0 -0
  65. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/model.py +0 -0
  66. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/mtypes.py +0 -0
  67. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/objops.py +0 -0
  68. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/optim.py +0 -0
  69. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/perl.py +0 -0
  70. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/plpgsql.py +0 -0
  71. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/python.py +0 -0
  72. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/recurse.py +0 -0
  73. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/regex.py +0 -0
  74. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/resolver.py +0 -0
  75. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/Makefile +0 -0
  76. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/__init__.py +0 -0
  77. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/c/Makefile +0 -0
  78. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/c/json-model.h +0 -0
  79. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/c/main.c +0 -0
  80. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/.gitignore +0 -0
  81. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/Makefile +0 -0
  82. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/README.md +0 -0
  83. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/env.sh +0 -0
  84. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/Checker.java +0 -0
  85. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/GSON.java +0 -0
  86. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/JSON.java +0 -0
  87. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/JSONP.java +0 -0
  88. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/Jackson.java +0 -0
  89. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/Main.java +0 -0
  90. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/ModelChecker.java +0 -0
  91. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/Path.java +0 -0
  92. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/Report.java +0 -0
  93. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/json_model/Runtime.java +0 -0
  94. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/java/pom.xml +0 -0
  95. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/js/README.md +0 -0
  96. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/js/index.js +0 -0
  97. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/js/main.js +0 -0
  98. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/js/package.json +0 -0
  99. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/.gitignore +0 -0
  100. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/Changes +0 -0
  101. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/LICENSE +0 -0
  102. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/MANIFEST +0 -0
  103. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/Makefile.PL +0 -0
  104. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/README +0 -0
  105. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/env.sh +0 -0
  106. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/ignore.txt +0 -0
  107. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/lib/JSON/JsonModel.pm +0 -0
  108. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/t/00-load.t +0 -0
  109. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/t/manifest.t +0 -0
  110. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/t/pod-coverage.t +0 -0
  111. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/t/pod.t +0 -0
  112. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/pl/xt/boilerplate.t +0 -0
  113. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/sql/META.json +0 -0
  114. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/sql/Makefile +0 -0
  115. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/sql/json_model--2.0.sql +0 -0
  116. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/sql/json_model.control +0 -0
  117. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/support.py +0 -0
  118. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/runtime/types.py +0 -0
  119. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/submodel.py +0 -0
  120. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/ts_export.py +0 -0
  121. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model/url_cache.py +0 -0
  122. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model_compiler.egg-info/SOURCES.txt +0 -0
  123. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model_compiler.egg-info/dependency_links.txt +0 -0
  124. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model_compiler.egg-info/entry_points.txt +0 -0
  125. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model_compiler.egg-info/not-zip-safe +0 -0
  126. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model_compiler.egg-info/requires.txt +0 -0
  127. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/json_model_compiler.egg-info/top_level.txt +0 -0
  128. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/package.json +0 -0
  129. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/pyproject.toml +0 -0
  130. {json_model_compiler-2.0.54 → json_model_compiler-2.0.56}/setup.cfg +0 -0
@@ -74,7 +74,7 @@ person.check_model_free()
74
74
  As the JSON Model compiler is written in Python, it can be invoked directly for generating
75
75
  a validation function.
76
76
 
77
- Currently, two functions are available:
77
+ Currently, three functions are available:
78
78
 
79
79
  - `model_checker_from_json`: generate a model from a JSON value which must be a valid model.
80
80
 
@@ -83,8 +83,12 @@ Currently, two functions are available:
83
83
 
84
84
  This function expects a URL as a first parameter, which should dowload a JSON model possibly
85
85
  as JSON or YAML.
86
+ - `ir_checker_from_file`: generate a model checker from a JSON intermediate representation.
86
87
 
87
- The following named parameters are available to both functions:
88
+ This function expects a file path as a first parameter, or `-` for standard input, holding
89
+ an IR as generated with `jmc -C -F json`. See compiler option `--from-ir` about its limitations.
90
+
91
+ The following named parameters are available to both model functions:
88
92
 
89
93
  - `auto`: boolean, whether to automatically map url to local path, default is _False_;
90
94
  this feature is mostly for testing.
@@ -111,6 +115,15 @@ is_person = jm.model_checker_from_url("./Person.model.json")
111
115
  print("hobbes is a person:", is_person({"name": "Hobbes", "birth": "2020-07-29"}))
112
116
  ```
113
117
 
118
+ Or, starting from a previously generated IR, eg with `jmc -C -F json -o Person.ir.json Person.model.json`:
119
+
120
+ ```python
121
+ import json_model as jm
122
+
123
+ is_person = jm.ir_checker_from_file("./Person.ir.json")
124
+ print("hobbes is a person:", is_person({"name": "Hobbes", "birth": "2020-07-29"}))
125
+ ```
126
+
114
127
  ## JavaScript API
115
128
 
116
129
  Model compilation to JavaScript generates either a module (`.mjs`) or a node script (`.js`),
@@ -2,11 +2,7 @@
2
2
 
3
3
  ## Current Tasks
4
4
 
5
- - [ ] bench: use local models instead of fetching urls
6
5
  - [ ] bench: case failures handling needs some fixing
7
- - [ ] front: allow to load `.errors.json` file to filter out expected errors
8
- - [ ] tests: use `.errors.json` file to manage errors, instead of rough counts
9
- - [ ] models: add model for `*.errors.json` files
10
6
  - [ ] tests: run tests inside docker image
11
7
  - [ ] tests: check more bad urls (eg bad %-escape)
12
8
  - [ ] tests: check pydantic generated classes
@@ -37,7 +33,7 @@
37
33
  - [ ] perf: keep only one java run?
38
34
  - [ ] perf: check median hack for run times
39
35
  - [ ] perf: show schema to model conversion times
40
- - [ ] pr: better document optimizations, eg add compilier optimization page
36
+ - [ ] pr: better document optimizations, eg add compiler optimization page
41
37
  - [ ] optim: collect and display stats about what works
42
38
  - [ ] c-backend: improve unique with hash using int set?
43
39
  - [ ] c-backend: improve str hash?
@@ -142,26 +138,29 @@
142
138
 
143
139
  ## Internship
144
140
 
145
- - [ ] pr: read www, papers, spec… setup dev env, report issues
146
- - [ ] pr: try tutorial, report issues and suggest improvements
147
- - [ ] tests: add a few tests for jsonrpc model
148
- - [ ] model: write a model for MCP
149
- - [ ] tests: add a few tests for MCP model
150
- - [ ] model: update and test `ri.model.json`
151
- - [ ] export: generate ts interfaces
152
- - [ ] tests: improve predef validators cross-language consistency
153
- - [ ] tests: generate invalid minimal, maximal, random values
141
+ - [x] pr: read www, papers, spec… setup dev env, report issues
142
+ - [x] pr: try tutorial, report issues and suggest improvements
143
+ - [x] tests: add a few tests for jsonrpc model
144
+ - [x] model: write a model for MCP
145
+ - [x] tests: add a few tests for MCP model
146
+ - [x] export: generate ts interfaces
147
+ - [x] model: fix IR model and tests
148
+ - [x] front: IR re-entrance
149
+ - [ ] tests: generate valid (pseudo-random) values
150
+ - [ ] tests: generate invalid minimal, maximal, pseudo-random values
154
151
  - [ ] tests: generate invalid values on each constraint
155
- - [ ] backend: C and runtime with json-c
156
- - [ ] backend: C++
157
- - [ ] backend: go
152
+ - [ ] backend: C and runtime with json-c (\*, but beware of runtime integration)
153
+ - [ ] backend: C# (\*\*)
154
+ - [ ] backend: go (\*\*\*)
155
+ - [ ] backend: kotlin (\*\*)
156
+ - [ ] backend: C++ (\*\*\*\* see existing fork)
157
+ - [ ] backend: scala
158
158
  - [ ] backend: php
159
159
  - [ ] backend: ruby
160
- - [ ] backend: rust
160
+ - [ ] backend: lua
161
+ - [ ] backend: rust (\*\*\*\*\*)
161
162
  - [ ] backend: test and fix existing dart backend MR
162
163
  - [ ] export: generate annotated java interfaces/classes?
163
- - [ ] tool: jmc api in flask
164
- - [ ] front: allow IR re-entrance?
165
164
  - [ ] export: katydid?
166
165
  - [ ] api: json model as a service backend with flask
167
166
 
@@ -1,8 +1,7 @@
1
1
  # JSON Model Compiler Benchmark Artifacts
2
2
 
3
3
  The purpose of this benchmark is to compare JSON value validation performance for
4
- the exactly/roughly (see discussion below) the same constraints, independently
5
- of the syntax used to express these constraints.
4
+ the same constraints, independently of the syntax used to express these constraints.
6
5
 
7
6
  These artifacts compare
8
7
  [JSON Model Compiler (jmc)](https://github.com/clairey-zx81/json-model) generated code using the
@@ -13,19 +12,29 @@ from [JSON Schema Benchmark](https://github.com/sourcemeta-research/jsonschema-b
13
12
 
14
13
  ## Recent Artifacts
15
14
 
16
- Overall, depending on the chosen metrics, the JSU converter and JMC C backend are 50 to 90%
17
- faster than Blaze in these artifacts.
18
-
19
- - [2026072902](benchmarks/2026072902.md) clang, predefs, jsu 0.9.15/jmc 2.0.53 vs sbc 16.3.0, 11 runs, 1000 iterations.
20
- - [2026072900](benchmarks/2026072900.md) clang, predefs, jsu 0.9.15/jmc 2.0.52 vs sbc 16.3.0, 11 runs, 1000 iterations.
21
- - [2026072600](benchmarks/2026072600.md) clang, predefs, jsu 0.9.13/jmc 2.0.52 vs sbc 16.3.0, 11 runs, 1000 iterations.
22
- - [2026072200](benchmarks/2026072200.md) clang, predefs, jsu 0.9.13/jmc 2.0.52 vs sbc 16.2.1, 11 runs, 1000 iterations.
23
- - [2026071700](benchmarks/2026071700.md) clang, predefs, jsu 0.9.13/jmc 2.0.52 vs sbc 16.2.0, 11 runs, 1000 iterations.
24
- - [2026071302](benchmarks/2026071302.md) clang, predefs, jsu 0.9.13/jmc 2.0.52 vs sbc 16.1.0, 11 runs, 1000 iterations.
25
- - [2026071000](benchmarks/2026071000.md) clang, no predefs, jsu 0.9.12/jmc 2.0.51 vs sbc 16.1.0, 11 runs, 1000 iterations.
26
- - [2026070900](benchmarks/2026070900.md) clang, no predefs, jsu 0.9.11/jmc 2.0.51 vs sbc 16.1.0, 11 runs, 1000 iterations.
27
- - [2026062200](benchmarks/2026062200.md) clang, no predefs, jsu 0.9.11/jmc 2.0.51 vs sbc 16.0.0, 11 runs, 1000 iterations.
28
- - [2026062102](benchmarks/2026062102.md) clang, no predefs, jsu 0.9.10/jmc 2.0.50 vs sbc 16.0.0, 11 runs, 1000 iterations.
15
+ Overall, depending on the chosen metrics, JMC with the C backend is 50-100% faster
16
+ than Blaze on average to validate JSON values in these artifacts.
17
+
18
+ - [2026080600](benchmarks/2026080600.md) jsu 0.9.17/jmc 2.0.55 vs sbc 16.7.0, content, fix.
19
+ - [2026080501](benchmarks/2026080501.md) jsu 0.9.17/jmc 2.0.55 vs sbc 16.6.0, content, fix.
20
+ - [2026080500](benchmarks/2026080500.md) jsu 0.9.17/jmc 2.0.55 vs sbc 16.5.0, content, fix.
21
+ - [2026080400](benchmarks/2026080400.md) jsu 0.9.16/jmc 2.0.55 vs sbc 16.5.0, content, fix.
22
+ - [2026080300](benchmarks/2026080300.md) jsu 0.9.16/jmc 2.0.55 vs sbc 16.4.0, content, fix.
23
+ - [2026080100](benchmarks/2026080100.md) jsu 0.9.16/jmc 2.0.55 vs sbc 16.3.0, content, no fix.
24
+ - [2026073100](benchmarks/2026073100.md) jsu 0.9.16/jmc 2.0.55 vs sbc 16.3.0, content, fix.
25
+ - [2026073003](benchmarks/2026073003.md) jsu 0.9.16/jmc 2.0.54 vs sbc 16.3.0, content, fix.
26
+ - [2026072902](benchmarks/2026072902.md) jsu 0.9.15/jmc 2.0.53 vs sbc 16.3.0, content, fix.
27
+ - [2026072900](benchmarks/2026072900.md) jsu 0.9.15/jmc 2.0.52 vs sbc 16.3.0, content, fix.
28
+ - [2026072600](benchmarks/2026072600.md) jsu 0.9.13/jmc 2.0.52 vs sbc 16.3.0, content, fix.
29
+ - [2026072200](benchmarks/2026072200.md) jsu 0.9.13/jmc 2.0.52 vs sbc 16.2.1, content, fix.
30
+ - [2026071700](benchmarks/2026071700.md) jsu 0.9.13/jmc 2.0.52 vs sbc 16.2.0, content, fix.
31
+ - [2026071302](benchmarks/2026071302.md) jsu 0.9.13/jmc 2.0.52 vs sbc 16.1.0, content, fix.
32
+ - [2026071000](benchmarks/2026071000.md) jsu 0.9.12/jmc 2.0.51 vs sbc 16.1.0, no content, fix.
33
+ - [2026070900](benchmarks/2026070900.md) jsu 0.9.11/jmc 2.0.51 vs sbc 16.1.0, no content, fix.
34
+ - [2026062200](benchmarks/2026062200.md) jsu 0.9.11/jmc 2.0.51 vs sbc 16.0.0, no content, fix.
35
+ - [2026062102](benchmarks/2026062102.md) jsu 0.9.10/jmc 2.0.50 vs sbc 16.0.0, no content, fix.
36
+
37
+ Options: _content_ validate string contents (format/predef), _fix_ improved models (bug fixes) or strictly schema compatible models.
29
38
 
30
39
  ## Benchmarking Script
31
40
 
@@ -42,17 +51,17 @@ It is typically started on a large host with the
42
51
  which will spawn the necessary containers:
43
52
 
44
53
  ```sh
45
- JMC=latest JMC_OPTS="--no-predef --cc=clang" \
46
- nohup ./start_bench.sh latest -p 16 -l 1000 -r 5 -c &
54
+ JMC=latest JMC_OPTS="--predef --cc=clang" JSU_OPTS="--id --fix --no-strict" \
55
+ nohup ./start_bench.sh latest -p 12 -l 1000 -r 5 -c &
47
56
  # in the generated directory, look for the summary markdown and radar json files.
48
57
  ```
49
58
 
50
59
  The main script options are:
51
60
 
52
- - `-p PARA` parallelism (a little less that the number of available cores, default is _8_)
61
+ - `-p PARA` parallelism (less that the number of available cores, default is _8_)
53
62
  - `-l LOOP` loop iterations for performance average (at least _1000_, the default)
54
63
  - `-r RUNS` number of runs (odd number, default is _3_)
55
- - -c` validate contents (default is _not_)
64
+ - `-c` validate contents (default is _not_)
56
65
 
57
66
  ## Benchmarking Conditions
58
67
 
@@ -111,6 +120,8 @@ the following caveats, and others:
111
120
  for the garbage collector and JIT), which may or may not be a blessing: it can reduce
112
121
  the apparent latency (eg the gc runs in another thread) but have a detrimental overall
113
122
  effect on throughput and costs as more cpu ressources are spent on the same task.
123
+ - test values are mostly valid, which is representative of a typical use case, but
124
+ the tool accuracy should be asserted elsewhere with failing cases.
114
125
 
115
126
  ## Other Artifacts
116
127
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: json_model_compiler
3
- Version: 2.0.54
3
+ Version: 2.0.56
4
4
  Summary: JSON Model Tools
5
5
  Author: Fabien Coelho, Claire Yannou-Medrala
6
6
  License-Expression: CC0-1.0
@@ -40,27 +40,21 @@ JSON Model design and implementation are discussed in research papers and report
40
40
  JSON Model compiler and runtimes are distributed through the packages published for
41
41
  each language ecosystem:
42
42
 
43
- - [JSON Model Compiler Python Package](https://pypi.org/project/json-model-compiler/)
44
-
43
+ - [JSON Model Compiler Python Package](https://pypi.org/project/json-model-compiler/)
45
44
  Ready to use JSON Model compiler and runtime for a Python environment, from _PyPI_.
46
45
 
47
- - [JSON Model Compiler Container Image `docker.io/zx80/jmc`](https://hub.docker.com/r/zx80/jmc)
48
-
46
+ - [JSON Model Compiler Container Image `docker.io/zx80/jmc`](https://hub.docker.com/r/zx80/jmc)
49
47
  Ready to use JSON Model compiler and runtimes (Python, C, JavaScript, Perl, Java)
50
48
  as a Docker image, from _Docker Hub_.
51
49
 
52
- - [JSON Model JavaScript Runtime](https://www.npmjs.com/package/json_model_runtime)
53
-
50
+ - [JSON Model JavaScript Runtime](https://www.npmjs.com/package/json_model_runtime)
54
51
  JS runtime for generated code, from _npm Registry_.
55
52
 
56
- - [JSON Model PL/pgSQL Runtime](https://pgxn.org/dist/json_model/)
57
-
53
+ - [JSON Model PL/pgSQL Runtime](https://pgxn.org/dist/json_model/)
58
54
  PL/pgSQL runtime for generated code, from _PGXN_.
59
55
 
60
- - [JSON Model Perl Runtime](https://metacpan.org/pod/JSON::JsonModel)
61
-
56
+ - [JSON Model Perl Runtime](https://metacpan.org/pod/JSON::JsonModel)
62
57
  Perl runtime for generated code, from _CPAN_.
63
58
 
64
- - [JSON Model Java Runtime](https://central.sonatype.com/artifact/org.json-model/json-model)
65
-
59
+ - [JSON Model Java Runtime](https://central.sonatype.com/artifact/org.json-model/json-model)
66
60
  Java runtime for generated code, from _Maven Central_.
@@ -1,12 +1,36 @@
1
1
  # JSON Model Compiler Versions
2
2
 
3
- ## 2.0.54 on 2027-07-30
3
+ ## 2.0.56 on 2026-08-07
4
+
5
+ - bench: use local models instead of fetching urls
6
+ - bench: add option to change the bench reference
7
+ - bench: rework presentation and comments
8
+ - bench: allow to only keep Java with GSON lib
9
+ - bench: add option to change standard comments depending on test conditions
10
+ - bench: add option to skip showing _best_ row in performance summary
11
+ - bench: when comparing to a reference, count betters
12
+ - front: ~allow to load `.errors.json` file to filter out expected errors~
13
+ - pr: improved pages and descriptions
14
+ - pr: improve demonstration models comments and indentation
15
+ - predef: allow amqp URLs
16
+ - model: update and test `jmc-ir.model.json`
17
+ - front: allow IR re-entrance, including tests
18
+
19
+ ## 2.0.55 on 2026-07-31
20
+
21
+ - front: try again to display a relevant version under dev
22
+ - models: add model for `*.errors.json` files
23
+ - tests: use `.errors.json` file to manage value errors, instead of rough counts
24
+ - tests: use `.errors.json` file to manage ts export errors
25
+ - tests: validate `*.errors.json` files according to `jmc-errors.model.json`
26
+
27
+ ## 2.0.54 on 2026-07-30
4
28
 
5
29
  - models: add SAP UI5 native model example
6
30
  - front: allow to also use '=' as a map separator
7
31
  - perf: use native models internal copy
8
32
 
9
- ## 2.0.53 on 2027-07-29
33
+ ## 2.0.53 on 2026-07-29
10
34
 
11
35
  - models: add compatible models for some JSB buggy schemas
12
36
  - perf: improve generated reports
@@ -24,7 +48,7 @@
24
48
  - pr: add ts format to jmc pod documentation
25
49
  - pr: add ts export to reference documentation
26
50
 
27
- ## 2.0.52 on 2027-07-13
51
+ ## 2.0.52 on 2026-07-13
28
52
 
29
53
  - js-backend: remove useless semi-colons
30
54
  - js-backend: remove useless braces by filtering output
@@ -124,9 +124,13 @@ cloc --md \
124
124
  json_model/runtime \
125
125
  | sed -n -e '/SUM/s/\([0-9][0-9]*\)/**\1**/g;s/SUM:/**Total**/;/^$/,$p' | grep -v '^-[-|]*$'
126
126
 
127
- n_models=$(ls tests/[mrb]*/*.model.json | wc -l)
127
+ n_valid_models=$(ls tests/[mr]*/*.model.json | wc -l)
128
+ n_invalid_models=$(ls tests/bads/*.model.json | wc -l)
129
+ n_models=$(( $n_valid_models + $n_invalid_models ))
128
130
  n_values=$(cat tests/[mrb]*/*.values.json | egrep '(true|false)' | wc -l)
129
131
  n_value_files=$(ls tests/[mrb]*/*.values.json | wc -l)
132
+ n_error_files=$(ls tests/[mrb]*/*.errors.json | wc -l)
133
+ # == $n_valid_models?
130
134
  n_schemas=$(echo tests/[mrb]*/*.schema.json | wc -w)
131
135
  n_test_schemas=$(grep '^ "schema": {' tests/JSON-Schema-Test-Suite/tests/*/*.json | wc -l)
132
136
  n_test_files=$(ls tests/JSON-Schema-Test-Suite/tests/*/*.json | wc -l)
@@ -134,7 +138,8 @@ model_locs=$(cat tests/[mrb]*/*.model.json | wc -l)
134
138
  n_eg_models=$(ls models/*.model.json | wc -l)
135
139
  eg_models_locs=$(cat models/*.model.json | wc -l)
136
140
 
137
- all_values=$(( $n_values + $n_models + $n_value_files + $n_schemas + $n_test_schemas + $n_test_files ))
141
+ # valid models are re-counted for IR checks
142
+ all_values=$(( $n_values + $n_models + $n_valid_models + $n_value_files + $n_error_files + $n_schemas + $n_test_schemas + $n_test_files ))
138
143
 
139
144
  cat <<EOF
140
145
 
@@ -151,7 +156,8 @@ on a set of test vectors.
151
156
  - number of test vector JSON values: _${n_values}_
152
157
  - all tested JSON values (including models, generated schemas and test suite schemas): _${all_values}_
153
158
 
154
- Example models cover typical use cases and demonstrate JSON Model power and ease of expression.
159
+ [Example models](https://json-model.org/MODELS) cover typical use cases and demonstrate
160
+ JSON Model power and ease of expression.
155
161
 
156
162
  - number of example models: _${n_eg_models}_
157
163
  - total example model locs: _${eg_models_locs}_
@@ -8,6 +8,7 @@ from .script import (
8
8
  jmc_script, jmc_version,
9
9
  model_from_json, model_from_url, model_from_str,
10
10
  model_checker, model_checker_from_url, model_checker_from_json,
11
+ ir_checker_from_file,
11
12
  )
12
13
 
13
14
  __ALL__ = [
@@ -15,4 +16,5 @@ __ALL__ = [
15
16
  jmc_script, jmc_version,
16
17
  model_from_json, model_from_url, model_from_str,
17
18
  model_checker, model_checker_from_url, model_checker_from_json,
19
+ ir_checker_from_file,
18
20
  ]
@@ -0,0 +1 @@
1
+ 2.0.56
@@ -119,6 +119,16 @@ Accept JSON with objects containing duplicated properties.
119
119
 
120
120
  Allow some extensions to help with JSU back-end implementation.
121
121
 
122
+ =item B<--from-ir>/B<-fir>
123
+
124
+ Read a JSON intermediate representation, as generated with C<-C -F json>, instead of a
125
+ JSON model, so that only code generation (C<-C>) is available.
126
+
127
+ The entry name and package are taken from the IR, and reporting must have been enabled
128
+ when it was generated. An IR generated with C<-F json> targets a generic back-end: the
129
+ regenerated code may differ from a direct compilation, and PL/pgSQL is not supported.
130
+ Pass the tuning options when generating the IR for a closer match.
131
+
122
132
  =back
123
133
 
124
134
  =head2 Processing
@@ -1119,11 +1119,11 @@ def optimizeIR(code: list[Jsonable], *, shortcuts: dict[str, str], partial: bool
1119
1119
 
1120
1120
 
1121
1121
  def _t2s(tvar: type|None) -> str:
1122
- """Type to JSON type name conversion."""
1122
+ """Type to IR type name conversion."""
1123
1123
  if tvar is None or tvar is type(None):
1124
1124
  return "null"
1125
1125
  elif tvar is bool:
1126
- return "boolean"
1126
+ return "bool"
1127
1127
  elif tvar is int:
1128
1128
  return "integer"
1129
1129
  elif tvar is float:
@@ -1209,8 +1209,11 @@ class IRep(Language):
1209
1209
  def esc(self, s: str) -> StrExpr:
1210
1210
  return _j("esc", s=s)
1211
1211
 
1212
+ def esc_msg(self, s: str) -> StrExpr:
1213
+ return Language.esc(self, s)
1214
+
1212
1215
  def json_cst(self, j: Jsonable) -> JsonExpr:
1213
- return _j("jc", json=j)
1216
+ return _j("jc", j=j)
1214
1217
 
1215
1218
  def const(self, c: Jsonable) -> Expr:
1216
1219
  return _j("cst", c=c)
@@ -1479,9 +1482,9 @@ class IRep(Language):
1479
1482
  return [ _j("gc", code=_u(code), entry=entry, package=package, indent=indent) ]
1480
1483
 
1481
1484
  def gen_full_code(self, defs: Block, inis: Block, dels: Block, subs: Block,
1482
- entry: str, package: str|None, exe: bool) -> Block:
1485
+ entry: str, package: str|None, exe: bool, mark: bool) -> Block:
1483
1486
  return [ _j("gfc", defs=_u(defs), inis=_u(inis), dels=_u(dels), subs=_u(subs),
1484
- entry=entry, package=package, exe=exe) ]
1487
+ entry=entry, package=package, exe=exe, mark=mark) ]
1485
1488
 
1486
1489
  #
1487
1490
  # target language reconstruction
@@ -1490,7 +1493,7 @@ def _s2t(tname: str|None) -> type:
1490
1493
  """String to type reconversion."""
1491
1494
  match tname:
1492
1495
  case None|"null": return None
1493
- case "bool"|"boolean": return bool
1496
+ case "bool": return bool
1494
1497
  case "int"|"integer": return int
1495
1498
  case "float"|"number": return float
1496
1499
  case "Number": return Number
@@ -1657,7 +1660,7 @@ def _eval(jv: Jsonable, gen: Language) -> Block|Expr:
1657
1660
  )
1658
1661
  case "gfc": return gen.gen_full_code(
1659
1662
  defs=ev("defs"), inis=ev("inis"), dels=ev("dels"), subs=ev("subs"),
1660
- entry=jv["entry"], package=jv["package"], exe=jv["exe"]
1663
+ entry=jv["entry"], package=jv["package"], exe=jv["exe"], mark=jv["mark"],
1661
1664
  )
1662
1665
  case _: raise Exception(f"unexpected op code: {op}")
1663
1666
  elif isinstance(jv, list):
@@ -1669,6 +1672,13 @@ def _eval(jv: Jsonable, gen: Language) -> Block|Expr:
1669
1672
  # probably a string, eg a variable name
1670
1673
  return jv
1671
1674
 
1675
+ def ir_evaluate(ir: Jsonable, lang: Language) -> str:
1676
+ """Generate the target language source code from a full code JSON IR."""
1677
+ code = _eval(ir, lang)
1678
+ assert isinstance(code, list), "full code JSON IR"
1679
+
1680
+ return lang.code_to_str(lang.filter_code(code))
1681
+
1672
1682
  def evaluate(ir: Code, lang: Language) -> Code:
1673
1683
  code = Code(lang, ir._entry, ir._executable, ir._package, ir._mark)
1674
1684
  code._predefs = ir._predefs
@@ -571,6 +571,10 @@ class Language:
571
571
  '"'
572
572
  )
573
573
 
574
+ def esc_msg(self, s: str) -> StrExpr:
575
+ """Escape string for inclusion in a report message."""
576
+ return self.esc(s)
577
+
574
578
  def skip(self) -> Block:
575
579
  """Skip one line."""
576
580
  return [ "" ]
@@ -77,7 +77,7 @@ _PQA = r"(/[^/?#\s]*)*(\?[^#\s]*)?(#\S*)?"
77
77
  # NOTE first segment cannot look like "scheme:" and contain strange chars
78
78
  _REL_URL = r"([^?#\s:/<>{}()!=*]+)?(/[^?#\s/]*)*(\?[^#\s]*)?(#\S*)?"
79
79
  # hierarchical urls
80
- _HIE_URL = f"(https?|s?ftp|rtsps?|s3|cm|oci)://({_AUTH})?{_PQA}"
80
+ _HIE_URL = f"(https?|s?ftp|rtsps?|s3|cm|oci|amqp)://({_AUTH})?{_PQA}"
81
81
  # file does not have a auth?
82
82
  _FILE_URL = f"file:{_REL_URL}"
83
83
  # other urls
@@ -1230,7 +1230,8 @@ static const uint64_t
1230
1230
  s_rtsp = 0x0000003a70737472LL,
1231
1231
  s_rtsps = 0x00003a7370737472LL,
1232
1232
  s_telnet = 0x003a74656e6c6574LL,
1233
- s_mailto = 0x003a6f746c69616dLL
1233
+ s_mailto = 0x003a6f746c69616dLL,
1234
+ s_amqp = 0x0000000070715d61LL
1234
1235
  // s_imap = 0x0000003a70616d69LL,
1235
1236
  // s_imaps = 0x00003a7370616d69LL,
1236
1237
  #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ // ordered
@@ -1241,7 +1242,8 @@ static const uint64_t
1241
1242
  s_rtsp = 0x727473703a000000LL,
1242
1243
  s_rtsps = 0x72747370733a0000LL,
1243
1244
  s_telnet = 0x74656c6e65743a00LL,
1244
- s_mailto = 0x6d61696c746f3a00LL
1245
+ s_mailto = 0x6d61696c746f3a00LL,
1246
+ s_amqp = 0x616d717000000000LL
1245
1247
  // s_imap = 0x696d61703a000000LL,
1246
1248
  // s_imaps = 0x696d6170733a0000LL,
1247
1249
  #else
@@ -1784,7 +1786,7 @@ jm_is_valid_url(const char *url, jm_path_t *path, jm_report_t *rep)
1784
1786
  jm_str_eq_4(url, s_oci) || jm_str_eq_5(url, s_file) ||
1785
1787
  jm_str_eq_4(url, s_ssh) || jm_str_eq_8(url, s_telnet) ||
1786
1788
  jm_str_eq_8(url, s_mailto) || jm_str_eq_3(url, s_cm) ||
1787
- jm_str_eq_3(url, s_s3)
1789
+ jm_str_eq_3(url, s_s3) || jm_str_eq_5(url, s_amqp)
1788
1790
  ) && jm_rfc3986_is_uri(url, true, false);
1789
1791
  }
1790
1792
 
@@ -1801,7 +1803,7 @@ jm_is_valid_url_rel(const char *url, jm_path_t *path, jm_report_t *rep)
1801
1803
  jm_str_eq_4(url, s_oci) || jm_str_eq_5(url, s_file) ||
1802
1804
  jm_str_eq_4(url, s_ssh) || jm_str_eq_8(url, s_telnet) ||
1803
1805
  jm_str_eq_8(url, s_mailto) || jm_str_eq_3(url, s_cm) ||
1804
- jm_str_eq_3(url, s_s3)
1806
+ jm_str_eq_3(url, s_s3) || jm_str_eq_5(url, s_amqp)
1805
1807
  ) && jm_rfc3986_is_uri(url, true, false)) || jm_rfc3986_is_uri(url, false, true);
1806
1808
  }
1807
1809