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

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

On a related note, how do we turn electricity into symbols and letters, and then how do we make those symbols redirect electricity and run programs? We literally turn electricity into something intelligent and I will NEVER understand how.

Anonymous 0 Comments

[removed]

Anonymous 0 Comments

First there was binary. Then there was Assembly based on binary, which are a set of extremely elementary instructions about running memory instructions (stores, loads, jumping to different lines, setting flags, addition). All languages then stem from Assembly, or other languages.

Anonymous 0 Comments

This is a pretty good video explaining how machine code works:

I’ll try to ELI5:

When you build a computer chip it can perform some very elementary set of tasks. In order to make that chip useful, it is programmed with “microcode”. That microscope exposes to the user a VERY simple set of machine instructions. We call this “machine language” This machine language is extremely abstract with everything being represented by numeric codes. For example a 2 byte sequence AB 04 might mean “load the number 4 into the X register of the CPU”. CD 06 might mean add 6 to the value in the X register and store the result in the X register. 4C 5A 44 might mean store the value in the X register in memory location 5A44, etc. Machine code is EXTREMELY tedious to use, as you might imagine.

So, what kinds of programs might one write in machine code? Well, technically anything. If you’re a masochists. But among the first machine programs written was probably an Assembly Language compiler. What does a compiler do? It reads in some data and outputs computer code. To write a compiler you might define an “Assembly language” that allows users to write code that looks like this and store it in a text file.

LDX 4
ADX 6
STX 5A44

An assembly compiler could then read that file and create machine code from it, converting our text file into code the computer can actually run:

AB 04 CD 06 4C 5A 44

What kinds of programs can you write in Assembly? Well, technically anything but among the early assembly language programs written was a compiler for an even higher level language, like “c”. This compiler might let me write a program that looks like this:

counter := 4;
counter := counter + 6;
store_mem(5A44, counter);

We call these 3rd generation languages. But what if you want to write a coding game for kids where they write programs just by dragging icons around? What do you think that coding game does? It turns those squares and arrows in the kids programming game into C or assembler or some other language which in turn gets compiled into machine code. We call this type of code “4GL” or 4th generation language.

In short, we use super low level languages to write compilers or interpreters which allow us to write more human readable code, but that code just ends up getting “translated” back into a lower level language. At the end of they day, the only code your computer actually runs is machine code, everything else is just a layer of abstraction built on top of machine language.

Anonymous 0 Comments

There is a field called theoretical informatics which contains a field “formal languages & automata ([https://en.wikipedia.org/wiki/Formal_grammar](https://en.wikipedia.org/wiki/Formal_grammar))”. People in this field (around 1950, chomsky) tried to come up with grammatics using a certain set of symbols that could only be interpreted in one way (without giving a context).

Anonymous 0 Comments

Imagine you had a box full of Legos, but they’re all the flat 1×2 pieces. You could probably build anything you wanted, but it’s going to be a ton of work. That’s like the simplest, earliest computer languages, and represents the language the computer actually “understands”.

Newer computer languages are like the bigger, more complex Lego pieces. Instead of building a wall from scratch, you can just use a wall piece or an engine piece. That’s like newer programming languages. They are just bigger Lego pieces that let you build stuff faster, but at the end of the day, it all boils down to smaller Lego pieces that the computer actually understands.

Anonymous 0 Comments

Modern languages are what’s called high level languages, this means that they’re fairly understandable but us humans. Inorder to run a piece of code must be compiled.
Most code is compiled ina compiler written in that language but the first compiler would be build in the language before it… All the way back to basically coding in raw binary or with punch cards. You make a program in raw binary at much expense and effort that can interpret a higher level code and compile it down into simpler code only the machine can understand. You use this for a while then build anew compiler in your new language, compile it with the old one and now you nmdont beedtheold language at all. It’s about of a cycle

Anonymous 0 Comments

Alan Turing, the father of modern computing, used a giant machine with cogs to decrypt nazi messages in ww2. With the aid of mathematicians, he would take very large numbers and “encode” them into cogs, then run the machine and check the result. The cogs were arranged in such a way that as they moved, they would affect each other in a way that could be seen as “calculating”. The result would help them discover what the encrypted messages could mean.

Try to look at languages the same way as you look at the cogs. We “encode” some meaning onto the machines, and from this we create language. No different to how each word you are reading right now is really an encoding of symbols that represent sounds of a language you understand.

We simply make a machine that does an operation and then we say “let that operation, represent this thing”.

Java is decades ahead of Alan Turings Bombe machine, and he himself was decades ahead of the ideas that sprouted computer science, particularly set theory. Algorithms as an idea has also been around for centuries, so it’s hard to pick a point and say “it started here”. Many of computer science ideas are taken from maths.

Anonymous 0 Comments

The code is assembly where you manually instruct the computer to set values, move values, and perform mathematical operations on those values. The values are 1’s and 0’s,or sets of those. Everything that a computer does is represented by these values. However, programmers created layers of code to abstract from this hard stuff. They created simple commands to perform dozens of assembly actions at once. Over the years, it got easier to write code as the layers were added and perfected and standardized.

Programming languages are higher layers that interact with lower layers in different ways. Some are more efficient at performing tasks. Some are easier to understand. Some make code that can be reused more effectively and shared. Which one is best is subjective.

In the end, it is all about talking to the various parts of a computer and moving values from point A to point B. Everything else is about aggregation of combinations of those actions.

Anonymous 0 Comments

Like you’re 5?

You first learn to make letters. Then you learn how to make words out of those letters. Then sentences, and paragraphs, and …. eventually you’re at Wikipedia.

Computer chips do simple things. If you put enough simple things together, you can do something complicated. If you put enough complicated things together, you can do something REALLY complicated.