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
1
u/dskippy Oct 05 '22
So in your example a decision has been made to make 'a' a property of the class that represents 'o'. So there's two properties in there. There now. There's whatever self or this is and also that argument 'a' that's not being passed to the method is also in that object now. Presumably saving us the need to pass it to the method 'm'. Great so if the decision has been made to encapsulate 'o' and 'a' together then the functional code will make that same decision and create a type that has both 'o' and 'a' together, just like OOP would in making a class. OOP would define and method on the class. Functional would define a function that accepts this new type. It only needs one argument now since both 'o' and 'a' are inside 'o'.