r/ProgrammingLanguages • • Sep 01 '26

Discussion What is the interesting part of a programming language to you?

I've been working on some "documentation" for my own language (see here), which got me thinking: do we all see languages the same way? I personally look for unification of concepts and extensibility in a design, yet I've seen those who care deeply about functional purity or clean decompositions.
What do you look for in a programming language? And why?

33 Upvotes

111 comments sorted by

View all comments

Show parent comment

1

u/Potato871 Sep 02 '26 edited Sep 02 '26

It's a bit easier to attack the problem (obviously the problem is still very hard) with how my compiler is constructed, I have more of an annotated graph of nodes with shared values, so I can put quals on a value and it propagates that fact around.
For instance, we could say each length_relation_qual holds a numerical index and considers the original value it is derived from to be its parent rather than what it holds.
Each math operator, if RHS is a literal or constant, just becomes enter the execution stage and perform the operation that operator would normally do but substitute the left argument for the qual's value.
Then at any site where the length_relation_qual fires it already holds the record of what operations have been applied to the value it repersents.
Then I can do the same walking I do during evaluation stage optimizations for control flows and such to further propagate this information along constant branches and whatnot. Then the index in a loop falls out on its own.

2

u/reflexive-polytope Sep 02 '26

What “shared values”? I'm talking about compile-time analysis of symbolic expressions, not runtime checks on concrete values.

1

u/Potato871 Sep 02 '26

Ah, I should've been clearer, in GDSL a "Value" is the data/semantic part attatched to a node.
So:

6+6

Looks like PLUS[LITERAL, LITERAL] where each of those Nodes has a Value attached, when I do a declaration like:

int a = 6;

All instances of 'a' are different nodes with the same value.
That's why, if the compiler attaches a symbolic fact like "n is related to the length of a" to n's Value, every use of n can see that same fact.
That doesn't solve the analysis problem by itself, but it means the compiler has a natural place to store and propagate those symbolic relations through later operations and control-flow analysis.

2

u/reflexive-polytope Sep 02 '26

Sure, these techniques to propagate already known information are indeed very useful.

But they only make doable analyses faster. They don't make impossible analyses magically possible.

1

u/Potato871 Sep 02 '26

Yeah, I tend to come at things from a lens of 'tell me what line it failed on and I'll fix it', mainly because I care about how can I get data around and easily extend capabilities more than how can I catch bugs early.
But that's why I started this thread, to see how other people treated languages and what they cared about.
Thanks for the challange! It was a productive use of a Wednesday, and now I have some extra tools I needed for my query system.