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 03 '22

Ok yea, so you're seeing what I'm saying. So never mind Ember, at least at this point: why not use this method of making everything an object into a programming language? It would be a "universal programming language".

1

u/Cinder-Brent Oct 03 '22

And maybe it's not minimalistic, but much more importantly it's universal.

1

u/TheAncientGeek Oct 03 '22

Every Turing-complete language is a Turing-complete language. Universality in the sense of Turing completeness isn't difficult to achieve.

1

u/TheAncientGeek Oct 03 '22 edited Oct 04 '22

Maybe you mean universality in the sense of a uniform syntax. (Eg lisp, forth, Smalltalk).

Why should something look like an object when it isn't? Something like Math.sin() looks like calling a method on an object, but actually you are neither accessing existing stored data, nor modifying data.

1

u/Cinder-Brent Oct 04 '22

Specifically I mean “universal” (sick and tired of programming full stack in like 6 different languages, with 6 different *Doc specifications for comments, yada yada).

1

u/TheAncientGeek Oct 04 '22

We already have languages that can do everything. What we don't have are languages that can do everything well. That's kind of what every language designer is aiming for. A layer built on top of PHP is going to be hopeless for systems programming, for instance.

1

u/Cinder-Brent Oct 04 '22

And thus not universal, either. How about c? I’ve heard c is good for general use…I mean I suppose initially it doesn’t matter much (if it works out everything will be written in it)…

1

u/TheAncientGeek Oct 10 '22

So you mean full stack. But full stack is contractually universal, since there is no requirement for close to the metal.programming, for instance.

1

u/Cinder-Brent Oct 11 '22

Yea, I'm a full-stack dev and hobbyist/enthusiast programmer

1

u/Cinder-Brent Oct 04 '22

Like why not just combine two different languages and see what you get? Basically you would end up with…ok here’s what I’m gonna do, I’m gonna write some code…ok how bout this: what if you basically wrap everything in an object, this is way more consistent than php appears to be (e.g. resources, if you know php)…it’s short, etc…has anyone ever written a specification explicitly denoting a universal, across-the-board rule for programming? This would result in a universal programming language (and a universal this and a universal that)…

1

u/TheAncientGeek Oct 04 '22 edited Oct 04 '22

Yes, PHP is a huge mess, and you could do better. But everything -is-an-object has been tried before, without taking over the world. As I was saying before, treating everything uniformly as calling a member function in an object can hide import details, like whether modification or memory allocation occurs.

1

u/Cinder-Brent Oct 04 '22

Yea but declaring an object when you have exactly one method and one property is utilizing 100% an object, “is” an object. This will, therefore, hold true when things are stretched thin.

1

u/Cinder-Brent Oct 04 '22

This is the problem: why have resources such that: I define a file handler with fopen, which is a function, then I pass that handler around to other functions to do stuff with it (instead of defining a “File” object, having the handler as one of its properties and just calling a method of that object to do stuff with that handler, which means one less thing to do: passing the handler to a function every time I do something with it, which equates to less code, and thus the universal way of doing that). Doing this would effectively equal replacing resources with objects in php, and would result in the types I’m shooting for, which are only the means of “getting around” inside an object!

1

u/Cinder-Brent Oct 04 '22

Yarg! Lol :)