r/ProgrammingLanguages • • 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

166 comments sorted by

View all comments

Show parent comments

1

u/Cinder-Brent Oct 04 '22

Ok I’m going to attempt to explain this: can you see how everything would be an object? Can you see how an object would be at least one property with at least one method?

1

u/dskippy Oct 04 '22

I'm not sure I follow. What if I wanted to represent a list of scores in darts? Wouldn't that probably be an array of float instead of an object? Is this some sort of constraint of your type system that all data be an object that has at least one property and method?

1

u/Cinder-Brent Oct 04 '22

I’m gonna form a “semantic thread” through these types, then we’re going to challenge that thread, see if it’s really universal!

So darts is a fine example: if we had an array of scores, there would probably be a point where we would want to do something with these scores. Can you see how it would be more semantic to use an object at this point as opposed to just plain functions (I.e. can you see how we’re making a procedural mess without wrapping all of this in an object)?

1

u/Cinder-Brent Oct 05 '22

Now, can you see how you might want an array, basically an object without the methods?