It would be great to have Java bindings for Jsonnet. I'm thinking let's create JNI bindings as an initial implementation.
Yes this should be pretty easy and Java is noticeably missing from the list of 3rd party language bindings.
Long term it'd be great to rewrite the whole thing in haxe so we can get straightforward pure implementations in every language but that is probably at least 2 weeks of fulltime work and that kind of effort would probably be better spent elsewhere. JNI bindings would be < 1 day as the C API is pretty straightforward.
Sounds good to me. Mind if I go ahead and take this?
Go for it :)
Did you guys ever make progress on this?
I am not aware of any available java bindings currently, but I don't know the story here. Perhaps @sparkprime @davidzchen can tell you more.
You can consider calling jsonnet as a command. I think it's often a good idea even when bindings are available. For example the version of the jsonnet doesn't need to pinned in a specific version of your app. Also with the command approach it's easier to add timeouts/memlimits etc. The answer depends on your use case.
There is also a 3rd party effort to write a full reimplementation in Java: https://groups.google.com/forum/#!topic/jsonnet/jOMepyno6ag. However it hasn't beed published yet to the best of my knowledge.
Most helpful comment
https://github.com/databricks/sjsonnet/