Question about inventing a language program

Click For Summary

Discussion Overview

The discussion revolves around the origins of programming languages and compilers, specifically focusing on FORTRAN and the concept of the first compiler. Participants explore how compilers are created, the nature of machine instruction sets, and the historical context of programming language development.

Discussion Character

  • Exploratory
  • Technical explanation
  • Historical

Main Points Raised

  • One participant questions how the inventor of FORTRAN created the compiler, suggesting that a compiler is itself a program that requires a language to function.
  • Another participant explains that the first compiler must be written in the computer's native machine instruction set, which translates commands into raw machine instructions.
  • It is noted that FORTRAN was not the first high-level programming language, with COBOL being mentioned as an earlier example, and Grace Murray Hopper credited with conceptualizing such languages.
  • A participant seeks clarification on what a native machine instruction set is, asking whether it requires building a computer to recognize specific syntax or if it involves modifying the computer itself.
  • Further elaboration is provided on the nature of native instruction sets, describing them as binary strings that CPUs recognize, with an example of how early computers were programmed using physical switches.

Areas of Agreement / Disagreement

Participants express varying views on the historical development of programming languages and compilers, with some agreeing on the necessity of a native instruction set for compilers while others raise questions about the implications of this requirement. The discussion remains unresolved regarding the specifics of how the first compiler was implemented.

Contextual Notes

There are limitations in understanding the exact mechanisms behind early compiler development and the definitions of machine instruction sets, as well as the historical context of programming languages.

fluidistic
Gold Member
Messages
3,934
Reaction score
286
I am wondering how the man that invented FORTRAN did so.
More precisely :
It is not really the language that he invented but more likely a compiler that would understand some syntax that we call "language". So how did he write its compiler? In order to make it work it necessitate a compiler itself, or in other words, the compiler is a program itself. Am I right?
So if I continue... how was invented the first program? How was it writed I mean, and compiled or executed...
 
Technology news on Phys.org
the first compiler (or similar "language" tool) for any computer has to be written in that computer's native machine instruction set. once you have implemented any 'general purpose' programming instruction set (and yes, the compiler is itself just a program that translates one kind of command into raw machine instructions)...once you have the first compiler, other languages can be implemented for the same computer with less effort by using the first language to program the second language's compiler.
 
and incidentally, FORTRAN was not the "first" high-level, general purpose programming language. COBOL was. and, the concept of creating languages like FORTRAN was dreamed up by a woman (Grace Murray Hopper).
 
Thank you very much for the information.
But still I wonder about
the first compiler (or similar "language" tool) for any computer has to be written in that computer's native machine instruction set.
what is exactly the native machine instruction set? Does that mean that we have to build a computer in such a way that it would recognize a specific syntax? If yes, how can we build that? If no, does that mean that we have to "change" what does the computer in order to make it work as a compiler? If yes, how can it be done?
And yes, I understand that when we already have a compiler and a language, it's easier to "invent" another compiler and language.
 
fluidistic said:
Thank you very much for the information.
But still I wonder about what is exactly the native machine instruction set?

All computers have a native instruction set that their CPUs are "hard-wired" to recognize. In its most fundamental form, an instruction is a string of 0's and 1's (binary bits).

For example (just to make up a hypothetical instruction format on the spot), an instruction might consist of 32 bits, of which the first eight specify the particular operation (add, multiply, jump, etc.), the next four are "modifiers" that specify variations on the basic operation, and the remaining twenty bits are the address (in RAM) of the data that the operation is to act on. Different models of CPU chips have different instruction sets.

When I was an undergraduate in the early 1970s, I played with a computer that could be programmed by setting a row of switches (on the front panel), which represented either a machine instruction or a RAM address, in binary notation. To program it, I first set the switches to represent the RAM address where I wanted to put the first instruction, then pressed a button to tell the machine to use that address. Then I set the switches to represent the actual instruction, and pressed another button to load the instruction at that address. I think it automatically incremented the address by one, so I could enter the instructions one after the other without having to set the address explicitly each time. When I was done, I set the address switches to the address of the first instruction and pressed the "run" button.

Normally, I ran programs that had already been punched onto paper tape in a binary code, by reading them in with a paper tape reader. But before I could do that, I had to load a short program to drive the paper tape reader, by using the switches.

(For any fellow grey-beards who happen to read this, the computer was a Digital Equipment PDP-5, if I remember correctly.)
 
Last edited:
Thanks jtbell, I found what you wrote very interesting.
 

Similar threads

Replies
6
Views
3K
Replies
65
Views
5K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 122 ·
5
Replies
122
Views
18K
Replies
59
Views
9K
  • · Replies 59 ·
2
Replies
59
Views
9K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
16
Views
3K