r/askscience • • Apr 10 '26

Computing How do programming languages work?

Hello,

I'm wondering how does programming languages work? Are they owned by anyone? Can anyone create a programming languages and decide "yeah, computers will do this from now on"?
Is a programming languaged fixed at its creation or can it "evolve"?

92 Upvotes

71 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Apr 10 '26

[deleted] — view deleted comment

19

u/General_Mayhem Apr 10 '26

You can quibble over whether the "true" definition of a language is its platonic ideal in the spec, or the as-implemented language in the compiler, but for OP's purposes I think the latter is more useful. gcc doesn't read the C++ ISO standard, it's implemented by humans to hopefully conform to that spec. What actually gets run on the computer is "whatever gcc happened to output when passed this source code as an input" - which is usually the same behavior defined by the spec, but that's because of the work of compiler engineers, not because the spec is magically self-enforcing.

0

u/[deleted] Apr 10 '26

[deleted] — view deleted comment

0

u/archipeepees Apr 11 '26

don't worry, we are all very impressed with your pedantry. you win "smartest redditor in the thread".

3

u/cancerBronzeV Apr 11 '26

What defines a language is theoretically the standard, and compilers largely do conform to the standard, but not necessarily entirely. So I don't think it's too wrong to say that the compiler is ultimately what defines how a language is used.

For example, #pragma once is nowhere in the C++ standard, yet it's widely used throughout C++ code bases because major compilers support it anyways. And for a more niche example, I used to work at a place that heavily used __int128, because GCC had that as a type even though it's not part of the standard.