Let's say you have a programming language C, and a programming language C+.

Every valid C program is a valid C+ program, but not the other way around.

There can be at least two ways in which this happens:

1. C+ is "stricter" than C, but the strictness is optional: you can e.g. add type signatures that don't exist in C.

2. C+ is more "featureful" than C. E.g. it adds generics or whatever.

Is there a way to distinguish those two rigorously? Or is there no underlying deep difference?

@niplav Run a C+ compiler on your program? Wouldn't that distinguish the two as rigorously as possible?

@redacted

Hm, that's not quite what I'm looking for. In this hypothetical, I guess I want to have some method of just taking the valid programs for C and C+ and then spitting out a 1 if C+ is stricter, and a 0 if C+ is more featureful. Like, what is the mathematical definition of those conditions?

Follow

@niplav Oh, I misunderstood and parsed "those two" as C or C+, not the two possible differences.

"Featureful" sounds sufficiently general to cover "stricter", so I'd *guess* there's no deep difference, but not with much confidence.

Sign in to participate in the conversation
Mastodon

a Schelling point for those who seek one