difftreelog
doc: intrinsic handling is a implementation detail
in: master
Property __intrinsic_namespace__ shouldn't be handled by anyone
1 file changed
crates/jrsonnet-evaluator/README.mddiffbeforeafterboth1# jrsonnet-evaluator23Interpreter for parsed jsonnet tree45## Standard library67jsonnet stdlib is embedded into evaluator, but there is different modes for this:89- `serialized-stdlib`10 - serializes standard library AST using serde11 - slower than `codegenerated-stdlib` at runtime, but have no compilation speed penality12- none13 - leaves only stdlib source code in binary, processing them same way as user supplied data14 - slowest (as it involves parsing of standard library source code)1516Because of `codegenerated-stdlib` compilation slowdown, `serialized-stdlib` is used by default1718### Benchmark1920Can also be run via `cargo bench`2122```markdown23# serialized-stdlib24test tests::bench_serialize ... bench: 1,763,999 ns/iter (+/- 76,211)25# none26test tests::bench_parse ... bench: 7,206,164 ns/iter (+/- 1,067,418)27```2829## Intrinsics3031Some functions from stdlib are implemented as intrinsics3233### Intrinsic handling3435If indexed jsonnet object has field '__intrinsic_namespace__' of type 'string', then any not found field/method is resolved as `Val::Intrinsic(__intrinsic_namespace__, name)`