Is JSON a language, if not how would it be classified?

后端 未结 4 2492
攒了一身酷
攒了一身酷 2021-02-20 02:52

Considering JSON (JavaScript Object Notation), is JSON itself a language, or is it only defined in context of another language? By language, I

相关标签:
4条回答
  • 2021-02-20 03:13

    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.

    0 讨论(0)
  • 2021-02-20 03:25

    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.

    0 讨论(0)
  • 2021-02-20 03:35

    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.

    0 讨论(0)
  • 2021-02-20 03:36

    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".

    0 讨论(0)
提交回复
热议问题