The weekly ponderable!
I've often thought, how are programming languages made? Why does VBA know that For i = 1 to 10 means it has to use the variable i = 1, then i = 2, then i = 3, etc... How does it even know what a variable is!? How does it know what each character is meant to do?
We type all of these words into a programming editor, but have you ever wondered how really simple it is all made, even when it seems incredibly complex? Would it be just a bajillion 1's and 0's?
You can find an example of the class module
clsEquation.cls in
BASLIBS.ZIP to see how it works in VB.
I've often contemplated this:
If you need to know a computer language to create a new computer language then how did they create the very first computer language?
Sounds like egg and chicken paradox
The similar question - can you write programs that write programs?
The known sentence from "C Programming Language" of K&R states that the C compiler is written in C.
Nowadays a plenty of compilers for programming languages are written directly in the target language.
This programming nonsense is based on
"Self-hosting" or
"Bootstrapping"
One of the possible ways, in which human is a part of the compilation process, includes:
1. Writing of compiler’s source code using the target language
2. Manually translating it to another language
3. Compiling of the translated source code. This magic can be made even by hand!
Once the working compiler is made it can be used to compile the original sources directly, and manual translation is no longer necessary.
Compilers tend to require a wide range of algorithmic techniques and a variety of data structures.
Therefore if the language can implement a compiler it's likely to be useful for most other tasks as well.
The language, which is not powerful enough to write its own compiler, in some jargon is called as "My Favourite Toy Language" (MFTL)
and refers to anything (simple) that you can't write a compiler with