3 ms·
A transpiler is typically converting from one high-level language to another. Assuming that the level referred to by the phrase "high-level language" is level o
by jgwil2 5y ago
A transpiler is typically converting from one high-level language to another. Assuming that the level referred to by the phrase "high-level language" is level of abstraction, then yes.
- ModernMech 5y agoThis always gets bogged down in the definition of a "high-level langauge". From my perspective, assembly is a high-level language.
- jgwil2 5y agoIt's all relative, sure, but we can also reasonably assert that Python, Ruby, Java are all operating on the same level of abstraction because we as programmers can largely ignore the details of the computer architecture of the machine they're running on, which isn't possible in assembly. An argument could be made that any compiler that can ignore such details can be called a transpiler.
- ModernMech 5y agoThe details can go very deep. It’s not that you can ignore the details, it’s that you can ignore some but not others, as in every language. Assembly also “largely” ignores the details. After all, assembly is an abstraction over other languages. But now your “definition” of a transpiler depends on a subjective measure of “sameness”. For instance, you called Python and Java the same level of abstraction, but in Java a lot of concern is devoted to properly typing numbers, whereas in Python this concern is ignored. If I really didn’t have to worry about the underlying hardware architecture, I would never care about the difference between a 16 bit and 32 bit number. Why aren’t 17 bit numbers a default type in Java? Why are there different sizes at all? Why can’t I just make everything infinity bits so I don’t have to worry about overflows? The answer to these questions have more to do with computer architecture than with Java. And Java is even worse because now there are two machines: the hardware one and the virtual one, which is hard to always ignore. For some applications you can ignore the GC entirely, for others ignoring the GC will lead to catastrophic failure! So is Java higher or lower or the same as Python? Depending on the axis measured, probably all three! This is why people say it’s not so cut and dry. Any time someone puts down a sharp line, it’s easy to blur it. Which usually indicates there is no line at all.
- jgwil2 5y agoGood points. Poke any abstraction enough and you will find holes in it. However, the question I was originally responding to was asking if same-level-of-abstraction-ness was fundamental to the definition of a transpiler. I would still argue that it is, in the common understanding of the terms. It may be the case that those terms are not particularly useful. Certainly from a technical standpoint, I would agree that it's not useful to try to force a distinction between transpilers and other compilers. If the goal is conveying the basic purpose of a project, maybe the term is of some use.