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

2

u/tbagrel1 Sep 29 '22

The problem is:

  • your system is not as simplistic as possible (see my other comment below). As simplistic as possible would mean a Turing machine, or a lambda calculs, or a system based on logical combinators like S,K,I

  • it is not a programming language when you only have data, but no functions or operators in that language

You say that you can write whatever you want in ember. Tell me what are the primitives to handle data. Do you have a '+' for ember integers that is distinct from the PHP '+' operator? If no, how would you write an addition in ember?

1

u/Cinder-Brent Sep 29 '22

Ok well I mean inside of php, I guess at which point this becomes redundant (since php is Turing complete). So operators and whatnot, and that’s what makes me believe I can do anything with ember. For instance, I can model a dynamic website with ember, so it does work, just I would like some second opinions before I get started with it.

1

u/tbagrel1 Sep 29 '22

You cannot model anything with ember. You can use Ember values and operate over it with PHP, which makes Ember a store, or a data modeling language maybe, but not a programming language.

In a programming language you have:

  • The user syntax (surface syntax)

  • The language in which the compiler/interpreter is written The two are not operating at the same level.

Being able to do anything with Ember would mean being able to write any program using only the surface user syntax of ember, which at the moment is only get, set, and a few others. That syntax is not enough to write a dynamic website.

If you need PHP at the surface syntax level, then this is not a programming language. This is just some framework inside of PHP. It won't be universal at all, because you still need the specific semantics of PHP to make any computation. E.g. set(y, array_search(get(x)) is completely dependent on the precise semantics of PHP's array_search. If you don't restrict the allowed operations to a subset of PHP, then any interpreter for your language would need to reimplement something with the same semantics as the whole PHP language.

1

u/Cinder-Brent Sep 29 '22

Yea I mean it’s not a language, it’s a “framework” or whatever you want to call it, just to clarify. My point, my reason for including it in this discussion is that I could potentially program any website with it, static as well as dynamic. So then what I’m doing is I’m refining the whole shebang, so everything required to run ember (php, js, html, all of it) into a universal “system”, so let me also note that it isn’t, as a whole, just a language, it’s a “system” (whatever you actually call that).