Is JSON a language, if not how would it be classif

2020-07-09 02:10发布

问题:

Considering JSON (JavaScript Object Notation), is JSON itself a language, or is it only defined in context of another language? By language, I mean a programming language that might be using JSON to transmit/receive data.

It is interesting that XML is not Turing complete, yet has language in its name. Perhaps this implies a broader definition of language for this purpose?

回答1:

It's a data interchange format.

JSON (JavaScript Object Notation) is a lightweight data-interchange format.

http://json.org

JavaScript Object Notation is a text-based open standard designed for human-readable data interchange.

Type of format: Data interchange

http://en.wikipedia.org/wiki/Json


is it only defined in context of a language

Certainly not. It is entirely possible to write applications which use JSON but not JavaScript.



回答2:

JSON is a data format. It could be classified as a language, but not a programming language.

Its relationship to JavaScript is that it shares its syntax (more or less) with a subset of JavaScript literals. The JSON specification defines it completely; it doesn't depend on references to the JavaScript specification.



回答3:

According to Computer Science, JSON accomplishes the definition of language, so it is definitely a language (in the same way XML is). Is is basically a set of possible strings formed by symbols of an alphabet. It has also syntactic rules.

But it is not a programming language. In terms of programming, it is a format or notation.



回答4:

I would classify it as a format of structured data, not a language. This Wikipedia article about Turing completeness does a pretty good job summing it up:

The notion of Turing-completeness does not apply to languages such as XML, HTML, JSON, YAML and S-expressions, because they are typically used to represent structured data, not describe computation. These are sometimes referred to as markup languages, or more properly as "container languages" or "data description languages".