News for hackers. Stuff that matters.
Re:A Programming Language Database by damagednoob on Saturday August 27, 2022 @01:18PM (#32621090)
JSON[1] is a programming language?

[1]: https://pldb.com/languages/json.html

Re:A Programming Language Database by pulse7 on Saturday August 27, 2022 @02:34PM (#32621778)
This is not only a list of programming languages, but a list of "technologies". To get only programming languages you have to filter on type=pl [1]. JSON is marked with type=dataNotation [2] - so it is a "data notation" language...

[1] https://pldb.com/lists/languages.html?filter=pl

[2] https://pldb.com/lists/languages.html?filter=dataNotation

Re:A Programming Language Database by jenscow on Saturday August 27, 2022 @03:47PM (#32622475)
https://pldb.com/pages/about.html

PLDB is a comprehensive database of programming languages and their features. The focus is on programming languages, but the database also includes other languages and entities one degree away--from popular high level plain text formats to binary specifications and beyond.

Re:A Programming Language Database by damagednoob on Saturday August 27, 2022 @05:25PM (#32623368)
So is this none of one those 'increasingly ill-named' type of things. I guess it's easier to include everything then to try and define what is and isn't a programming language.
Re:A Programming Language Database by xtagon on Saturday August 27, 2022 @01:35PM (#32621234)
Maybe not pedantically, but it's a language relevant to many programmers. Seems useful to include it. They include other syntaxes such as HTML too.
Re:A Programming Language Database by satiric on Saturday August 27, 2022 @01:35PM (#32621233)
I'd say so - same as HTML or CSS. It may not be Turing complete but it's a language used for programming computers.
Re:A Programming Language Database by oreilles on Saturday August 27, 2022 @02:51PM (#32621906)
These can only be used to describe and format documents, not to write programs, which is why they are markup languages and not programming languages.
Re:A Programming Language Database by still_grokking on Saturday August 27, 2022 @03:05PM (#32622021)
Well, modern HTML + CSS is actually Turing-complete.

https://stackoverflow.com/questions/2497146/is-css-turing-co...

You can't have any programming language that is more powerful than that. So technically speaking (HTML + CSS) is a "proper programming language". Just a very awkward one where the user has to "operate the crank on the machine" to execute it.

Re:A Programming Language Database by kaba0 on Sunday August 28, 2022 @10:03AM (#32628463)
Turing completeness is a separate axis. There are programming languages that are famously not Turing-complete (for guaranteed halting) and there are (actually, surprisingly many) “things” that are Turing complete, but are not programming languages at all. The latter includes Game of Life, many boardgames and PowerPoint.

As most human things, programming languages don’t have a specific definition, but as a point of reference we should probably have a look at whether that “thing” was ever intended to be used as that. Sure, there is a program that can encode loops into html tags, but it is generally used as a markup language for describing the DOM. Not for programming it.

Re:A Programming Language Database by oreilles on Saturday August 27, 2022 @04:09PM (#32622699)
It's turing complete "so long as you consider user interactions to be part of the “execution” of CSS". So no, it cannot be used to write computer programs.
Re:A Programming Language Database by still_grokking on Saturday August 27, 2022 @04:45PM (#32623014)
First comment to accepted answer:

> The formal definition (simplest) of Turing Machine is simply a tuple of states set, symbol set, initial state, accepting states set and a transition function. There is no crank in it. By computation we mean somebody needs to apply the transition function faithfully on the tape which is exactly like the clicking in this case. More formally, a model of computation can be viewed as a set of rules somebody needs to follow to do the computation. In that sense, I think CSS is Turing-Complete. – Shuhao Tan Jun 11, 2018 at 21:32

[Emphasis mine]

Re:A Programming Language Database by oreilles on Sunday August 28, 2022 @09:13AM (#32628144)
The definition of a programming language is a language that can be used to write computer programs. A turing machine is not necessarily a computer program, and a programming language isn't necessarily turing complete.
Re:A Programming Language Database by still_grokking on Sunday August 28, 2022 @12:58PM (#32629910)
Yes, but how is this relevant to the question whether (HTML + CSS) is a "programming language"?

There is no restriction on the "device" executing a program.¹

Steam devices like in the case of power looms are for example just fine. As the human brain is in case of say abstractly but formally expressed algorithms (think Ada Lovelace).

Also programmable machines that were in fact run by spinning a crank by a human are considered some kind of archaic "computers" (think for example antique mechanical music devices which could "load" a peace form a kind of card or tape).

(HTML + CSS) can be used to formulate executable algorithms to compute anything computable. You can't be more of a programming language than that! Only that the executing device is a little bit awkward as you need in fact "spin a crank" manually.

___

¹ For example there was this nice Lego Turing machine:

https://www.youtube.com/watch?v=FTSAiF9AHN4

If I would replace the electrical motors by a hand crank would anything fundamentally change?

No, of course not! The machine would be still a universal computer. Only one that needs to be operated "semi-manually"—exactly like a "computer" build in (HTML + CSS).

Re:A Programming Language Database by diroussel on Saturday August 27, 2022 @03:28PM (#32622267)
JSON Schema has an ‘if’ construct. That gives JSON a standardised way to do flow control.

I’m still not sure I would call it a programming language. But I wouldn’t say it’s not one.

Re:A Programming Language Database by oreilles on Saturday August 27, 2022 @04:12PM (#32622719)
JSON can be used to write an abstract syntax tree of a program, but the specific grammar used and the way of converting it into a program would be the programming language, not JSON itself.
Re:A Programming Language Database by tadfisher on Saturday August 27, 2022 @02:13PM (#32621593)
It has a restricted grammar and can be parsed, so it is a programming language as much as any on the list. It just doesn't have a canonical runtime.
Re:A Programming Language Database by still_grokking on Saturday August 27, 2022 @02:53PM (#32621927)
Any arbitrary string of Unicode characters would be a programming language given that above definition. Which makes of course no sense.

A syntax without predefined runtime semantics is not a programming language!

Without the interpretation semantics no (or every, depending on standpoint) computation can be described by any syntax. The definition of runtime semantics for some syntax is what creates a programming language in the first place.

Pure syntax OTOH can be given arbitrary interpretations. So it's therefore not a programming language on its own. The runtime semantic of some code is what allows us to write and execute programs.

One can't write even the most trivial programs in JSON. No "Hello World" as JSON does not offer any I/O facility. No "fizzbuz" as there are no control structures or any loops in JSON. No "Fibonacci numbers" as there are no function abstractions in JSON…

JSON is just not a programming language.

(Still a valid candidate to include in computer language collection, of course, as JSON has its merits regardless the fact there is no canonical way do write in it anything that resembles computer programs).

Re:A Programming Language Database by Someone on Saturday August 27, 2022 @02:52PM (#32621921)
I doubt many share your opinion that anything with a restricted grammar that can be parsed is a programming language.

I think your definition is closer to, if not identical to, what Wikipedia calls “Computer Language” (https://en.wikipedia.org/wiki/Computer_language)

For me, and I think for most, the more restricted https://en.wikipedia.org/wiki/Programming_language#Definitio... (“A programming language is a notation for writing programs, which are specifications of a computation or algorithm”) is closer to what makes a formal language a programming language.

Re:A Programming Language Database by oreilles on Saturday August 27, 2022 @02:46PM (#32621871)
A programming language is a notation for writing programs, which JSON isn't, not more than any other storage format or markup language.
Re:A Programming Language Database by avgcorrection on Saturday August 27, 2022 @02:19PM (#32621648)
CSV too?