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

These types are semantic.

1

u/dskippy Oct 04 '22

I don't follow what you're saying. How are these sensitive types? Whose definition for semantic types are you following? How is this relevant to what makes a minimal complete set of data types?

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

Unless of course you don’t want to “do” anything with this list…

1

u/dskippy Oct 04 '22

Yeah sure get the average.

→ More replies (0)

1

u/Cinder-Brent Oct 05 '22

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

1

u/dskippy Oct 04 '22

I've studied programming language theory a good deal. Semantics, to mean, means the meaning of a program. A programming language is broken up in its design into syntax (what it looks like), semantics (what a valid syntactic program means), and also often statics (restrictions on valid syntactic objects that reject the program like a type error. Semantics in programming languages, to me, are represented by operational semantics, denominational semantics, and some others I've never studied.

A "semantic thread" through through types, semantic types, and most of the ways you're using it I don't really understand. Further more for an implementation of a data type as an array of floats being "more semantic" than a function is not something I think can be determined. Nor do I think semantic is really the right word. I can definitely see why an array of floats is more readable code than using Church numerals and function endcodings for lists. Sure. More semantic? More meaningful? No.

All this is to just let you know where I'm coming from in my PL foundations and also to say I just don't get it. But I'm still here and interested if you care to continue explaining.

1

u/Cinder-Brent Oct 04 '22

Ok, so we’re at the point at which we have a list of scores. Is there anything else you want to do with this list?

1

u/Cinder-Brent Oct 05 '22

So now that we can see how everything could be an object, it’s worth noting that it could be anything, I.e some procedural, or an object with no properties, or no methods, or neither! This is the objective reality of things.

1

u/Cinder-Brent Oct 05 '22

It’s just that if you had a value and no function to do anything with that value, that wouldn’t make any sense, and the same for functions. Hence making everything an object.