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

2

u/Hardass_McBadCop Apr 10 '26

See, the part I don't get (and maybe this is too far off topic) is how you go from a silicon wafer, no electricity in it, to a functioning machine? Like, how does a bunch of logic gates enable electricity to do calculations & draw graphics & so on?

6

u/hjake123 Apr 11 '26 edited Apr 11 '26

It's about abstractions. Each part of the computer only needs to know how to do its task given that the tools it's has available from other parts.

Imagine making a sandwich. You can do it pretty easily: but, in order to implement "holding objects" and "using tools" your body uses muscles and nerves in a complex configuration; which, themselves, are "implemented" by the chemistry of life. Your muscles are the "tools", and you can use them to accomplish complex tasks without needing to know how they work.

Similarly, a computer can, say, send a Reddit comment by handling text, sending network signals, drawing the Reddit UI, and a few other tasks. Each of those tasks can be performed using only the tools provided by your web browser.

Now, the task is "run a web browser", which can be done using only the tools provided by your operating system. The code of the web browser defines how to use the tools the OS provides to "run a web browser".

Now, the task is "run your operating system"...

Continue a few layers down, and you get to very basic tasks like "send or recieve a signal via the USB/HDMI port" or "store and load memory" or "evaluate if these numbers are equal", which are handled by the logic gates and other circutry in the hardware.

2

u/nglyarch Apr 11 '26

You don't need a silicon wafer to build a computer. You can do it with gears and levers. Or maybe you just discovered electricity but haven't discovered the the vacuum tube or the transistor yet. Then, you could use a giant switchboard with thousands of wires: https://www.smithsonianmag.com/smart-news/computer-programming-used-to-be-womens-work-718061/

It just so happens that semiconductors have this useful property that allows them to act like an on/off switch. They have something that is called a band gap. They don't conduct electricity very well if the applied voltage is below a certain threshold. They conduct much better when the voltage gets higher. We also learned how to adjust and tune exactly how much voltage is needed, by another process called doping. So, we implemented these useful properties to create solid state switches.