3 ms·
It's a long (but good) article, so don't miss the conclusion: > Another thing I hope that I've indirectly shown, or at least hinted at, is that any language ca
by eatonphil 4y ago
It's a long (but good) article, so don't miss the conclusion:
> Another thing I hope that I've indirectly shown, or at least hinted at, is that any language can be implemented in any style. Even if you want to think of CPython as an "interpreter" (a term that can be dangerous, as it occludes the separate internal compiler), there's PyPy, which dynamically compiles Python programs into machine code, and various systems which statically compile Python code into machine code (see e.g. mypyc).
(Emphasis mine:)
> There are interpreters for C and C++ (e.g. Cint or Cling).
- dcow 4y agoYes this is a well written and fun piece. I suspect when most people say X is a compiled|interpreted language, they are semantically meaning "the de facto implementation of X is..." but nonetheless, this piece is one of those moments that really revisits and unambiguously resolves a discussion that many probably hadn't bothered to worry about for years. In other words, I think I decidedly have a new take for the next time this type of questions comes up over lunch (:
- saurik 4y agoWhat was your old take from before reading this article?
- dcow 4y agoI probably would have entertained one of the two stances "X is compiled" or "X is interpreted", not questioning the implied "de factor implementation of X..." and engaged in a pedantic back and forth. Now I'd probably link this article and argue "it depends on the implementation" and ask "what is a compiler anyway".
- deleted 4y ago[deleted]
- jacquesm 4y ago> There are interpreters for C and C++ Usually those are for (large) subsets of the language though.
- eatonphil 4y agoSulong is another. But yeah maybe not 100% compatible, I don't know. https://github.com/graalvm/sulong/blob/master/docs/ARCHITECTURE.md https://github.com/graalvm/sulong/blob/master/docs/ARCHITECT...
- stabbles 4y agoAren't C++ compilers also interpreters for large subsets of the language, all the template / constexpr / consteval stuff ;)