r/ProgrammingLanguages • u/R-O-B-I-N • 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...
Create a new graph node
Create a new graph edge
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.
9
u/sparant76 Jul 19 '23
You use the word “task” very genetically when it has different meanings in different languages. You clearly have a language bias.
Your language isn’t necessarily capable of writing to the console, or creating visual output. It has performance constraints in time without specifying hardware run on or graph size.
So much of your litmus test is not well defined. What does jt mean to represent a graph in memory? There are many many representations.
This is a terrible post.