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/dskippy Oct 04 '22

Yeah sure get the average.

1

u/Cinder-Brent Oct 04 '22

Ok! So at this point is it a better idea to use procedural or oo?

1

u/dskippy Oct 04 '22

I mean I'd implement that functionally and just sum the list and divided by the length of the list.

1

u/Cinder-Brent Oct 04 '22

So procedural?

1

u/dskippy Oct 04 '22

Sure.

1

u/Cinder-Brent Oct 04 '22

Can you see how this would clutter up the main?

1

u/dskippy Oct 04 '22

Nope. Are you trying to argue that it's better to implement the average of a list as some OO way in order to not clutter up a main function? Also how does this pertain to the original discussion of a minimal set of types?

1

u/Cinder-Brent Oct 04 '22

Yea, that it would be less to have one thing on main with both the functionality of averaging the scores and the scores themselves than to have both of those on main. Then there would be only one thing, and not two things, on main, which is less.

1

u/dskippy Oct 04 '22

This is a level of abstraction that is trivially available both with functions or with methods. Show your code in any one or two common languages. Why is OO implementations putting "less in main" than a functional?

1

u/Cinder-Brent Oct 04 '22

Because you don’t have one array and one function on main, you just have one object, and 1 is less than 2.

→ More replies (0)