3 ms·
You can probably draw a sharp line in two ways: 1. You're interpreting if syntactic tokens directly drive evaluation. So only first two are interpreted. 2. In
by naasking 4y ago
You can probably draw a sharp line in two ways:
1. You're interpreting if syntactic tokens directly drive evaluation. So only first two are interpreted.
2. Interpreters take syntactic input and evaluate to a result that comes from running the program, a compiler takes syntactic input and outputs a program that must then itself be run to compute the result.
That said, I agree that "interpreted language" or "compiled language" is not a formally correct term, it's a connotative definition implying what's typical or the purposes for which a language may be suited.
- 082349872349872 4y agomy sharp line is "what do you see when profiling?" if you see the program's inner loops, it's been compiled if you see the language's inner loops, it's being interpreted
- naasking 4y agoWhat about qsort?
- 082349872349872 4y agosame thing, only what you see will tell you whether the library in which qsort was defined has been compiled or is being interpreted. ie, in the latter case, you'll see the language's dispatch loop in the "hot" range, as it interprets the def'n of qsort at multiple recursion levels... (and this signature will be independent of whether or not calls in each level are made on their own or combined horizontally to gain nested parallelism)
- naasking 4y agoI think you're missing my point, which is that the language is providing qsort as part of it's standard library, so the indirect function call within qsort counts as the "language's inner loops", no?
- 082349872349872 4y agoWe're talking past each other; I'm making a distinction between a language and its libraries which you are not making. Consider a simpler example: let's profile not just qsort, but a couple of other relatively long-running library calls, and let's strip the executable beforehand, so we aren't even working with symbolic information, just a bunch of code addresses. If we get multiple different hotspots, we're likely looking at a compiled library. If we get the same hotspot in each case, we're likely looking at an interpreted library (and seeing the interpreter's dispatch loop).
- naasking 4y agoThe fact that you have to use "likely" means it's just a guess and no longer a sharp "line in the sand" as I originally described. Languages that operate on large data structures (like Julia and R) may have a similar design to using higher-order/callback functions like qsort everywhere, but those hotspots will always be in the language/standard library even when programs are compiled. I just don't think it's a reliable enough metric for this distinction.
- 082349872349872 4y agoMakes sense. Come to think of it, I would also caveat threaded (as in forth subroutine-threading not as in thread-local) code as showing up fuzzily for my approach.
- ErikCorry 4y agoIt really depends which profiler you are using. If you profile with a profiler designed for the low level language you will see more level things.
- 082349872349872 4y agoprofiling at the executable/machine-code level