Live data from Hacker News

Transpiler, a Meaningless Word (2023)

people.csail.mit.edu

81–90 of 117 posts

Re: Transpiler, a Meaningless Word (2023)

#81

A compiler takes in one language and outputs some other language. E.g. C to LLVM IR or LLVM IR to x86_64 assembly. An assembler is a type of compiler that takes in an assembly language and outputs machine code. A transpiler is a type of compiler that takes in a language commonly used by humans to directly write programs and outputs another language commonly used by humans to directly write programs. E.g. c2rust is a…

Partial evaluators would also be considered cispilers.

Re: Transpiler, a Meaningless Word (2023)

#82

Earlier quoted context omitted.

> Would it still count as a transpiler if it minifies the code at the end? I would say "yes, but the minimization is an additional step that is not actually a direct part of the transpiling process." :-) So, a program that does this would not a transpiler by itself, but a program that - executes a pipeline of which the transpiling is the most important step, - can also be used as a transpiler by making transpiling th…

What if the minification is inseparable from the transpiler? Like what if it converts the SCSS into some weird graph representation, applies the transpilation features (variables, mixins, etc) on that graph representation, then converts the graph representation into minified CSS? At no point in the process was it ever human-readable CSS. I don't know enough about the internals of transpilers to know if they actually…

What you describe is in my opinion a corner case. The following is just my personal opinion on this topic; it is very easy to argue for a different viewpoint:

I personally think that the central point whether it is a transpiler or not is whether the generated output is in the "spirit" in which the output language was conceived to be written by a human programmer.

So, if the outputted CSS code is in a rather similar "spirit" to how a human programmer would write it (though having possibly lots of traces of being auto-generated), it is a transpiler.

For example, if a transpiler generates hundreds of rules for CSS classes, but humans would solve the problem very differently using CSS code, it is rather not a transpiler, but some program that uses CSS as an output format for the reason that this is the output format that has to be used for technical reasons.

This of course encompasses the case of minified CSS code: hardly any programmer would write minified CSS code in a text editor.

Similarly, I would argue that a "transpiler" that generates highly non-idiomatic C code (i.e. it is "insanely obvious" that the output is not C code in the sense how the C language is "intended" to be used) is not a transpiler, but rather a compiler that uses C as some kind of high-level assembler code for output.

In this sense I would indeed say that some "transpiler" that generates highly non-idiomatic JavaScript code is in my opinion rather a compiler that uses JavaScript as an output format because it is necessary because this is necessary to run the code in the browser. I am of course aware that many programmers do have a different opinion here.

So, I would say a strong rule of thumb to decide transpiler or not transpiler is: if there was a choice to use a different output language than the destination language - would the transpiler use the latter one instead? So, to answer your question

> And furthermore, what if you run Prettier on the minified output, turning it into readable CSS? The pipeline as a whole would input SCSS and output formatted CSS and therefore would be considered a transpiler, but the subprogram that does all of the SCSS heavy lifting would input SCSS and output minified SCSS, making it not a transpiler.

If the goal is clearly to generate idiomatic CSS code that can be well understood by a human programmer, by my stance it clearly is a transpiler. If you, on the hand, create such an example just to find a corner case for "transpiler or not transpiler", I would say it is not.

Re: Transpiler, a Meaningless Word (2023)

#85

IMO: Transpilers are compilers, but not all compilers are transpilers. In my book, transpilers are compilers that consume a programming language and target human-readable code, to be consumed by another compiler or interpreter (either by itself, or to be integrated in other projects). i.e. the TypeScript compiler is a transpiler from TS to JS, the Nim compiler is a transpiler from Nim to C, and so on. I guess if you…

I can read 6502 machine code raw hex. Now what. ;-)

Re: Transpiler, a Meaningless Word (2023)

#86
post #79
post #16

Whenever someone argues the uselessness or redundancy of a particular word, a helpful framework to understand their perspective is "Lumpers vs Splitters" : https://en.wikipedia.org/wiki/Lumpers_and_splitters An extreme caricature example of a "lumper" would just use the word "computer" to label all Turing Complete devices with logic gates. In that mindset, having a bunch of different words like "mainframe" , "pc" , "…

"Compiler" encompassing "transpiler" I think is wrong anyway. There's a third term that doesn't seem to get nearly as much pushback, that didn't come up in your link, has yet to be mentioned here, and isn't in the article, but adds context for these two: decompiler. Compiling is high-level to low-level (source code to runnable, you rarely look at the output). Decompiling is low-level to high-level (runnable to source…

I like your definitions, but all three of these could be called subsets of compilers.

Re: Transpiler, a Meaningless Word (2023)

#87
post #37

Earlier quoted context omitted.

> I'm not convinced your L/S dichotomy applies. Proceeds to urm actually split.

All ontologies are false. But some are useful.

To be a lumper for a second, all models are flawed. But some are useful.

Re: Transpiler, a Meaningless Word (2023)

#88
post #65

Earlier quoted context omitted.

> i think the apparent 'lumper' is just a person ignorant of classification scheme offered, or at least, ignorant of what property it purports to capture. >In each case there is a real objective distinction No, Lumper-vs-Splitter doesn't simply boil down to plain ignorance. The L/S debate in the most sophisticated sense involves participants who actually know the proposed classifications but _chooses_ to discount the…

I agree there can be such debates; that's kinda my point. I'm just saying, often there is no real debate it's just one side is ignorant of the distinctions being made. Any debate in which one side makes distinctions and the other is ignorant of them will be an apparent L vs. S case -- to show "it's a real one" requires showing that answering the apparent L's question doesnt "settle the matter". In the vast majority o…

> it's just one side is ignorant of the distinctions being made.

> No, Lumper-vs-Splitter doesn't simply boil down to plain ignorance.

If I can boil it down to my own interpretation: when this argument occurs, both sides usually know exactly what each other are talking about, but one side is demanding that the distinction being drawn should not be important, while the other side is saying that it is important to them.

To me, it's "Lumpers" demanding that everyone share their value system, and "Splitters" saying that if you remove this terminology, you will make it more difficult to talk about the things that I want to talk about. My judgement about it all is that "Lumpers" are usually intentionally trying to make it more difficult to talk about things that they don't like or want to suppress, but pretending that they aren't as a rhetorical deceit.

All terminology that makes a useful distinction is helpful. Any distinction that people use is useful. "Lumpers" are demanding that people not find a particular distinction useful.

Your "apparent L's" are almost always feigning misunderstanding. It's the "why do you care?" argument, which is almost always coming from somebody who really, really cares and has had this same pretend argument with everybody who uses the word they don't like.

Re: Transpiler, a Meaningless Word (2023)

#89
post #74
post #16

Whenever someone argues the uselessness or redundancy of a particular word, a helpful framework to understand their perspective is "Lumpers vs Splitters" : https://en.wikipedia.org/wiki/Lumpers_and_splitters An extreme caricature example of a "lumper" would just use the word "computer" to label all Turing Complete devices with logic gates. In that mindset, having a bunch of different words like "mainframe" , "pc" , "…

>An extreme caricature example of a "lumper" would just use the word "computer" to label all Turing Complete devices with logic gates. "Computer"? You mean object, right?

You mean point of local maximum in the mass field?
Post reply on HN