2020-08-11, a Tuesday

JSON is a language

languages programming thoughts scratch

As everyone knows, Java Serializable Object-oriented Notation (JSON for short) is a commonly used programming language for data storage.

Ovinus Real on LinkedIn

To clarify, JSON isn’t a programming language, but I’d argue that’s still a language in general.

The word “language” is already used to describe both human languages, like Spanish, ASL, and Lojban, and programming languages, like Python, C++, and Brainfuck. It is important to note that while HTML isn’t a programming language, it is a markup language, as hinted in its name (the “ML” in HTML stands for “markup language”), which means that it’s used to define formatting and semantic information in text; it’s not used to tell a computer a sequence of commands to perform.

Thus, I think a “language” is a distinct set of conventions used to communicate between two entities; for example, a human language is used to communicate between two people, while programming languages are used for humans to communicate with computers. This makes “language” a very broad term, but it’s not too broad: a tree isn’t a language (though I suppose it could be used for a language; I was thinking that perhaps two gods that aren’t perfectionists could with their ascended powers rearrange the trees in their worlds to communicate with each other).

Human languages are still a very broad category; one could divide them into natural and constructed, where naturally developed languages like Mandarin and Nicaraguan Sign Language are contrasted with engineered languages like the classic Esperanto. Both categories have their own intricate subdivisions; for example, conlangs can be divided further into auxlangs, artlangs, logical languages, etc., and I’m pretty sure there’s an entire branch of linguistics dedicated to categorizing natural human languages.

Probably the most known subdivision of computer languages would be programming languages, and you’d often see people arguing over what makes one a programming language. The typical definition I’ve seen is if a language is Turing complete, which includes Brainfuck, but HTML/CSS and Rule 110 have been proven to be Turing complete, but I don’t think they’re typically considered programming languages. In addition, if there were a simple language for controlling a robot, for example, with basic commands like moving forward and background, where a set of commands could be configured in the robot as a procedure, one could argue that the language could be considered a programming language because the procedure could be considered a program for the robot to execute, despite there being insufficient commands for Turing completeness.

Scratch also has a debatable status as a programming language. I’ve seen a few arguments that because Scratch is block-based rather than text-based, it’s not a programming language. However, I don’t think a language’s representation determines whether it’s a programming language; otherwise, any programming language can be disqualified by making a block-based version of its syntax. In addition, Scratch can be represented in text.

Another argument is that Scratch is limited in functionality or isn’t practical outside of a learning environment, but I don’t think that is relevant for whether something is a programming language. Regarding functionality, one could say that Scratch simply fills a niche, the same way languages like Python are better for data analysis and not suitable for front-end web development. Indeed, it is possible to use Python for the web, but it’s probably better to use something designed for that niche—not everything is a nail a hammer should hit. Similarly, the Scratch language isn’t fundamentally incapable of being extended into other niches; its core blocks could be swapped out for blocks that interact with the operating system instead of a visual stage, but there are better alternatives. Regarding practicality, I don’t think a language’s usefulness for, say, getting a job determines its status as a programming language—it’s kind of like judging a (singleplayer) video game by its community. There are many programming languages that don’t have as many practical applications as the most common ones (eg Java, Python, C++, etc.), such as languages like Elm and Common Lisp and esoteric programming languages. Nothing in “programming language” implies that it has to be able to do everything or that it should be able to get you a high-paying job.

JSON is neither a programming language nor a markup language. While it’s human readable, it’s also often used for computers to communicate with each other; for example, a client-side application might receive JSON data from a server. It has an agreed-upon syntax and grammar, fundamental aspects of a language, so it’s therefore a language.

See source and revision history on GitHub.