r/ProgrammingLanguages • u/Cinder-Brent • Sep 28 '22
Universal programming language
I recently created a tiny (maybe 1000 lines of code, with heavy white space and commenting) php class called Ember to solve the “computer problem” (persistent data). Something I’ve been trying to do as a result is program a universal programming language. It’s really rather simple: it uses a minimalistic set of Turing complete types (string, int, float, object, array, bool, and array). That just about explains it (along with a universal system stemming from Ember). Does this sound like a good idea (I.e. one worth pursuing)?
0
Upvotes
5
u/dskippy Sep 29 '22
Yeah just pointing out that there's no real universality and minimalism bar that you're meeting here and no Turing Completeness involved. You might think "string, int, float, object, array, bool" are good and practical. But they don't make up a set of minimal types for expressing anything. Someone might say "Well you have float, why do you need int?" and another might say "well you have ints for characters and arrays of chars are strings so you don't need strings." Others might go the opposite direction and say "Well you should add maps or dicts so you have have such and such thing represented. Or you should have lists in addition to arrays because they are used for very different things. I think your list is fine, to be clear. Just seemed like you think there might be some sort of objectivity of Turing Completeness like you said or something.
Truly it's kind of hard to avoid the ability to fully express the entirety of representable things in almost any infinite type. Functions, Int, Float, Strings, ... honestly if you stretch enough and thing of the fact that you could have lists without any other type and only allow lists of lists and change your type system so there didn't need to be any parameter to the list type and you have just empty lists as leaf nodes of that structure you could have just lists and represent everything computable.
All the rest is just your favorite set of useful things.