Re:D as a Better C
by pmoriarty on Wednesday August 23, 2017 @01:03PM
(#15083176)
It is up to the implementation of a language whether that language is compiled or interpreted. For instance, there are C interpreters and Python compilers. Neither language is limited to being one or the other. It's just that usually people use C compilers and Python interpreters, but there's nothing inherent in those languages that limits them to those. It's all up to the implementation.
[ Parent
| on HN ]
This is true, but not always in a useful sense. There exist language features whose semantics are expressly dynamic, and if your language includes those features it will frustrate static compilation. For example, if your language includes `eval` (as Python does), then any precompiled binary would also need to include a complete Python interpreter. This is why efforts to compile Python (and other languages that are traditionally interpreted) often omit such features, and why languages that intend to be compiled tend to forgo them in the first place.
Which is why for me the best way is to be able to choose between JIT/AOT deployments, instead of a plain interpreter.
Maybe one day PyPy will finally become the default option.