This is like the classic causality dilemma on "chicken and egg" question. Here is what I think the sequence of how it comes:
- Machine code: The 1st program was written directly in the hardware's machine code
- Assembler (Interpreter): A program written in machine code to interpret ASM into machine code.
- Compiler: This is a set of programs (lexical analyser, parser linker etc) which could convert source code to assembler/machine code.