4 ms·
I think, by now "transpile" just means "compile, but in web development". Because, as we all know, web development you never compile things... /s
by xg15 9y ago
I think, by now "transpile" just means "compile, but in web development".
Because, as we all know, web development you never compile things... /s
- stefano 9y agoCompilation is for old people writing old programs that run on old things called "computers". We're fresh and new and iterating quickly on our MVP, so we don't have time to wait for long compilation time. Instead we transpile our code and run it in a serverless environment, a docker container or a browser.
- progman 9y ago> ... and run it in a serverless environment, a docker container or a browser. ... Waiting for tens of seconds, or minutes, until all the JS libs are loaded into their GB's of RAM by their GHz multicore processors while those old veterans compiled all their stuff within a second on their ancient Turbo Pascal on their ancient MHz CPU's with barely noticable 64K RAM :-)
- cobbzilla 9y agovery 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...
- diegoperini 9y agoWhat is the difference between cross-compile and transpile? (Honest question, no sarcasm)
- nothrabannosir 9y agoThe way you write them.
- Touche 9y agoDoesn't "cross-compile" mean to compile a binary meant to run on a different platform than the host? Like, compiling a Linux binary on a Mac... If I'm right then that's nothing like what "transpile" means.
- progman 9y ago"Transpile" is an artificial buzzword, just meaning source-to-source translation, from Pascal to C for instance. Actually, there is no such thing as a "transpiler". There are only compilers which are programs which translate from one regular language A into another regular language B. It doesn't matter whether B is a high-level language or low-level machine code.
- Touche 9y agoYes, it's another word for source-to-source translation, you are right. It is not, however, cross-compilation, which is what I was responding to. So I'm not sure why you replied to me with this statement. In any event, is it so bad to have another word for source-to-source compilation? What is it that angers you about it?
- progman 9y ago> is it so bad to have another word for source-to-source compilation? If you compile C to Assembler then you compile from one code (C) to another code (Asm, or machine code which is the compact form of Asm). What's the difference to a "transpiler"? Wikipedia states that the difference is just the (almost) equal level of abstraction. I would call such a thing a high-level source-to-source compiler. The word "transpiler" is uncertain and barely known, hence the people here who ask what a transpiler is. Cross-compilation is another thing since it means compiling on one platform for another platform. In all three cases we deal with compilers from one regular language A into another regular language B.