I am researching CoffeeScript on the website http://coffeescript.org/, and it has the text
The CoffeeScript compiler is itself written in CoffeeScript
How can a compiler compile itself, or what does this statement mean?
The first edition of a compiler can't be machine-generated from a programming language specific to it; your confusion is understandable. A later version of the compiler with more language features (with source rewritten in the first version of the new language) could be built by the first compiler. That version could then compile the next compiler, and so on. Here's an example:
Note: I'm not sure exactly how CoffeeScript versions are numbered, that was just an example.
This process is usually called bootstrapping. Another example of a bootstrapping compiler is rustc
, the compiler for the Rust language.