# About JSON Model

JSON Model is an on-going [research project](PUBS.md)
dedicated to the [Public Domain](https://creativecommons.org/public-domain/).

The following line and file counts about version **2.0.59.post7** (`391f9c6ca on 2026-09-13`) show
that the compiler, code generator and runtimes are quite small, but still heavily tested
and documented.

## Compiler Source Code

This count includes model parsing and optimizations, compiler, exporter,
importer, `jmc` command script and miscellaneous utilities,
but excludes language-specific code generators and associated runtimes.

Language|files|blank|comment|code
:-------|-------:|-------:|-------:|-------:
Python|20|1454|2296|8916

## Per-Language Code Generators

Code generators for each target language are written in Python,
plus code snippets in the target language itself:

Language|files|blank|comment|code
:-------|-------:|-------:|-------:|-------:
Python|6|57|17|272
C|6|107|115|912
JavaScript|7|74|48|290
PL/pgSQL|2|78|49|401
Perl|7|87|31|417
Java|3|76|58|408
**Total**|**31**|**479**|**318**|**2700**

## Per-Language Runtimes

Each target language has a dedicated runtime to help execute the generated codes:

Language|files|blank|comment|code
:-------|-------:|-------:|-------:|-------:
C|3|346|326|2493
Java|10|217|180|1265
Perl|1|129|155|523
Python|3|93|64|523
JavaScript|2|51|37|386
SQL|1|23|39|250
**Total**|**20**|**859**|**801**|**5440**

Note that the generated code may also depend on third-party libraries.

## Test Models

Test models cover the various features of JSON Model.
Each model is tested for each target language (Python, C, JavaScript, PL/pgSQL, Perl, Java)
on a set of test vectors.

- Number of test JSON models: _547_
- Total test JSON model locs: _5779_
- Number of test vector JSON values: _7537_
- All tested JSON values (including models, generated schemas and IR, and test suite schemas): _12155_

Over _170,000_ assertion checks are performed when running non-regression tests:
generated files, values validated in various languages…

[Example models](https://json-model.org/MODELS) cover typical use cases and demonstrate
JSON Model power and ease of expression.

- Number of example models: _64_
- Total example model locs: _4616_

## Documentation

The documentation website `json-model.org` works thanks to [docsify](https://docsify.js.org/),
_a magical documentation site generator_, which styles raw markdown on the fly: awesome!

Documentation files, excluding generated benchmark results, have the following footprint:

Language|files|blank|comment|code
:-------|-------:|-------:|-------:|-------:
Markdown|17|1023|0|3784
