My compiler textbook (dragon book 2e from the 80s) credits Backus et al. For having invented the Fortran compiler. I have heard much about Grace Hopper having invented the first ever compiler, but when I looked her up, wikipedia says she created program linker, which was called a compiler at the time.
So who invented the compiler? What is the program that Gracce Hopper invented in 1952?
Hopper wrote the first working compiler for a general-purpose programmable computer, and introduced the name "compiler". However, it is true that Hopper's first compiler was, in modern terms, a linker rather than a compiler (it "compiled" a program out of pre-existing subroutines plus some code to join them together, rather than translating human-written high-level code into machine-executable code). Hopper called her program a "compiler" because the same process, done by humans by hand with stacks of punched cards, was called "compiling" (because they were compiling a complete programs from sections). Hopper's compiler, called "A-0", was written for the UNIVAC, and was in use in 1952.
The idea of a compiler, in the full modern sense, was a few years older. Konrad Zuse, who in 1941 completed a Turing-complete electromechanical programmable computer, the Z3, developed the idea of the compiler a few years after the war. His Z3 (in Germany) had been destroyed by bombing, but its successor, the Z4, on which he began working in 1942, survived. He developed a high-level programming language for the Z4, "Plankalkül" (which can be translated as "planning system"). He was able to resume work with the Z4, and continued work on Plankalkül and a compiler for it, "Planfertigungsgeräte" ("plan preparation device"). Planfertigungsgeräte wasn't completed, although the design was improved (and its name changed to "Programmator" in 1952). In addition to translating the high-level human-written code into executable instructions, the design also included syntax checking of the high-level code.
Zuse sold his Z4 to ETH Zürich in 1949, making it the world's first fully-functional commercial digital computer (the Eckert-Mauchly Computer Corporation sold BINAC to Northrop earlier in the year, but it never worked properly, so fell short of that "fully-functional"). Heinz Rutishauser, who worked with Z4 at ETH Zürich provided another key idea towards the modern compiler: the "Programmator" (i.e., compiler) could be a program running on the computer itself, rather than a separate device.
In additional to these, a working compiler had been developed for the mixed electronic-electromechanical Harvard Mark III by Howard Aiken. This translated high-level commands into instructions that the machine could execute. The Harvard Mark III was completed in 1949, delivered to the US Navy in 1950, and was in use in 1951. Thus, its compiler is the first compiler to be used. However, it was a programmable calculator, rather than a general-purpose computer. It also fell short of Rutishauser's ideal, being a separate device rather than a program running on the Mark III (the Mark III, and most other early computers did not store their programs in memory, instead reading them from a stack of punched cards one card at a time (or instruction-by-instruction from punched tape, etc.) - this type of system would have made it difficult to implement an on-computer compiler program.
This earlier development is the context of Hopper's compiler. Her definition of a "compiler" was a:
program-making routine, which produces a specific program for a particular problem.
The "A" in the name A-0 came from "Automatic Programming", as per her definition of "compiler". Her A-0 of 1952 was followed by A-1 and A-2 in 1953.
The first compiler for computers which stored their programs in memory was developed shortly afterwards. This was developed in the early 1950s for MIT's Whirlwind I, developed for the US Navy in 1951. The never-named compiler, developed by J. H. Laning and N. Zierler at MIT, was published in January 1954 ("A Program for Translation of Mathematical Equations for Whirlwind I"). While Whirlwind I was a general-purpose computer, the US Navy saw it as essentially a programmable calculator, and its compiler was written with use as a calculator in mind (like the Harvard MkIII compiler). Whirlwind I was hugely influential - it was one of the pioneering stored-program computers, used magnetic-core memory, and via its successor Whirlwind II greatly influenced future computers. However, the Laning-Zierler compiler failed to have a similar impact.
The FORTRAN ("Formula Translation") compiler of 1957 by John Backus and his team combined all of the elements of the modern compiler. It was designed for general-purpose programming, rather than being a fancy programmable calculator. It ran on-computer (the IBM 704 it was developed for was a stored-program computer).
Who invented the compiler? The answer depends on how strictly you define "compiler". With the narrowest definition that still included compilers such as those developed for FORTRAN and COBOL, the first compiler was developed by Backus. However, the idea goes back to the 1940s, to Zuse and Rutishauser. For looser definitions of "compiler", the candidates are, in chronological order of implementation, Aiken, Hopper, and Laning and Zierler.
The early history of compilers presents us with interesting questions of priority not too different from those of the early history of radio (e.g., Marconi vs Tesla vs others)!
Further reading:
Paul E. Ceruzzi, A History of Modern Computing, 2E, MIT Press, 2003, especially chapter 3, "The Early History of Software, 1952-1968".