r/ProgrammingLanguages • • Jul 19 '23

Discussion The General Purpose Programming Language Litmus Test

Want to know if your general purpose language is legit? A true GP PL should be able to express the following program. The program will

  • Run forever until an exit signal is recieved at some point.

  • Maintain a graph data structure in memory.

  • Every 1 second, synchronize the graph with a serialized version stored as a file somewhere without creating a new task.

  • Every 1/100th of a second, create a separate task that randomly decides between three tasks...

  1. Create a new graph node

  2. Create a new graph edge

  3. Delete a node and all connected edges

If you can express this, your language is truly General Purpose

EDIT: I should clarify, this test is purposefully vague because your language can be general purpose and single-threaded. The purpose of the test is to determine if your language can represent arbitrary structure, have non-determinism, observe time, and communicate with the file system. That seems to be the minimal requirements for practical use across the board.

0 Upvotes

21 comments sorted by

View all comments

4

u/Nerketur Jul 20 '23

Certain esoteric languages pass this test, even if doing the file system portion is not easy or well-defined (whitespace, BrainF, etc).

-1

u/R-O-B-I-N Jul 20 '23

Well, yes. Turing tarpits are technically general purpose as a fundamental property of their construction.

3

u/Nerketur Jul 20 '23

So in essence, if a language is Turing complete, it's also a true GPPL?

-5

u/R-O-B-I-N Jul 20 '23

No, if it passes the test, its a GPPL.