logoalt Hacker News

notepad0x90today at 4:23 AM1 replyview on HN

I don't disagree, so in a way, compilers are the specification that implement the standard? That doesn't feel right though.


Replies

skydhashtoday at 4:31 AM

Compilers are converters. There’s the abstract machine specified by the standard and there’s the real machine where the program will run (and there can be some layer in between). So compilers takes your program (which assumes the abstract machine) and builds the link between the abstract and the real.

If your program was a DSL for steering, the abstract machine will be the idea of steering wheel, while the machine could be a car without one. So a compiler would build the steering wheel, optionally adding power steering (optimization), and then tack the apparatus to steer for the given route.