4 ms·
I think compiling via LLVM is probably a better idea than compiling via Go.. (Also why do people invent a new word 'transpile', when the old word already perfe
by eru 4y ago
I think compiling via LLVM is probably a better idea than compiling via Go..
(Also why do people invent a new word 'transpile', when the old word already perfectly describes translating from one formal language into another?)
- erik_seaberg 4y agoIt feels like stolen valor to say I've written a compiler when I'm really relying on someone else's compiler.
- deleted 4y ago[deleted]
- eru 4y agoWell, that's what LLVM does, too. You compile to LLVM's intermediate language, and they compile further.
- chrisseaton 4y ago> Also why do people invent a new word 'transpile' Not this ignorant myth again - it isn’t a new word, been in use since mid 60s. A transpiler is a form of compiler from high-level language to high-level language. A compiler didn't even originally translate, but just link. The same way ‘navy’ is a kind of blue but we can say navy and add a little more specific information. Nobody rails against navy saying ‘but it’s just a shade of blue!’
- eru 4y agoI didn't say 'transpiling' was a newly invented word.
- chrisseaton 4y agoI thought you asked? > Also why do people invent a new word 'transpile', when the old word already perfectly describes translating from one formal language into another? The answer is... the old word ('compiler') didn't mean what it does today, back in the 60s, when 'transpiler' was coined. Compiler with its current meaning isn't a much older word than transpiler - they're near contemporaries (50s and 60s). Before that a compiler meant a linker. Your criticism doesn't match up with the history.
- eru 4y agoOk, that makes sense. I had thought 'compiler' was from the 1950s and already had its modern meaning. Of course, if we had more rational vocabulary, we'd call them 'translators' instead. (In fact, that's what German does. Perhaps they coined their corresponding term a bit later, when things had already shaken out a bit more.)
- serhart 4y agoThat is absolutely not true. Just because early compilers acted more like linker/loader doesn't mean they used the word compiler to mean "linker". When the term was coined it absolutely meant translating mathematical formulas into machine code. Compiler very much had the same meaning it has today.
- chrisseaton 4y agoSorry that's not my understanding of the history - early compilers were more like what we'd call today template compilers - linking blocks of pre-defined machine code together.
- serhart 4y agoYes, that is very much what they were. However, they used the term compiler in very much the same way it's used today. It didn't mean something different. The concept of the "compiler" was to translate mathematical symbols (or predefined machine code representing that math) and later English like words into programs a machine could execute.
- layer8 4y ago> the old word already perfectly describes translating from one formal language into another The word “compiler” actually doesn’t do that (like, say, “translator” would). “Compiler” originally referred to something more like what is today called a linker. It “compiled” (put together) a set of subroutines (in assembly/machine code) into a combined executable.
- eru 4y agoI know that the etymology of compiler is a bit weird. But its current meaning is perfectly fine.
- layer8 4y agoYou were arguing that the word “perfectly describes translating from one formal language into another”. The word doesn’t do that, as it’s not descriptive in that sense. Furthermore, translating from (say) JSON to XML is also “translating from one formal language into another”, but that’s not an example of what we mean by “compiler”. So what do we mean? That’s actually not easy to define. Defining it as translating from one programming language into a different programming language isn’t quite correct, because machine-code binaries aren’t a programming language. Defining it as translating from a programming language into a different representation preserving the program semantics is also not quite correct, because e.g. pretty-printing to HTML would arguably fit that definition. Clearly there’s some general definition of what we mean by “compiler”, even if I’m failing to find a precise and correct wording for it here. But there’s also the more narrow meaning of “translating from a programming language into object code”, which is what is usually meant in the majority of cases. Because we don’t have a separate word for that narrower definition, there is some ambiguity. The word “transpiler” resolves the ambiguity in one direction. In the other direction, the ambiguity is usually resolved by assuming that “compiler” means “to object code” by default when the context doesn’t specify otherwise.
- eru 4y ago> Furthermore, translating from (say) JSON to XML is also “translating from one formal language into another”, but that’s not an example of what we mean by “compiler”. I'd be perfectly happy to describe that as a compiler.
- vnorilo 4y agoTranspiler is a pretty old word too. My understanding is that it's a compiler whose output is human readable. Readability is more about whether it is an explicit goal: all compiler output is readable by some humans. I don't think anyone would say Unity's il2cpp is a transpiler even though it compiles .net bytecode into C++: producing readable C++ is a non-goal for il2cpp.