2 ms·
To clairify (because usually noone ever does and the conversation goes around in circles) "compile to machine code" (in the conext of language design, rather th
by a1369209993 7y ago
To clairify (because usually noone ever does and the conversation goes around in circles) "compile to machine code" (in the conext of language design, rather than implementation details) means, idiomatically, to compile specific parts of the program to specific and (allegedly) predictible pieces of machine code.
This is standard in C (and allegedly C++ and rust), awkward but somewhat doable in Java, C#, and some of the weaker LISPs, damn near impossible in Haskell, Javascript, etc, and completely impossible in "real" LISPs (with first-class macros and/or fexprs).
It's obviously always possible to "compile" a (interpreter,somewhat-preprocessed-program) tuple for any language (give or take turing-hard/easy-ness) and you can usually inline/specialize/optimise the interpreter a lot for one particular program (Haskell/ghc is a good example of this), but that's not what people mean when they talk about designing a language to compile to machine code.