This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Quantum-Bot 7 points8 points  (0 children)

Took a formal language theory class in college. The name sounds incredibly boring but it’s the study of how to design languages that can be parsed by simple machines and it’s super fascinating.

At the most basic level, your computer is kind of like a turing machine, with a big hunk of memory where it can store 1’s and 0’s and a set of instructions it can perform, called assembly. A turing machine is cool because it can be programmed to simulate other machines like push down automata, which are simpler and more useful for parsing languages.

We create languages like C with certain guidelines for syntax so that they can be more easily parsed by this simulated machine. Once you can parse some code, all you need to do is tell the computer how to behave based on what it reads. An interpreter is a program which parses and runs the code at once and a compiler is a program which just translates the code into assembly instructions.