4 ms·
very cute, i like your sarc. for those who aren't familiar with transpiling, in this case it's kind of a legitimate use of the term: taking one flavor of compi
by cobbzilla 9y ago
very cute, i like your sarc.
for those who aren't familiar with transpiling, in this case it's kind of a legitimate use of the term: taking one flavor of compiled code (java bytecode, binary stuff that runs on a jvm) and translating that directly to another type of compiled code (wasm, binary stuff that runs in a browser)
- dmitrygr 9y agoThat is actually what compilation means.
- foota 9y agoThey're both bytecodes though? I don't see how that is compilation.
- maggit 9y agoCompiling is independent of source and target language, although it is mostly used to describe transformation from a higher-level human friendly language into a lower-level machine friendly language. Even so, the defined meaning of compiling is independent of the source and target languages. If you want to use the word "transpiling", you would have to define it in terms of compiling; transpiling is a special case of compiling, where the source and target languages have such and such properties.
- foota 9y agoIt's really just semantics, but Merriam Webster defines a compiler as "A computer program that translates an entire set of instructions written in a higher-level symbolic language (such as C) into machine language before the instructions can be executed"
- maggit 9y agoA dictionary really isn't a great source for the exact definitions of technical words. Wikipedia does much better in this instance: https://en.wikipedia.org/wiki/Compiler https://en.wikipedia.org/wiki/Compiler > A compiler is computer software that transforms computer code written in one programming language (the source language) into another programming language (the target language). Later on it lists some classes of compilers that could be called by more specific names than just "compiler".
- Certhas 9y agoThat would be recursive: "Compilation means taking one type of compiled code and translating it into another type of compiled code."
- kleiba 9y agoI suppose "compilation" usually refers to translating source code (as in human-readable) to some kind of byte code (as in machine-readable). Here, we start with Java byte code which isn't exactly human-readable, hence the use of the term "transpile". But then again, you're right that on some abstract level, it all is just a translation process from one representation to another. "A rose by any other name would smell as sweet."
- xg15 9y agoYeah, that's a good definition. My (less sarcastic) understanding was that "compiling" means translation from a "high-level"/"humans-first" to a "low-level"/"machines-first" language while "transpiling" is translation from one high-level to another high-level language. That would make gcc, clang (mostly) and javac clear examples of compilers while GWT, coffeescript and the C preprocessor would be transpilers. I guess TeaVM would fit neither by those definition but it would definitely be closer to a transpiler. Then again, I believe GWT calls itself a compiler, so I got nothing...