What does the code that makes up programming languages look like?

1.14K views

Take a language like Java. How was it originally created? I can’t wrap my head around how someone invented a computer language to run without having some “prior” language that it allows the first lines to function. Is it just Java all the way down, like someone wrote a single line of Java and then every other line was built on that?

What about the first computer language? What was the basis that that functioned on?

Thanks for any help, I hope that was phrased in a mildly intelligible way.

Edit; I’m trying to think of it like human language: at some point there was a first “word” spoken by someone and understood by another and from there the structure started to be born. What were the first “words” on a computer that led to where we are now?

In: Technology

36 Answers

Anonymous 0 Comments

ELI5 answer:
It look very, very simple.
The code that makes up programming languages itself is very simple.

The language can then be quite complexe. Java is one of the worst example you could pick, because it is an interpreted language (this means than it relies on another programm, the interpreter, to run).

But the codes that build it is simple.

It starts with basic instructions:
I want to add data. Instruction: add
I want to store my result: store

You might want to creat type: a byte might be an integer, or a character.

Then, you need to repeat the same instructions in your language.
You start to put a label at the start of your instruction: label my_little_routine
Then you say that you want to go to your label again: goto my_little routine

Then you say that this set of instruction should be used everywhere, so you create a function. This is a mechanism where you store your current data somwhere, then go to your label, then extract your data back from storage once you finish.

You can use a compiler of compiler to create an advanced programming language out ofthese basic operations: [YACC](https://en.wikipedia.org/wiki/Yacc) is one of them

Modern languages implement natively many high level mechanism called design pattern, which is why you are confused: templates in C++, interfaces in java, iterators in python…
These design pattern are common solution to frequent problems.

So we grow programming language, from simple, obvious instruction, to a complexe toolbox.

[Bonus track](https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/generalprogramming/ie_prog_4lex_yacc.html)

You are viewing 1 out of 36 answers, click here to view all answers.