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

1.11K 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

TLDR:

You use older programming languages to teach the computer to understand newer programming languages. The first programming languages were taught directly to the computer by writing their machine code (the thing the computer actually understands itself) directly.

Longer answer.

You use programming languages to make programming languages. Programming languages come in two varieties (generally). Compiled and interpreted.

Compiled languages are translated down to assembly or machine code, something the computer understands by virtue of it’s design. Here you “create a language” by writing a program in a different language that takes code written in your new language and turns it in to machine language. You can later rewrite that compiler in your new language to detach it from the old language.

Interpreted languages are translated on the go. Here you have a program that takes the code written in your new language, looks at it, and tells the computer directly what to do.

Java is interpreted. The JVM that runs Java code has a few versions but the most common are written in C or C++.

the “First” programming languages were taught to computers by directly writing the machine code for them by hand in to memory of the computer. Depending on how old you want to go this can be applied with literal switches on the side of the computer, punch cards, or a keyboard that you can type in to the computer’s memory.

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