Tuesday, April 21, 2015

Jsonnet: JSON++ by Google

Google Proposes to Enhance JSON with Jsonnet @ InfoQ
"Google has open sourced Jsonnet, a configuration language that supersedes JSON and adds new features without breaking backwards compatibility: 
  • comments, 
  • references, 
  • arithmetic and conditional operators, 
  • array and object comprehension, 
  • imports, 
  • functions, 
  • local variables, 
  • inheritance and others. 
  • Modularity: With Jsonnet the code can be split up into multiple files that are then accessed usingimport. Objects imported are then concatenated with other objects using +.
Jsonnet programs are translated to compliant JSON data formats."

"The Jsonnet language engine is implemented in C++11 and wrapped around with a C API for easier porting to other languages. C and Python libraries are provided. The C++ implementation can be compiled to JavaScript with Emscripten and an unofficial nodejs package is available.

For more details we recommend the language specification and a comparison with other configuration languages."

This is potentially very useful enhancement. On the other side, this is getting closer to full JavaScript language, and still not addressing issues of semantics / schema / ontology.

No comments: