5 ms·
Orderly, a textual format for describing JSON
- MartinMond 17y agoThis seems really useful for statically typed languages. Use a code generator and manipulate JSON in a typesafe way. Now if there were such a thing for Scala... (Anyone wanting to work on that?)
- lth 17y agoA very interesting idea. That would basically be like writing another generator for the current orderly implementation. one capable of writing code. The thing would basically eat orderly_nodes and poop code. Here's the intermediate representation of nodes that it could work from: http://github.com/lloyd/orderly/blob/master/src/api/node.h#L82,L125 http://github.com/lloyd/orderly/blob/master/src/api/node.h#L...
- simonw 17y agoI like it - reminds me a lot of RelaxNG compact syntax.
- gfodor 17y agoSee also: Avro http://hadoop.apache.org/avro/docs/current/ http://hadoop.apache.org/avro/docs/current/ (Not for the JSON, but for the lightweight cross-platform schema part.)
- CrLf 17y agoI forsee the day where JSON-related technologies become as complex as XML-related ones, and people start moving to the next simple thing.
- mbreese 17y agoI agree... Who here has a use for this and/or JSONSchema (which I didn't know existed until today)? Javascript is a dynamic language, so why add this type of stuff onto it to make it more friendly to static languages. If you're storing things so complicated that it needs to be validated in JSON format, perhaps you should choose a different serialization format.
- jherdman 17y agoI couldn't agree more, and will tell you that we're already there. I'm working on a project right now with an exceedingly complex JSON API. There isn't a day that goes by that I wish I could have gone back in time and had the team use XML instead.
- simonw 17y agoHave you considered applying JSONSchema or Orderly to your current project?
- jherdman 17y agoIt's definitely something I'm going to be looking at in the very near future. The pain we're experiencing is definitely worsened by the fact that it's largely undocumented internally as well. Have you had experience with either technology, and if so, do you have a recommendation one way or the other?
- andreyf 17y agoAny time two different teams (or even people) are writing code that talk to common JSON, it's probably a good idea to define it in a schema. Think of it as a class of unit tests - except the relative effort required is miniscule, and the benefits exactly the same.
- mbreese 17y agoI can understand the desire to do define the formats, but this (Orderly) is bordering on ridiculous. You create a new microlanguage that compiles to a different microlanguage which is a DSL in the same language that your objects are stored in, so that it can be validated to be read properly in yet another language (unless your main code in already in Javascript). This just strikes me as a step down the path of WS-* or similar XML nonsense. What ever happened to just having a README or documentation that just says what the fields in the object are? Why does it need to be validated by a different tool/language?
- dan_sim 17y agoI can't wait to have a textual format that will describe Orderly