jrsonnet icon indicating copy to clipboard operation
jrsonnet copied to clipboard

Rust implementation of Jsonnet language

jrsonnet

release license opencollective

What is it

Jsonnet is a data templating language

This Rust crate implements both jsonnet library and an alternative jsonnet executable based on it. For more information see bindings.

Install

NixOS

jrsonnet is packaged in nixpkgs and maintained by @CertainLach

nix-env -iA nixpkgs.jrsonnet

MacOS

jrsonnet is packaged to brew and maintained by @messense

brew install jrsonnet

Windows/other linux distributions

You can get latest build of jrsonnet in releases

Build from sources

jrsonnet should build on latest stable Rust version (probally on olders, but there is no MSRV policy provided)

Debug build will work too, but it is much slower than release

cargo build --release

Why?

There already are multiple implementations of this standard implemented in different languages: C++, Go, Scala.

This implementation shows performance better than all existing implementations. For more information see benchmarks.

In the end, it's always fun to implement something in Rust.

Bindings

Rust

crates.io docs.rs

Jrsonnet is written in rust itself, so just add it as dependency

Python

crates.io

Bindings are created and maintained by @messense

C/C++

Jrsonnet provides a standard libjsonnet.so shared library and should work as drop-in replacement for it

Other

WASM bingings are also available, Java bindings (Both JNI and WASM compiled to .class) are in progress

See bindings for more information.

Benchmarks

This is the fastest implementation of jsonnet both according to official benchmarks and real-life cluster configuration templating speed.

Official benchmark results are available in this gist which may get updated sometimes. It shows tests against Golang, C++ and Scala implementations showing the best performance in all cases.

You can generate this report via provided nix flake