difftreelog
doc: feed readme.md with useful links/badges
in: master
1 file changed
README.mddiffbeforeafterboth1# jrsonnet1# jrsonnet2233[](https://github.com/CertainLach/jrsonnet/releases)4[](/LICENSE)5[](https://opencollective.com/jrsonnet)465## What is it7## What is it687[Jsonnet](https://jsonnet.org/) is a data templating language9[Jsonnet](https://jsonnet.org/) is a data templating language8109This Rust crate implements both jsonnet library and an alternative `jsonnet` executable based on it. For more information see [bindings](#Bindings).11This Rust crate implements both jsonnet library and an alternative `jsonnet` executable based on it. For more information see [bindings](#Bindings).101213## Install1415### NixOS1617jrsonnet is packaged in nixpkgs and maintained by @CertainLach1819```sh20nix-env -iA nixpkgs.jrsonnet21```2223### MacOS2425jrsonnet is packaged to brew and maintained by @messense2627```sh28brew install jrsonnet29```3031### Windows/other linux distributions3233You can get latest build of jrsonnet in [releases](https://github.com/CertainLach/jrsonnet/releases)3435### Build from sources3637jrsonnet should build on latest stable Rust version (probally on olders, but there is no MSRV policy provided)3839Debug build will work too, but it is much slower than release4041```42cargo build --release43```4411## Why?45## Why?124613There already are multiple implementations of this standard implemented in different languages: [C++](https://github.com/google/jsonnet), [Go](https://github.com/google/go-jsonnet/), [Scala](https://github.com/databricks/sjsonnet).47There already are multiple implementations of this standard implemented in different languages: [C++](https://github.com/google/jsonnet), [Go](https://github.com/google/go-jsonnet/), [Scala](https://github.com/databricks/sjsonnet).165017In the end, it's always fun to implement something in Rust.51In the end, it's always fun to implement something in Rust.185219## Compliance with the [specification](https://jsonnet.org/ref/spec.html)53## Bindings205421- Passes all the original `examples` tests55### Rust225623- Passes all the original `test_suite` tests except for those which require stacktraces identical to the default implementation (while also being available, vanilla-like stacktraces are not 100% identical):57[](https://crates.io/crates/jrsonnet-evaluator)58[](https://docs.rs/jrsonnet-evaluator)245925 ```jsonnet60Jrsonnet is written in rust itself, so just add it as dependency26 ## Explaining format27 ```28 RuntimeError("3")29 --> /home/lach/jsonnet-rs/a.jsonnet:1:2530 |31 1 | local a = "%0 10.20d" % error "3";32 | ^^^^^^^^^ error statement33 |34 --> /home/lach/jsonnet-rs/a.jsonnet:1:1135 |36 1 | local a = "%0 10.20d" % error "3";37 | ^^^^^^^^^^^^^^^^^^^^^^^ function <mod> call38 |39 --> /home/lach/jsonnet-rs/a.jsonnet:6:640 |41 6 | a: a,42 | ^ variable <a>43 |44 --> /home/lach/jsonnet-rs/a.jsonnet:3:645 |46 3 | b: self.a,47 | ^^^^^^ field access48 |49 --> /home/lach/jsonnet-rs/a.jsonnet:9:150 |51 9 | e.b52 | ^^^ field access53 |54 ```556156 ## Compact format (default)62### Python57 ```58 RuntimeError("3")59 /home/lach/jsonnet-rs/a.jsonnet:1:25-35: error statement60 /home/lach/jsonnet-rs/a.jsonnet:6:6-8 : variable <a>61 /home/lach/jsonnet-rs/a.jsonnet:3:6-13 : field access62 /home/lach/jsonnet-rs/a.jsonnet:9:1-5 : field access63 ```646365 ## Vanilla format66 ```67 RUNTIME ERROR: 364[](https://pypi.org/project/rjsonnet/)68 a.jsonnet:1:25-34 thunk <a> from <$>69 <std>:237:21-22 thunk from <function <anonymous>>70 <std>:754:20-24 thunk from <function <anonymous>>71 <std>:32:25-26 thunk from <function <anonymous>>72 <std>:32:16-27 function <anonymous>73 <std>:754:8-25 function <anonymous>74 <std>:237:7-23 function <anonymous>756576 a.jsonnet:6:6-7 object <d>66Bindings are created and maintained by @messense77 a.jsonnet:3:6-12 object <c>78 a.jsonnet:9:1-4 $79 During evaluation80 ```81 ```826783## Bindings68### C/C++846985Jrsonnet provides a standard `libjsonnet.so` shared library and should work as drop-in replacement for it70Jrsonnet provides a standard `libjsonnet.so` shared library and should work as drop-in replacement for it867172### Other7387WASM bingings are also available, Java bindings (Both JNI and WASM compiled to .class) are in progress74WASM bingings are also available, Java bindings (Both JNI and WASM compiled to .class) are in progress887589See [bindings](./bindings/) for more information.76See [bindings](./bindings/) for more information.95Official benchmark results are available [in this gist](https://gist.github.com/CertainLach/5770d7ad4836066f8e0bd91e823e451b) which may get updated sometimes. It shows tests against Golang, C++ and Scala implementations showing the best performance in all cases.82Official benchmark results are available [in this gist](https://gist.github.com/CertainLach/5770d7ad4836066f8e0bd91e823e451b) which may get updated sometimes. It shows tests against Golang, C++ and Scala implementations showing the best performance in all cases.968397You can generate this report via provided nix flake84You can generate this report via provided nix flake9899## TO-DO list100101- [ ] Create docker container for easier benchmarking and/or benchmark in CI102- [ ] Implement and utilize mutable strings, arrays and objects instead of COWing when possible10385